Skip to content

CLI Commands

Terminal window
affer <command> [flags]

Running affer with no arguments in an interactive terminal launches the TUI. In pipes or non-TTY scripts, it prints usage help.

Global flags must appear before the subcommand:

Flag Description
--config <path> Load an extra affer.json configuration layer.
--data-dir <dir> Override the local data directory (AFFER_DATA_DIR).
--version, -V Print the installed version and exit.
--help, -h Print CLI usage help and exit.
Command Description
tui Launch the interactive terminal UI.
run Execute a one-shot agent run (accepts piped stdin).
resume Resume an existing session by ID, name, or --last.
fork Fork a session into a new session (supports --before-turn).
archive Move a session rollout into archived_sessions/.
unarchive Restore an archived session.
delete Delete a session (--force skips confirmation).
queue Enqueue follow-up prompts for a session (--resume to drain).
migrate-rollouts Convert legacy SQLite sessions to JSONL rollouts + projection.
serve Start the local HTTP API server (NDJSON /run endpoint).
sessions List, inspect, fork, archive, or query session turns and items.
models List available models from the provider catalog.
mcp List, add, remove, or proxy MCP servers.
auth Manage provider API keys (login, logout, status).
config Get, set, or list configuration values.
doctor Run local environment health checks.
upgrade Check for a newer @affer-dev/cli release.
completion Generate shell completion scripts for bash, zsh, or fish.
version Print the CLI version.