Skip to content

Headless CI & HTTP Server

Beyond the interactive TUI, the same affer binary supports non-interactive CLI runs and a local HTTP server.

Use affer run for automated scripts, pull request checks, or scheduled jobs:

Terminal window
affer run "run go test ./... and summarize any failures"

For machine-readable streaming output (NDJSON), pass the stream JSON format flag:

Terminal window
affer run --output-format stream-json "fix lint errors in internal/"

affer returns standard exit codes so CI pipelines can branch cleanly:

Code Meaning
0 Success
1 Runtime or agent error
2 Invalid CLI usage or flags
130 Aborted via SIGINT

Start a local HTTP server exposing an NDJSON /run endpoint:

Terminal window
affer serve

Use this when integrating affer with editor extensions, local scripts, or custom dashboards.