CLI
Use this page to look up commands, options, exit codes, and environment variables for afe.
The afe command runs flows, serves the engine, and inspects tickets. It talks to a server over
the API unless a command says --local.
afe --help
afe <command> --help
afe validate
Check every manifest in a folder and print all the issues.
afe validate config/ # the folder positionally
afe validate -c config/ # or with the flag
| Option | Default | Meaning |
|---|---|---|
[folder] | — | The configuration folder, positionally (the same as --config). |
--config, -c | . | The configuration folder. |
Exit code 1 when there is any error, 0 otherwise.
afe serve
Serve the engine API on a configuration folder. The token comes from AFE_API_TOKEN.
| Option | Default | Meaning |
|---|---|---|
--config, -c | . | The configuration folder. |
--host | 127.0.0.1 | Interface to listen on. |
--port | 8765 | Port to listen on. |
--ops-host | 127.0.0.1 | Interface for /livez, /readyz and /metrics. |
--ops-port | off | Port for /livez, /readyz and /metrics; off when absent. |
--session-hours | 8 | Hours a browser session lasts. |
--ui | off | Serve the web UI too. |
afe worker
Run queued tickets until SIGINT or SIGTERM.
| Option | Default | Meaning |
|---|---|---|
--config, -c | . | The configuration folder. |
--concurrency | 1 | Tickets to run at once. |
--dry | off | Run agents on the dry harness. |
--ops-host | 127.0.0.1 | Interface for /livez, /readyz and /metrics. |
--ops-port | off | Port for /livez, /readyz and /metrics; off when absent. |
afe run
Start a ticket and follow it; answer its questions when there is a terminal.
| Option | Default | Meaning |
|---|---|---|
<flow> | — | The flow to run (positional). |
--input, -i | — | The ticket input (YAML). Required. |
--config, -c | . | The configuration folder, with --local. |
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
--local | off | Run the engine in process. |
--dry | off | With --local: agents on the dry harness. |
--project | — | The project the flow works on. |
--revision | current | Run on this configuration revision, not the current one. |
afe resume
Answer a paused ticket (or restart it) and follow it.
| Option | Default | Meaning |
|---|---|---|
<ticket> | — | The ticket to resume (positional). |
[action] | — | The answer, one of the offered actions (positional). |
--comment | — | A comment with the answer. |
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
afe rerun
Start a ticket again on the same configuration revision, and follow it.
| Option | Default | Meaning |
|---|---|---|
<ticket> | — | The ticket to run again (positional). |
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
afe cancel
Cancel a ticket; its artifacts are kept.
| Option | Default | Meaning |
|---|---|---|
<ticket> | — | The ticket to cancel (positional). |
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
afe inspect
Show a ticket: state, totals, the question it waits on, artifacts.
| Option | Default | Meaning |
|---|---|---|
<ticket> | — | The ticket to show (positional). |
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
afe tickets
List tickets.
| Option | Default | Meaning |
|---|---|---|
--state | all | Only tickets in this state. |
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
afe workers
List live workers and queue metrics.
| Option | Default | Meaning |
|---|---|---|
--url | ws://127.0.0.1:8765/rpc | The engine API URL. |
Exit codes
| Code | Meaning |
|---|---|
0 | The ticket is done. |
2 | The ticket waits for a person. |
1 | Anything else: a failure, a bad configuration, an API error. |
Environment
| Variable | Read by | Meaning |
|---|---|---|
AFE_API_TOKEN | the remote commands | The bearer token; required to talk to a server. |
AFE_POSTGRES_DSN, AFE_REDIS_URL | serve, worker | The connection strings named by a Runtime (see Runtime). |
A remote command with AFE_API_TOKEN unset prints one line, error: set AFE_API_TOKEN to talk to a server, and exits 1 instead of a traceback.