Skip to content
AFK / Docs

Search page titles and summaries. Shortcut: Ctrl / ⌘ K.

38 pages found

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

FlagDefaultDescription
--hubHosted AFKAFK hub WebSocket URL. Most hosted installs can omit this.
--api-keyAFK daemon API key. Overrides api_key in ~/.afk/config.
--homeUser homeHome directory for AFK config/data and the default project access boundary.
--namehostnameDisplay 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.pem

For 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/you

afk 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

FlagDefaultDescription
--projectCurrent directoryProject directory for the session.
--taskInitial task for the agent.
--machineAny available daemonTarget daemon machine ID.
--modelConnection defaultModel override for this session.
--hubHosted AFKAFK 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

FlagDescription
--projectProject directory.
--taskTask description.
--providerLLM provider key.
--api-keyLLM provider API key.
--modelModel name.
--base-urlCustom base URL for OpenAI-compatible endpoints.
--modePermission mode: yolo, auto, interactive.
--agentNamed agent persona.

afk status

Show runtime diagnostics for the current session, including active model, workspace, loaded guidance, and configured integrations.

afk status

From within the browser UI, you can also run /status in the chat input to open diagnostics for the current session.


Global flags

FlagDescription
--versionPrint the AFK version and exit.
--helpPrint 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