Skip to content

CLI cookbook

Task-oriented recipes. Command syntax details live in the CLI reference.

Terminal window
for repo in api web cli; do
openloop task add -p "$repo" --title "Sweep flaky tests" --kind test --risk low
done
openloop service start

Or schedule it once and let cron re-queue it weekly, add to .openloop/project.json:

{ "schedule": [{ "id": "flaky-sweep", "cron": "0 9 * * 1", "title": "Sweep flaky tests" }] }
Terminal window
openloop digest --since-hours 12 # what happened, what's waiting
openloop approval list -p api # human-review packets
openloop promotion list -p api --status pending

Approve or reject in bulk:

Terminal window
openloop promotion apply -p api --task add-rate-limit-headers --note "checked"
openloop promotion reject -p api --task migrate-auth-lib --note "needs design first"
Terminal window
openloop config set budgets.dailyCostUsd 5 # small ceiling while evaluating
openloop config set runtime.maxAttemptsPerTask 1
openloop config set runtime.projectSelectionStrategy focus
openloop project activate api

Then loosen as trust grows. Pair it with a policy that starts conservative:

scope:
denyGlobs: ["infra/**", ".github/**", "migrations/**"]
highRiskAreas: ["src/auth/**"]
Terminal window
openloop config add-hook \
--type command \
--events promotion-auto-merge-queued \
--command 'node scripts/review-gate.mjs'

scripts/review-gate.mjs reads the JSON payload from stdin and prints {"requireManualReview": true, "note": "…"} to downgrade the merge (see hooks).

Terminal window
openloop issue set-source -p api --github myorg/myrepo --auto-sync
openloop issue sync -p api

Label issues openloop in the tracker; the loop picks them up and comments progress back. Guide.

Register the MCP server in your client, then ask things like “what’s in the openloop promotion queue?” or “pause openloop while I refactor auth”.

Terminal window
openloop report --hours 12 # narrative summary
openloop events --since 12h --limit 200
openloop logs -p api # per-run summaries from .openloop/runs/
Terminal window
openloop run-once -p api --dry-run # see task selection + prompt
openloop run-once -p api # one real iteration, no daemon
openloop promotion show -p api --task <task>

run-once never starts the daemon: it’s the same pipeline, one iteration, on demand.

Terminal window
# in .openloop/project.json
{ "runtime": { "useWorktree": true, "branchPrefix": "openloop/" } }

From then on runs happen in .openloop/worktrees/ on openloop/<taskId> branches; your checkout stays clean. (Existing tasks continue fine, only new runs change behavior.)