agent-procs
Concurrent process runner for AI agents. Processes run in a background daemon and persist across CLI invocations.
Install
cargo install agent-procs
Quick start
# Start a process
# Wait for it to be ready
# Check output
# See what's running
# Stop it
Config file
Create an agent-procs.yaml to manage multiple processes together:
session: myproject # optional — isolates this project's processes
proxy: true # optional — enables reverse proxy
proxy_port: 9095 # optional — pin proxy to a specific port
processes:
db:
cmd: docker compose up postgres
ready: "ready to accept connections"
api:
cmd: ./start-api-server
cwd: ./backend
env:
DATABASE_URL: postgres://localhost:5432/mydb
ready: "Listening on :8080"
port: 8080
depends_on:
Processes start in dependency order; independent ones run concurrently.
Field reference
Per-process fields:
| Field | Required | Description |
|---|---|---|
cmd |
yes | Shell command to execute |
cwd |
no | Working directory (relative to config file location) |
env |
no | Environment variables (key: value map) |
ready |
no | Stdout pattern that signals the process is ready |
depends_on |
no | List of process names that must be ready first |
port |
no | Port number — injected as PORT and HOST=127.0.0.1 env vars |
Top-level fields:
| Field | Required | Description |
|---|---|---|
session |
no | Session name (overridden by --session CLI flag) |
proxy |
no | Enable reverse proxy (default: false) |
proxy_port |
no | Pin proxy to a specific port (default: auto-assign from 9090-9190) |
Reverse proxy
Give processes stable named URLs instead of port numbers. Opt-in via proxy: true in config or --proxy on the CLI.
)
)
- Processes without an explicit
portget one auto-assigned (4000-4999 range) PORTandHOST=127.0.0.1are injected into the process env (user env takes precedence)- Each session gets its own proxy port, so two projects can both have
apiwithout conflict
Ad-hoc usage without a config file:
# → http://api.localhost:9090
Commands
| Command | Description |
|---|---|
run <cmd> [--name N] [--port P] [--proxy] |
Spawn a background process |
stop <name> |
Stop a process |
stop-all |
Stop all processes |
restart <name> |
Restart a process |
status [--json] |
Show all process statuses |
logs <name> [--tail N] [--follow] [--stderr] [--all] |
View process output |
wait <name> --until <pattern> [--regex] [--timeout N] |
Wait for output pattern |
wait <name> --exit [--timeout N] |
Wait for process to exit |
up [--only X,Y] [--config path] [--proxy] |
Start from config file |
down |
Stop config-managed processes |
session list |
List active sessions |
session clean |
Remove stale sessions |
ui |
Open terminal UI |
completions <shell> |
Generate shell completions (bash, zsh, fish, powershell) |
Sessions
Use --session to isolate process groups (e.g. per-project):
Architecture
The CLI communicates with a per-session background daemon over a Unix domain socket. The daemon manages process lifecycles, captures stdout/stderr to log files, and handles wait conditions. The daemon auto-starts on first use and exits when all processes are stopped.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (timeout, connection failure, unexpected response) |
| 2 | No logs found for target process |