CLI Reference

Complete reference for all swarm CLI commands and flags.

Usage

swarm <COMMAND>

Commands

swarm init

Initialize swarm configuration for a project. Creates ~/.swarm/settings.json with a template entry if it doesn't exist.

FlagTypeDefaultDescription
--pathPathBuf.Path to the project directory

swarm start

Start a swarm session. Executes the 13-step orchestrator start flow.

FlagTypeDefaultDescription
--stashboolfalseAuto-stash uncommitted changes before starting
--initboolfalseInitialize git repo if not already initialized
--no-tuiboolfalseRun in headless mode (no terminal UI)

swarm stop

Stop a running swarm session. Sends SIGTERM to the orchestrator and waits for graceful shutdown.

FlagTypeDefaultDescription
--mergeboolfalseMerge agent branches into base (default if no flag set)
--squashboolfalseSquash-merge agent branches
--discardboolfalseDiscard agent branches without merging

The --merge, --squash, and --discard flags are mutually exclusive. If none are specified, merge is the default behavior.

swarm status

Show session status including agent states, uptime, and beads summary.

FlagTypeDefaultDescription
--jsonboolfalseOutput in JSON format

swarm logs

View agent logs.

ArgumentTypeRequiredDescription
agentStringYesAgent name
FlagTypeDefaultDescription
--followboolfalseTail the log (like tail -f)
--sessionu32nullView archived session log instead of current

swarm send

Send a message to a specific agent.

ArgumentTypeRequiredDescription
agentStringYesRecipient agent name
messageStringYesMessage body
FlagTypeDefaultDescription
--urgentboolfalseMark as urgent (triggers interrupt)

swarm broadcast

Send a message to all agents.

ArgumentTypeRequiredDescription
messageStringYesMessage body
FlagTypeDefaultDescription
--urgentboolfalseMark as urgent

swarm config

Show the resolved configuration for the current project.

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON instead of formatted

swarm clean

Clean stale swarm artifacts (worktrees, branches, session files).

FlagTypeDefaultDescription
--forceboolfalseRemove artifacts without confirmation

swarm workflow

Manage workflow definitions and runs. This is a subcommand group:

swarm workflow list

List available workflow definitions.

swarm workflow run

Start a workflow run.

ArgumentTypeRequiredDescription
nameStringYesWorkflow name
FlagTypeDefaultDescription
--inputKEY=VALUE[]Input key=value pairs (repeatable)

swarm workflow status

Show status of running/completed workflows.

ArgumentTypeRequiredDescription
run_idStringNoSpecific run ID (omit to list all)
FlagTypeDefaultDescription
--jsonboolfalseOutput in JSON format

swarm workflow approve

Approve a human-approval gate.

ArgumentTypeRequiredDescription
run_idStringYesWorkflow run ID
stageStringYesStage name

swarm workflow reject

Reject a gate with optional feedback.

ArgumentTypeRequiredDescription
run_idStringYesWorkflow run ID
stageStringYesStage name
FlagTypeDefaultDescription
--feedbackStringnullFeedback message

swarm workflow retry

Manually retry a failed stage.

ArgumentTypeRequiredDescription
run_idStringYesWorkflow run ID
stageStringYesStage name

swarm workflow cancel

Cancel a running workflow.

ArgumentTypeRequiredDescription
run_idStringYesWorkflow run ID

swarm workflow show

Show detailed run info including outputs.

ArgumentTypeRequiredDescription
run_idStringYesWorkflow run ID

swarm workflow validate

Validate a workflow definition.

ArgumentTypeRequiredDescription
nameStringYesWorkflow name

swarm iterate

Run an iteration loop from a configuration file.

FlagTypeDefaultDescription
--configStringnullIteration config name (looked up in .swarm/iterations/<name>.yml)
--config-filePathBufnullPath to iteration config YAML file
--resumeStringnullResume a previous iteration run
--max-iterationsu32nullOverride max_iterations from config
--dry-runboolfalseValidate config and show plan without executing
--no-tuiboolfalseRun without TUI
--jsonboolfalseOutput progress as JSON lines

The --config and --config-file flags are mutually exclusive.