CLI Reference
The afk binary provides browser-launch, daemon, spawn, and agent commands for developers. Run afk --help or afk <command> --help for inline help.
afk open
Open the hosted AFK browser app at New Session without starting or configuring a local daemon. Project and task values are editable hints; AFK never starts the session until you review and confirm the form.
afk open
afk open "Review this project"
afk open --project ~/Work/project "Review authentication"The project defaults to the current directory. The browser remains responsible for selecting the owner, machine, connection, model, permissions, and isolation. AFK detects the installed PWA protocol handler where the operating system exposes it, and opens the PWA when it is available; otherwise it opens a normal browser tab. Use--pwa to require the PWA route, --dashboard or--session ID for explicit navigation, and--protocol for the legacy afk://new handler.
afk daemon
Start the AFK daemon on a developer machine. The daemon works with local projects and connects them to the AFK browser app.
afk daemon [options]Options
| Flag | Default | Description |
|---|---|---|
--hub | Hosted AFK | AFK hub WebSocket URL. Most hosted installs can omit this. |
--api-key | — | AFK daemon API key. Overrides api_key in ~/.afk/config. |
--home | User home | Home directory for AFK config/data and the default project access boundary. |
--name | hostname | Display name for this daemon in the browser UI. |
Config file
Daemon settings can be stored in ~/.afk/config:
api_key=afk_your_key_here
server=wss://afk-server.mooglest.com
home=/home/you
name=my-workstation
ca_cert_file=/path/to/company-ca.pemFor a corporate VPN, proxy, private model gateway, or enterprise Git provider that uses a company CA, set ca_cert_file to a readable PEM or DER certificate bundle. AFK adds those certificates to the normal JVM and process trust roots, including spawned MCP servers; it does not replace public CAs or disable TLS or hostname verification. You can alternatively set AFK_CA_CERT_FILE or the conventional SSL_CERT_FILE environment variable before starting the daemon. Restart the daemon after changing this setting.
Example
afk daemon --api-key afk_your_key_here --home /home/youafk spawn
Spawn an agent session directly from the CLI without opening the browser. The CLI spawn path is intentionally small; use the browser spawn modal for agent persona selection, connection/model routing, permission mode, Docker-backed remote repositories, and workspace isolation controls.
afk spawn [options]Options
| Flag | Default | Description |
|---|---|---|
--project | Current directory | Project directory for the session. |
--task | — | Initial task for the agent. |
--machine | Any available daemon | Target daemon machine ID. |
--model | Connection default | Model override for this session. |
--hub | Hosted AFK | AFK hub WebSocket URL. |
Current CLI spawn requests use the daemon/browser spawn path with a minimal payload. Configure richer spawn options from the browser UI.
Examples
# Basic spawn
afk spawn --project /home/you/projects/myapp --task "fix the failing auth tests"
# Target a specific daemon and model
afk spawn --project /home/you/projects/myapp --machine macbook-pro --model claude-sonnet --task "review the PR changes in the billing module"afk agent
Run an agent process directly. Most users should use the browser or afk spawn; direct agent invocation is mainly for advanced troubleshooting.
afk agent [options]Common options
| Flag | Description |
|---|---|
--project | Project directory. |
--task | Task description. |
--provider | LLM provider key. |
--api-key | LLM provider API key. |
--model | Model name. |
--base-url | Custom base URL for OpenAI-compatible endpoints. |
--mode | Permission mode: yolo, auto, interactive. |
--agent | Named agent persona. |
afk status
Show runtime diagnostics for the current session, including active model, workspace, loaded guidance, and configured integrations.
afk statusFrom within the browser UI, you can also run /status in the chat input to open diagnostics for the current session.
Global flags
| Flag | Description |
|---|---|
--version | Print the AFK version and exit. |
--help | Print usage for the current command. |
Daemon config file reference
The daemon reads ~/.afk/config at startup. Command-line flags override values in the file.
# ~/.afk/config
api_key=afk_your_key_here
server=wss://afk-server.mooglest.com
home=/home/you
name=my-workstation