erg.

Multi-repo

A single erg daemon can watch multiple repositories, each with its own workflow configuration. All repos share a global pool of concurrency slots — when a slot is free, the daemon picks up the next issue from any repo.

Config file

Create a YAML config file that lists the repos and an optional global max_concurrent limit. Each repo can specify a workflow path; if omitted the daemon looks for the default <repo>/.erg/workflow.yaml.

config.yaml
max_concurrent: 5          # global slot pool shared across all repos

repos:
  - path: /home/user/backend       # uses <path>/.erg/workflow.yaml
  - path: /home/user/frontend
    workflow: /path/to/frontend-workflow.yaml
  - path: /home/user/local-project

Starting the daemon

Pass the config file to erg start with the --config flag. The flag is mutually exclusive with --repo and --workflow.

$ erg start --config config.yaml

Or in the foreground for development:

$ erg start -f --config config.yaml

How concurrency works

The max_concurrent in the config file sets the global number of slots. A slot is a slot regardless of which repo the work came from — if three of five slots are running backend tasks, the remaining two can pick up frontend issues.

If the config file omits max_concurrent, the default (3) is used. Per-repo settings.max_concurrent in individual workflow files is ignored in multi-repo mode; the config file value always wins.

Config reference

Key Type Description
max_concurrent int Global concurrency limit — maximum sessions running at once across all repos. Default 3.
repos list One or more repo entries. At least one is required.
repos[].repo string Repository identifier — either owner/repo or an absolute filesystem path.
repos[].workflow string Optional path to a workflow config file for this repo. If omitted, uses <repo>/.erg/workflow.yaml.

Brew services (macOS)

If you installed erg via Homebrew, you can use brew services to run it as a persistent background service that starts on login and restarts on crash.

Setup

First, create a daemon config file at ~/.erg/daemon.yaml listing the repos you want erg to watch. This uses the same format as the multi-repo config:

~/.erg/daemon.yaml
max_concurrent: 3

repos:
  - path: /home/user/backend
  - path: /home/user/frontend

Each repo should already have an .erg/workflow.yaml — run erg configure inside each repo first.

Managing the service

$ brew services start erg
Command Description
brew services start erg Start erg and register it to launch on login
brew services stop erg Stop erg and remove the login item
brew services restart erg Restart erg (e.g. after updating config)
brew services info erg Show service status

Default config auto-discovery

When ~/.erg/daemon.yaml exists, several commands work without any flags:

If multiple daemons are running, stop and status will list them and ask you to specify --repo.

made by zack · mit license