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.
standingThe sessions the-loop keeps for itself — no work item, addressed by name: list, start, stop, restart, and say to talk to one.
instancesThe fleet a manager serves: list on any instance; register / unregister on a manager, writing the registry through the same splice as the Settings tab.
askPost an agent's question on its work item — marker stamped centrally, wait recorded as session.awaiting_input.
commentPost the agent's comment on its work item — marked, enveloped, mirrored to subscribed channels.
ticketshow a ticket (body, comments, attachment links) as JSON, create one, or close a registered work item's.
prcreate a pull request and link it in one act; status, checks (each check, with failed jobs' log tails), threads, resolve-thread, ready (a draft → ready for review), and merge (gated by routing.mergeOnApproval); lifecycle acts need a registered work item.
add-collaboratorGive one GitHub login a voice on one work item: their comments become input for its session, and nothing else.
remove-collaboratorTake that voice back; it lapses on the next event.
channelsOperate the conversation channels (the Slack bot): status, threads, one poll cycle, the Socket Mode listener (replies, buttons, the /the-loop command), or the app manifest to import.
eventsQuery the structured event log — the answer to "why did nothing happen?".

Repo-scoped commands ​

Run once, inside a checkout. They read the project's files and the operator's CLI config — never the project's harness config, which is the agent's (decision-123) — and are no part of the daemon (decision-032). They run with no cli-config.yaml at all, on defaults, which is what lets check run as a CI gate in a bare checkout (--spec-dir when the specs are not under docs/specs).

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.
hooksThe lifecycle hooks your CLI config declares, importing nothing — and points, the catalog they can attach to.
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 subcommand — the-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.