Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI overview

Flock is a single binary (flock) with subcommands for goal runs, evolution, multiplexer control, MCP, and diagnostics.

Precedence

Configuration resolves in this order (highest wins):

  1. CLI flags — e.g. --goal, --plugin, --json
  2. Environment variables — e.g. FLOCK_MUX_AUTO, FLOCK_SESSION_SPEND_CAP_USD
  3. Layered config files — see flock.toml

Output modes

ModeFlag / entrypointUse when
Human textdefaultInteractive terminal
NDJSON eventsflock run --jsonCI, automation, log pipelines
MCP stdioflock mcpCursor, Claude Desktop, other MCP clients
ACP stdioflock acpEditor-class agents (Zed, experimental)
Socket NDJSONflock multiplexer serverDashboard, remote attach, HerdR parity

Episode JSON is always written to .flock/episodes/<goal-id>.json on successful runs (separate from --json stdout).

Top-level commands

CommandPage
runrun
evolveevolve
remoteremote
herdherd
pluginplugin
mcpmcp
telemetrytelemetry
doctordoctor
replayreplay
swarm-demo, rah-demodemos

Other commands: multiplexer, acp, skills, drift-check, memory, integration, vitals, genome, dashboard, ipc (deprecated). Run flock <cmd> --help for flags.

Help snapshots

CLI help is snapshot-tested in CI. After intentional CLI changes:

UPDATE_SNAPSHOTS=1 cargo test -p flock-cli cli_help_snapshot

See Deployment.

Recipes

First episode (gridworld):

flock run --goal "reach target" --plugin gridworld

Headless CI with typed events:

flock run --goal "reach target" --plugin gridworld --json | grep episode_end

Daily-driver mux path:

flock multiplexer server &
flock dashboard &
flock run --goal "reach target" --plugin gridworld --mux

Evolve then seed a run:

flock evolve --episodes 10 --workspace .flock/episodes
flock run --goal "reach target" --plugin gridworld --seed-archive