Skip to main content

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
OptionDefaultMeaning
[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.

OptionDefaultMeaning
--config, -c.The configuration folder.
--host127.0.0.1Interface to listen on.
--port8765Port to listen on.
--ops-host127.0.0.1Interface for /livez, /readyz and /metrics.
--ops-portoffPort for /livez, /readyz and /metrics; off when absent.
--session-hours8Hours a browser session lasts.
--uioffServe the web UI too.

afe worker​

Run queued tickets until SIGINT or SIGTERM.

OptionDefaultMeaning
--config, -c.The configuration folder.
--concurrency1Tickets to run at once.
--dryoffRun agents on the dry harness.
--ops-host127.0.0.1Interface for /livez, /readyz and /metrics.
--ops-portoffPort for /livez, /readyz and /metrics; off when absent.

afe run​

Start a ticket and follow it; answer its questions when there is a terminal.

OptionDefaultMeaning
<flow>—The flow to run (positional).
--input, -i—The ticket input (YAML). Required.
--config, -c.The configuration folder, with --local.
--urlws://127.0.0.1:8765/rpcThe engine API URL.
--localoffRun the engine in process.
--dryoffWith --local: agents on the dry harness.
--project—The project the flow works on.
--revisioncurrentRun on this configuration revision, not the current one.

afe resume​

Answer a paused ticket (or restart it) and follow it.

OptionDefaultMeaning
<ticket>—The ticket to resume (positional).
[action]—The answer, one of the offered actions (positional).
--comment—A comment with the answer.
--urlws://127.0.0.1:8765/rpcThe engine API URL.

afe rerun​

Start a ticket again on the same configuration revision, and follow it.

OptionDefaultMeaning
<ticket>—The ticket to run again (positional).
--urlws://127.0.0.1:8765/rpcThe engine API URL.

afe cancel​

Cancel a ticket; its artifacts are kept.

OptionDefaultMeaning
<ticket>—The ticket to cancel (positional).
--urlws://127.0.0.1:8765/rpcThe engine API URL.

afe inspect​

Show a ticket: state, totals, the question it waits on, artifacts.

OptionDefaultMeaning
<ticket>—The ticket to show (positional).
--urlws://127.0.0.1:8765/rpcThe engine API URL.

afe tickets​

List tickets.

OptionDefaultMeaning
--stateallOnly tickets in this state.
--urlws://127.0.0.1:8765/rpcThe engine API URL.

afe workers​

List live workers and queue metrics.

OptionDefaultMeaning
--urlws://127.0.0.1:8765/rpcThe engine API URL.

Exit codes​

CodeMeaning
0The ticket is done.
2The ticket waits for a person.
1Anything else: a failure, a bad configuration, an API error.

Environment​

VariableRead byMeaning
AFE_API_TOKENthe remote commandsThe bearer token; required to talk to a server.
AFE_POSTGRES_DSN, AFE_REDIS_URLserve, workerThe 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.

See also​

  • API for the protocol used by remote commands.
  • Manifests for configuration fields.
  • Web UI for the browser interface.