CLI
Reference for the codepanel command-line tool: sign-in, configuration, and every command for repositories, panels, reviews and findings.
On this page›
The CLI is a thin client over the HTTP API. For the loop a coding agent runs with it, see the Agent playbook.
Install
The CLI runs with Bun from a checkout of codepanel-tools, the public repository of CodePanel's clients. It is not on npm yet.
git clone https://github.com/Code-Panel-AI/codepanel-tools.git
cd codepanel-tools
bun install
bun run codepanel -- login
The examples below write codepanel for bun run codepanel --.
Sign in
codepanel login shows a one-time code and opens codepanel.ai/device in your browser with that code filled in. Sign in with GitHub if asked, check that the page shows the same code as your terminal, choose what the CLI may do and press Approve. The page tells you to return to the terminal, which saves the token and prints who you are signed in as.
- With no browser to open (over SSH, or on a machine with no display), it prints the link instead. Open it on any device; if the page asks for a code, type the one from your terminal.
- It signs in to codepanel.ai. Once signed in, later logins reuse the saved address. Its first line says which address it chose and why (
--url,CODEPANEL_URLor your last login).--url https://codepanel.aiworks too. - After signing in it warns if
CODEPANEL_TOKEN, or aCODEPANEL_URLfor another address, is set in your shell, since either wins over the saved login. - The code expires after 10 minutes. Only approve a code you started yourself; deny one someone sends you.
- The token lasts 90 days and appears in Settings → API tokens, where you can revoke it.
- It is saved to
credentials.json, readable only by you, in$CODEPANEL_CONFIG_DIR, else$XDG_CONFIG_HOME/codepanel, else~/.config/codepanel. - A saved token is only sent to the address it was issued for, so pointing
CODEPANEL_URLelsewhere ignores it.
To use a pasted token instead, create one in Settings → API tokens and set the variables below. The Other tab under Connect a coding agent with this token shows both with your URL filled in. A repository CI token or a webhook secret is rejected.
| Variable | Value |
|---|---|
CODEPANEL_URL |
Optional for codepanel.ai, the default. For a self-hosted deployment, its own site or its .convex.site address. The old hosted .convex.site address is read as https://codepanel.ai |
CODEPANEL_TOKEN |
A personal API token, starting with cpk_. Wins over a saved login |
CODEPANEL_AGENT |
Optional. The agent name feedback, findings dismiss, ask, handoff, learn and learning use when --agent is not given |
CODEPANEL_CONFIG_DIR |
Optional. Where the saved login lives |
TRACEPARENT |
Optional. A W3C traceparent sent with each review review --trigger starts |
Give a token only the scopes you need: read for the read commands, and repos:write, panel:write, reviews:write or budget:write for the matching writes.
Conventions
- A repository is
owner/name. A pull request isowner/name#123orowner/name 123. - Output is human-readable. Add
--jsonto any command to print the raw API response. - Options can be written
--name valueor--name=value. Switches such as--trigger,--wait,--alland--jsontake no value;--wait=falseturns one off. Unknown options and unexpected extra arguments are errors (exit 2, with the usage). Everything after--is text, for anaskquestion or alearnrule that starts with a dash.-h,--help,help, or no arguments prints the usage. - With
--json, a failure prints one JSON line to stderr,{"error":{"message","status","code",...}}, with the fields the API returned. - Ctrl-C ends any command at once, mid-request or while reading
-from stdin, with exit code 130. - On
panelsubcommands,--paneldefaults to your default panel.review --triggeruses the repository's pinned panel, else your default.
| Exit code | Meaning |
|---|---|
0 |
Success |
1 |
The request failed, or the credentials are missing or malformed (the message is printed) |
2 |
A usage error, printed with the usage text |
3 |
review --wait: --timeout passed first. The message says whether the review is still running or none has started yet (a push can take a few seconds to reach CodePanel); run it again. ask: the question is still pending |
4 |
review --wait only: the review completed but gate.blocking is still true. Fix or answer the findings it names |
5 |
review --wait only: CodePanel refused to review the commit (a budget, cap, credits, plan or key). Review it locally and submit the result with review --local --submit |
130 |
Interrupted with Ctrl-C |
review --wait exits 0 only when the review completed and the merge gate passes, and 1 when the round failed or none started (nothing began within 150 seconds of the first look). With --timeout under 150 a wait can end before then with exit 3 and a message that no review is running yet; pass --timeout 150 or more to get the final answer. ask exits 0 once answered, 1 when the question failed, and 3 while it is still pending. review --wait exits 5 when CodePanel refused to review the commit (a budget, cap, credits, plan or key): no review is coming, so review it locally (codepanel review --local), send what it found with codepanel review --local --submit result.json, and carry on. Scripts written before exit codes 4 and 5 existed, expecting only 0, 1 and 3, should handle them.
Commands
Sign-in
| Command | What it does | Key flags |
|---|---|---|
codepanel login |
Signs in through your browser and saves the token | --url <site url> (default CODEPANEL_URL, then the saved one, then codepanel.ai); --scopes read,reviews:write (the default; add repos:write or panel:write for setup); --name <label>, how the token is labelled in Settings (default codepanel CLI on <hostname>) |
codepanel logout |
Deletes the saved login. The token stays valid until you revoke it in Settings → API tokens | |
codepanel whoami |
The GitHub account, token name and scopes |
Repositories
| Command | What it does | Key flags |
|---|---|---|
codepanel repos |
Connected repositories with auto-review state, round limit and panel pin. Marks a disconnected repository, and one with no webhook ("no webhook: reconnect it") | --connectable: list GitHub repositories you can push to instead; connecting needs admin |
codepanel repos connect <owner/name> |
Connects a repository and installs the webhook | |
codepanel repos disconnect <owner/name> |
Stops reviewing a repository; past reviews are kept. The webhook stays installed; only Disconnect on the repository's Settings tab removes it | |
codepanel repos set <owner/name> |
Changes review settings (POST /repos/settings); the flags are listed below the table |
See below |
codepanel repos switches <owner/name> |
Each review switch the repository can set: on or off for its next round, its own setting and CodePanel's, or (default) when neither sets it |
|
codepanel budget [owner/name] |
The account's monthly budget and, given a repository, its cap, with this month's own-key spend, holds and what is left | |
codepanel spend <owner/name> |
The repository's model spend this UTC month by role, provider and model, then the whole account's last 30 days (credits and own keys, pull requests merged, $ per merged PR, cache-read share and its saving) and month with its projection (GET /spend, MCP get_spend) |
--json |
codepanel budget set |
Sets the monthly budget and/or a repository's cap, and prints both before and after. Needs budget:write |
--monthly <usd>|default|none (default for $25, none for no budget); --repo <owner/name> with --cap <usd>|none (none removes the cap, leaving the account budget) |
codepanel auto-reload |
Credits auto-reload: on or off, its settings, this month's reloads, and why it turned itself off | |
codepanel auto-reload on|off|set |
Turns it on or off, or changes it (set), and prints it before and after. Needs budget:write |
--threshold <usd>; --pack 25|50|100|250; --cap <usd> (at least the pack) |
codepanel credits-first |
Whether reviews spend credits first, before your own keys | |
codepanel credits-first on|off|default |
Turns it on or off, or back to the default (on), and prints it before and after. Needs budget:write |
codepanel repos set takes any of these; on/off also accept true/false. It runs on your token, which can tighten a repository's merge protections but not loosen them: a lower --gate, an App added with --trusted-bots, a contact dropped from --escalate-to, --cross-family off or none once it is on, and --auto-approve on are refused with 403, nothing in the command is applied, and the next: line names the dashboard page where a person makes the change (Who can loosen the gate):
| Flag | Sets |
|---|---|
--auto-review on|off |
Automatic reviews |
--max-auto-rounds <1-50>|none |
Automatic rounds per pull request |
--bot-max-rounds <0-50>|default |
Rounds a bot may extend a pull request to (default 5) |
--step-back-after-rounds <0-50>|default |
The round from which reviews advise stepping back (default 3, 0 off) |
--panel <id>|none |
The panel the repository is pinned to; none returns it to your default; the pin changes only when given |
--gate off|critical|warning|all |
The merge gate level; a token can raise it, not lower it |
--inline-suggestions on|off |
Inline suggestions |
--auto-approve off |
Turn off auto-approve; on is refused, since it is turned on only in the dashboard |
--agent-files on|off |
Reading AGENTS.md and CLAUDE.md (off by default) |
--switches NAME=on|off|default,... |
Review switches; default follows CodePanel's default again |
--escalate-to <login,...>|none, --escalate-on <triggers> |
Escalation to a person; triggers are upheld_critical, round_limit, step_back and novel |
--cross-family on|off|none, --full-lane-paths <glob,...>, --full-lane-marker <text> |
Cross-family verdicts; none clears the setting |
Panels, models and keys
| Command | What it does | Key flags |
|---|---|---|
codepanel panel tools |
Shows actual reviewer tools, limits and effective switch | optional --repo owner/name; includes no-history limitation |
codepanel panel |
Each panel with its reviewers, orchestrator, effort and whether it is ready | |
codepanel panel roles |
Reviewer roles with cost tier and suggested effort; starter roles are marked (default) |
|
codepanel models |
Models your keys, or CodePanel credits, can reach | |
codepanel keys |
Which providers have a working key, never the key | |
codepanel panel add-reviewer --role <id> |
Adds a reviewer from a role: the role fills in the name, instructions and effort, and a model is suggested on its tier | --panel; --provider and --model override the suggestion (--model needs --provider); --effort, --name, --prompt override the role's |
codepanel panel add-reviewer --provider <p> --model <m> |
Adds a reviewer with a model you choose | --panel, --effort, --name, --prompt |
codepanel panel remove-reviewer --reviewer <id> |
Removes a reviewer | --panel |
codepanel panel update-member --reviewer <id> |
Changes a member's model, effort or instructions | --provider and --model together; --effort; --name; --prompt (reviewers); --instructions (orchestrator); --path-scope (reviewer scope JSON or null) |
codepanel panel orchestrator --provider <p> --model <m> |
Sets the orchestrator | --panel, --effort |
codepanel panel recommend |
Recommends reviewers and an orchestrator for a goal, with an estimated cost a round and a pull request. Changes nothing | --cost low|medium|high (tiers), --quality low|medium|high (roles and effort), --repo (that repository alone, priced from its recent rounds) or --panel, --roles a,b, --provider, --max-usd-per-pr |
codepanel panel apply |
Applies the recommendation for the same options and prints the command that undoes it | The same as panel recommend |
codepanel panel restore --file <path|-> |
Puts a panel back as panel apply found it, from its --json output or its undo object |
|
codepanel panel set |
Renames a panel or sets its per-PR limit | --panel, --name, --budget <usd>|none (2.50 is $2.50; none turns it off) |
--effort is none, low, medium, high, xhigh or max. --agent still works as the older spelling of --reviewer. Provider keys can only be added in the browser. Limits are explained in Budgets and spending limits.
Knowledge, learnings and quality
| Command | What it does | Key flags |
|---|---|---|
codepanel knowledge <owner/name> |
Prints the repository's rules, notes, verdicts and learnings as one Markdown document | --json for the full response |
codepanel knowledge set <owner/name> <file|-> |
Replaces the rules and notes with an edited copy of that document, from a file or stdin (-) (POST /knowledge) |
|
codepanel learnings <owner/name> |
Lists the repository's learnings (L3) with their scope and state |
|
codepanel learn <owner/name> <text...> |
Records a learning. An agent's waits for a person, or another identity on another pull request, to confirm it | --scope <path prefix>, --pr <n>, --agent <name> |
codepanel learning <owner/name> <L3> up|down |
Confirms (up) or turns off (down) a learning |
--reason, --note, --pr <n>, --agent <name> |
codepanel quality <owner/name> |
Verified review precision per model and role. Only verdicts an author agent cannot give itself count; "addressed by commit" is shown apart, then convergence: rounds per merged pull request, rounds to a green gate and the rounds after it (GET /quality) |
--days <n> (default 30, at most 90); --json for every segment |
codepanel precision-audit <owner/name> |
The weekly random sample of posted findings and its precision: the target reading over the latest 150 a person audited, each targeted bucket apart, then one week's draw with the review page to rate each finding on. Only a person's rating there, or a /feedback reply without --agent, counts (GET /precision-audit) |
--week <2026-W43> (default the newest drawn); --json |
codepanel escapes <owner/name> |
What reviews missed: lines a reviewed pull request added that a fix or revert commit on the default branch changed within 14 days of its merge, with no finding within 3 lines; the rate per 100 reviewed pull requests merged; and the daily scan's last run (GET /escapes) |
--days <n> (default 30, at most 90), --json |
codepanel escapes mark|unmark <owner/name> <E3> |
Marks an escape as not an escape (kept, no longer counted), or takes the mark back | --note, --agent <name> |
codepanel connections |
The MCP servers agent app runs may call; add <name> starts or calls the server on this machine, lists its tools and saves the ones in --tools, each pinned by the hash of its definition (a local program after -- is added by the account owner in the dashboard: a token's add is refused and prints what to paste there); remove <name> deletes one (/autopilot/connections, MCP add_connection) |
--environment dev|staging|production, --tools a,b, --read-only a, --agents <ids>, --url <url> or -- <command> [args...], --json |
codepanel presence |
One agent presence heartbeat from the checkout it runs in: its repository, branch and changed files, read from git. Prints the other live agents and the files you both change (POST /presence). Needs reviews:write |
--intent <text>, --agent <name> (default cli), --session-key <key> (default agent:branch:folder), --json |
codepanel records |
Each coding agent's record over 30 or 90 days: pull requests, findings fixed and disputed, rounds and spend per pull request, beside the account's; ? marks a sample too small to rank on (GET /autopilot/records, MCP get_agent_records) |
--days 30|90, --source all|own|external (own: your Autopilot agents by their runs: tasks, changes, first try, $ and minutes per change, owner interrupts), --detail, --limit <n> (1 to 50, default 10), --cursor <c>, --json |
codepanel autopilot |
Whether the account's agents are paused, since when, by whom and why (GET /autopilot/pause, MCP get_agents_pause) |
--json |
codepanel autopilot day-cap [<usd>|default] |
The account's day cap on agent spend, or set it: dollars up to $1,000, or default ($25) (GET/POST /autopilot/day-cap, MCP set_agent_day_cap). Setting needs budget:write |
--json |
codepanel defaults |
The default agent or team per role: new threads (what the desktop composer starts with), swarm workers, planner and fallback, the last three read by nothing until swarms ship (GET /autopilot/defaults, MCP get_agent_defaults) |
--json |
codepanel rules |
The autopilot rules: each one's trigger in words, repositories, worker, caps and whether it is on, with why it is off (GET /autopilot/rules, MCP list_rules) |
--json |
codepanel rules create <trigger> |
Make a rule: ci_failed, pr_stalled, dependabot_pr, issue_labeled or schedule; every setting has a default (POST /autopilot/rules, MCP create_rule). Needs tasks:write |
--repo a/b,c/d|all, --name, --label, --idle-minutes, --schedule, --prompt, --worker, --task-usd, --day-usd, --max-concurrent, --json |
codepanel rules update <ruleId>, rules enable|disable <ruleId> |
Change a rule, or turn it on or off in one call; prints it after (POST /autopilot/rules/update, MCP update_rule). Needs tasks:write |
the same flags as create, --json |
codepanel rules delete <ruleId> |
Delete a rule; its tasks stay (POST /autopilot/rules/delete, MCP delete_rule). Needs tasks:write |
--json |
codepanel defaults set |
Set the roles named, each auto, agent:<id> or team:<id> (a team for --new-thread only); prints the defaults after (POST /autopilot/defaults, MCP set_agent_defaults). Needs agents:write |
--new-thread, --swarm-worker, --planner, --fallback, --json |
codepanel autopilot pause|resume |
Stop everything: pause stops every run in progress and, until resume, no task is queued, no run starts and no model call is made; it prints the runs it stopped (POST /autopilot/pause, /autopilot/resume, MCP pause_agents). pause needs tasks:write; resume needs agents:write |
--reason <text> (pause), --json |
codepanel route <owner/repo> |
What a task on that repository routes to now and why, each agent's record there and the models no agent runs yet, with a cost range for a task there (GET /autopilot/route, MCP get_route_preview) |
--json |
Agent tasks and runs
The desktop app's threads, from the terminal. A task is queued for a coding agent and claimed by the runner on your Mac; task start and task retry wake it, so it claims the task at once. Answering, pausing and switching are explained in Run control; the rules and autopilot commands above in Autopilot rules.
| Command | What it does | Key flags |
|---|---|---|
codepanel tasks |
Tasks, newest first (list_tasks) |
--status <s>, --repo <owner/name> |
codepanel task start <owner/name> --title <t> <prompt...> |
Queues a task; without an agent or team, the repository's team or the default one works it (start_task). Needs tasks:write |
--coding-agent <id>, --team <id>, --ticket <key> (the tracker ticket, such as TKT-008398: AI Gateway metadata and the per-ticket cap) |
codepanel task get|stop|retry <taskId> |
Shows a task with its runs, cancels it, or queues a failed or stopped one again | |
codepanel task bulk stop|retry|pause|resume|cheaper <taskId...> |
Does one of them to many tasks, each on its own (bulk_tasks) |
|
codepanel run get|wait|diff <runId> |
A run, waiting until it ends or needs you, or its diff (get_run, wait_for_run, get_run_diff) |
--after <cursor> (wait) |
codepanel runners |
The account's local runners, one per machine: online or offline, last check-in and the repositories each has a checkout for (list_runners) |
|
codepanel run answer <runId> <interruptId> allow|deny|reply <text> |
Answers a permission or a question (answer_interrupt). Needs interrupts:answer: codepanel login --scopes "read tasks:write interrupts:answer", then tick it on the approval page |
|
codepanel run stop|pause|resume <runId> |
Stops a run, or holds it at its next turn and lets it go on (pause_run) |
|
codepanel run switch <runId> <agentId>|--cheaper |
Moves a running run to another model at its next turn (switch_model) |
|
codepanel run recover <runId> raise <usd>|cheaper |
Queues a run that stopped at its budget again, with more budget or on a cheaper agent (recover_budget_stop) |
|
codepanel inbox |
What waits on you across every run, most blocking first (get_inbox) |
|
codepanel inbox answer allow|deny <runId:interruptId...> |
Answers many permissions in one call (answer_batch). Needs interrupts:answer |
|
codepanel inbox dismiss <runId> |
Takes an ended run's item out of the inbox (dismiss_inbox_item) |
--undo |
codepanel autopilot permissions |
The commands always allowed per repository; allow <owner/name> <command…> adds one (needs rules:write, which no token has by default), remove <ruleId> takes one away (always_allow) |
--run <id> --interrupt <id> (allow) |
Tracked plans
Tracked plans work only where PLAN_TRACKING is on; where it is off these commands answer 400. See Tracked plans for the rules.
| Command | What it does | Key flags |
|---|---|---|
codepanel plans [owner/name] |
Lists your plans with their progress | --status active|completed|abandoned, --all (sub-plans too) |
codepanel plan <planId> |
Prints a plan's steps, sub-plans and next action | --json for the full response |
codepanel plan create <file|-> |
Saves a plan from JSON in create_plan's shape, from a file or stdin (-) |
|
codepanel plan step <planId> <S3> <status> |
Moves a step to pending, in_progress, done, blocked or skipped |
--reason, --evidence, --agent <name> |
Reviews and sessions
| Command | What it does | Key flags |
|---|---|---|
codepanel review <owner/name#123> |
Shows the current review: status, round, open counts, a Gate: line, the verdict and whether a push starts another round, a Next: line with payload.nextAction, and each finding by state, answered ones marked. With the gate on, the gate decides when the pull request is done; otherwise the verdict does |
--json prints the snapshot with gate and payload (GET /review) |
codepanel review <owner/name#123> --trigger |
Starts a review now, on your provider keys or credits | --panel <id> (only with --trigger); --traceparent <tp> (overrides $TRACEPARENT; the review returns it as traceparent) |
codepanel review <owner/name#123> --wait |
Waits until the latest review finishes, then prints it. With --trigger, starts one and waits for that one. Exit codes above |
--timeout <secs> (default 600); --sha <commit> after a push, so the previous commit's finished review is not taken for the new one. --json prints the wait_for_review result |
codepanel review --local [owner/name] |
Prints the review brief to run on your own model before a push: each seat's prompt, the gate, the rubric and the learnings for the files the branch changed since its base, then the base branch's .codepanel/rules.md. Free; starts no review (GET /review-brief). The repository defaults to the origin remote's |
--paths a,b instead of the checkout's changes; --json prints the brief's fields |
codepanel review --local --submit <file|-> [owner/name#123] |
Sends what your local review found, as submit_local_review does: JSON {"verdict": "ready"|"not-ready", "findings": [{"file", "line", "severity", "message", "fixed"}]}, or the findings array alone, from a file or stdin (-). Stored against HEAD as your claim; the gate never reads it. After exit 5, this is what moves nextAction past review_locally (POST /reviews/local) |
--sha <commit> (full sha) instead of HEAD; --agent <name> |
codepanel handoff <owner/name#123> |
Leaves your handoff for the next review round (POST /reviews/handoff) |
Exactly one of --text <note> or --file <path|-> (- reads stdin); --sha <commit>; --agent <name> |
codepanel rounds <owner/name#123> <n|+n|stop|reset> |
Sets how many automatic rounds the pull request gets, like a /rounds comment |
|
codepanel sessions |
Recent review sessions, newest first | --repo <owner/name>, --status active|completed|all, --limit <n> |
codepanel session <id> |
One session with each reviewer's status and error |
Findings
| Command | What it does | Key flags |
|---|---|---|
codepanel findings <owner/name#123> |
Findings with refs and ids | --all includes resolved and dismissed ones |
codepanel feedback <owner/name#123> <F3|review> up|down [reason] |
Rates a finding or the whole review | --reason, --note, --agent <name> |
codepanel findings dismiss <findingId> |
Dismisses a finding. With --agent (or CODEPANEL_AGENT), a reason other than deferred disputes it instead |
--reason false_positive|wrong_location|not_worth_fixing|duplicate|deferred|other, --note, --agent |
codepanel findings reopen <owner/name#123> <F3> |
Reopens a dismissed finding, such as one the review says was "reported again and not reopened". Also takes a bare <findingId> |
|
codepanel ask <owner/name#123> [F3] <question> |
Asks the orchestrator about the review or a finding and prints the answer, like a /ask reply |
--agent <name>; --timeout <secs> (default 180) |
For feedback, the target is F3, 3 or review, and the rating up, down, +1 or -1. As in a /feedback line, the reason can follow the rating (F3 up fixed), and the rating can be left out when the reason settles it (F3 fixed, F5 false-positive). The reason on feedback and --reason on learning is fixed, useful, false_positive, wrong_location, not_worth_fixing, duplicate, deferred, unclear or other, with hyphens or underscores; findings dismiss takes the underscore spelling only. feedback also takes the /feedback shorthand (fp, nit).
Set --agent (or CODEPANEL_AGENT) when an AI agent rates, dismisses or asks, so its votes count as an agent's. Name the harness, such as claude-code; a Claude model id is read as claude-code and kept as the model. An agent's down with false_positive, wrong_location, not_worth_fixing or duplicate disputes the finding; the outcome shows in codepanel review --json under each finding's dispute. See Feedback.
Example
Review a pull request from the terminal, then act on the findings.
# check the panel can run
codepanel keys
codepanel panel
# start a review and wait for it
codepanel review acme/api#123 --trigger --wait
# read the findings
codepanel review acme/api#123
codepanel findings acme/api#123
# F3 was right and is fixed; F5 is wrong
export CODEPANEL_AGENT=claude-code
codepanel feedback acme/api#123 F3 fixed --note "Added the ownership check"
codepanel feedback acme/api#123 F5 false-positive --note "Ownership is checked in middleware.ts"
# after pushing the fix, wait for the review of that commit
codepanel review acme/api#123 --wait --sha "$(git rev-parse HEAD)"
Script it with --json and jq:
codepanel review acme/api#123 --json | jq '.open.critical'
# fix, wait, trigger, rate, done or stop
codepanel review acme/api#123 --json | jq -r '.payload.nextAction.action'
codepanel panel accepts --repo owner/name or --panel id to fetch one panel. Member edits preserve seat identity and history. Updates commit together or leave everything unchanged; --json errors include applied: false and the requested fields. Empty prompt/instruction strings clear the field. --path-scope accepts the same JSON as the API, for example { "include": ["src/**"], "exclude": ["**/*.test.ts"] }; null clears it.