Skip to content

Commands

bash
the-loop --help
the-loop --version
the-loop --config path/to/cli-config.yaml <command>   # must precede the subcommand

The control plane

Since issue-161 every command below that touches the-loop's state runs through the control-plane service, which is the single implementation of each capability. It is started for you on first use, so nothing here needs setting up first.

CommandWhat it does
startBring up every service the CLI config enables — the control-plane service (+ /mcp), the webhook receiver, the poller.
stopStop every running the-loop service, whatever the enabled flags say now.
statusPer-service liveness and the poller's progress; exit 0 iff everything enabled is running.
restartstop then start, optionally upgrading the CLI in between (--with-upgrade). Also POST /api/v1/restart.

Daemon commands

Long-running or machine-scoped. Their own settings come from the CLI config and from nowhere else — no repository configures the daemon (decision-044). When they act on a work item they still read that item's own checkout, the same way the repo-scoped commands do.

CommandWhat it does
sessionsThe work-item ↔ session registry, execution control (start/pause/resume/stop), and reset — forget a work item's state so it starts over.
askPost an agent's question on its work item — marker stamped centrally, wait recorded as session.awaiting_input.
eventsQuery the structured event log — the answer to "why did nothing happen?".

Repo-scoped commands

Run once, inside a checkout. They read that project's harness config and are no part of the daemon (decision-032) — they need no cli-config.yaml at all, which is what lets check run as a CI gate in a bare checkout.

CommandWhat it does
checkEvaluate a work item's nodes against its checked-in artifacts. Pure: no network, no subprocess, no mutation — so CI runs the same code the runtime does.
graphInspect and drive the process graph: show, status, advance, run, force.
criticHand a review round to a different harness and read back what it said, as one JSON envelope.
scenariosThe table of Gherkin scenarios the integration tests cover.
instructionsWhich of the project's registered custom instruction docs actually resolve — and onMissing as an exit code.

Maintenance

CommandWhat it does
installInstall the-loop itself — the CLI and the Claude Code / Cursor plugin — at user or project scope. Plans, previews, and reports every step.
upgradeThe same plan, moving an installed CLI/plugin to the current version with the installer that owns it.
migrate-configMigrate a cli-config.yaml to the current schema version. Deterministic, idempotent, previewable.

Global flags

--config PATH / -c PATH

The CLI config to use. Must precede the subcommandthe-loop --config x.yaml start, not the-loop start --config x.yaml. Same priority as $THE_LOOP_CLI_CONFIG; see where the file is found.

--version

The installed package version, read from package metadata — so it always reports what you actually have rather than a string someone forgot to bump.

Exit codes

Consistent across commands:

CodeMeaning
0Success
1Ran, and the answer is negative — a failed round, an unmet gate, a stopped run
2Could not run — bad arguments, missing work item, unreadable config, or no reachable service

Adding one

Commands come from a registry, so a new one is three steps — see extending the CLI. A registered command with no page here fails the repository's test suite, which is why this table cannot quietly fall behind the code.

Released under the MIT License.