Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

CLI Reference

This page is grounded in crates/cli/src/cli.rs.

Binary

swarmie [COMMAND]

If no command is provided, Swarmie starts the interactive REPL.

Commands

prompt (alias: p)

Run Swarmie non-interactively.

swarmie prompt [PROMPT]

PROMPT behavior:

  • If omitted, reads from stdin.
  • If set to -, reads from stdin.

Options:

FlagTypeDescription
-c, --config <key=value>repeatable stringOverride config value (dotted path supported, value parsed as TOML when possible).
-m, --model <MODEL>stringModel to use.
--provider <PROVIDER>stringProvider to use.
-p, --profile <CONFIG_PROFILE>stringConfig profile from config.toml.
--dangerously-bypass-approvalsboolBypass approval prompts in non-interactive runs.
-C, --cd <DIR>pathWorking directory root for the agent.
--jsonboolPrint events to stdout as JSONL.
--worktreeboolRun the headless session in an isolated git worktree.
--worktree-result <commit|apply|stash>enumPost-run strategy for worktree changes (default: commit).

Examples:

swarmie prompt "Summarize this repo"
swarmie prompt -m sonnet -p work
cat prompt.txt | swarmie prompt -
swarmie prompt "Explain src" --json
swarmie prompt "Review changes" --worktree
swarmie prompt "Draft fix" --worktree --worktree-result apply
swarmie prompt "Try risky refactor" --worktree --worktree-result stash
swarmie prompt "Inspect another checkout" -C ../project --worktree

resume

Resume an interactive session.

swarmie resume [--last]

Options:

FlagTypeDescription
--lastboolContinue most recent session for current workspace.

web

Start HTTP server and open web interface.

swarmie web [OPTIONS]

Options:

FlagTypeDefaultDescription
--port <PORT>u164200Port to listen on.
--hostname <HOSTNAME>string127.0.0.1Hostname/interface to bind.
--password <PASSWORD>stringnoneBootstrap password for first-run local auth setup (prefer SWARMIE_SERVER_PASSWORD).
--cors <ORIGIN>repeatable stringnoneAdditional CORS origins.
--no-openboolfalseDo not open browser automatically.

server

Start HTTP server in headless API-only mode.

swarmie server [OPTIONS]

Options:

FlagTypeDefaultDescription
--port <PORT>u164200Port to listen on.
--hostname <HOSTNAME>string0.0.0.0Hostname/interface to bind.
--password <PASSWORD>stringnoneBootstrap password for first-run local auth setup (prefer SWARMIE_SERVER_PASSWORD).
--cors <ORIGIN>repeatable stringnoneAdditional CORS origins.
--tlsboolfalseEnable TLS-aware auth cookie behavior.
--behind-proxyboolfalseTrust proxy forwarding headers for locality detection.
--auth-db-path <PATH>pathnoneOptional auth SQLite DB path.

Notes

  • swarmie web resolves bootstrap password from --password first, then SWARMIE_SERVER_PASSWORD.
  • swarmie server resolves bootstrap password from --password first, then SWARMIE_SERVER_PASSWORD.
  • HTTP auth uses session cookies and scoped API keys; password is used for setup/login only.
  • swarmie prompt exits non-zero on startup/runtime failures and auto-denies permissions unless bypass is set.
  • --worktree validates git prerequisites and may auto-stash a dirty tree before session start.
  • On teardown failure, Swarmie prints a warning and keeps the session exit code unchanged.