Skip to main content
| Give CodeRabbit a prompt from your terminal, and the agent works on your repository in the cloud. With cr code (short for coderabbit code), you follow the work, steer it, and push the result or open a pull request with it. You can also hand off a local Codex or Claude Code session. For scripts and coding agents, see Drive tasks from scripts and coding agents. For every option, see the command reference. A task is one unit of cloud work on a repository, with its own history and page in the web app. Each instruction you send runs as a turn of the task.

Requirements

  • CLI 0.9.0 or later. Run cr update. cr code handoff and cr code skills import work from 0.8.1.
  • A CodeRabbit SaaS login. Run cr auth login, then cr auth org in an interactive terminal to select an organization. API key, self-hosted, and SSO workspace logins are not supported.
  • Access. Coding Agent must be enabled for your organization, and you need access to the repository. See Access and billing.
Tasks use agent minutes and are billed like tasks started in the web app. If your organization’s Coding Agent trial has not started, your first task starts it.

Quick start

A push commits the changes onto the working branch; with --stacked it opens a pull request against that branch instead (Push changes). The first push can pause for a GitHub authorization in your browser. Closing the live view never stops the task. Add --plan to review a plan before any code changes (details).

Start a task

A task starts from the branch on origin that your current branch tracks, or the branch with the same name, not from your working tree. Unpushed commits and uncommitted changes are not included, so push first if the task needs them. A detached HEAD is refused.
  • Prompt. An argument, or - for standard input. An interactive terminal asks for one if you omit it.
  • --plan starts in Plan mode: the agent writes a plan for review instead of changing code.
  • --resume starts the task and opens the live view in one command, the same as running cr code resume <task-id> next.

Follow and steer a task

cr code resume opens a live view of the task. --last opens your most recently updated task for this repository; with no task, the command lists your ten most recent tasks to pick from. The view, which cr code new --resume also opens, needs an interactive terminal. Closing it with /exit never stops the task. Commands accept a task ID or a task URL such as https://app.coderabbit.ai/code/tasks/<task-id>, read from the region and organization of your current login (for another region, run cr auth login --region eu first). Shell completion completes task IDs you listed or opened. In the view you can:
  • Type a message. During a turn it joins or queues behind the running turn; otherwise it starts a new turn. Start with // to send a literal /.
  • Add guidance to the running turn with /steer <text>, or stop it with /cancel.
  • Answer the agent’s blocking questions. Answers to sensitive questions are hidden as you type.
  • Mention a file with @ and at least two characters of its path, once the task’s environment is ready.
  • Type / for suggestions; see the slash command reference.
Some tasks can’t be changed from the CLI. Workspace tasks are read-only, tasks on the previous Coding Agent runtime show only their history, and automation tasks can’t be opened. Continue those in the web app.

Stop a running turn

cr code cancel stops the running turn and drops queued messages. The task stays open, and a new message starts a new turn.

List and inspect tasks

cr code ls lists the 20 most recently updated tasks in the selected organization. By default it lists only your tasks; --all adds other people’s tasks that you can see. Archived tasks are not listed, but show can read them.
  • --repo <path> lists the tasks of the repository that matches the origin remote of the checkout at that path.
  • --status <state> filters by the state shown in the web task list: needs_attention, ready_for_review, running, completed, or canceled.
cr code show shows the status, repository, delivery, patch, plan, result, and pull request health of a task.

Review and approve a plan

A task started with --plan ends with a plan instead of code changes. Run /implement in the cr code resume view to implement the latest plan, or implement it from the task page in the web app. It needs a finished plan with no open plan comments, no running turn, and no queued messages.
cr code plan shows the latest finalized plan. --approve records your approval of that plan version; it does not start implementation. If the plan changed after you read it, approval fails: run cr code plan <task-id> to read the new version. For plan approvals in the web app, see Review a plan.

Push changes

cr code push delivers the ready changes of a task. By default, CodeRabbit commits them onto the working branch and pushes, as Commit and push does in the web app. --stacked pushes them to a new branch and opens a pull request against the working branch, as Create PR does. A stopped or interrupted turn can still leave a patch, and cr code push delivers that partial work. See Choose how changes land. GitHub can first ask you to authorize CodeRabbit. In an interactive terminal, the command prints the authorization URL, opens it when it can, and waits up to 10 minutes while you approve in a browser signed in to CodeRabbit with the same GitHub account. Without a terminal, it prints the URL and stops; run it again after you approve.
  • Waiting. The command stops waiting after 15 minutes and reports that the push is still running. The push continues, and cr code show shows the result. Ctrl-C stops only the wait.
  • Failure. The command shows the reason from the repository, such as the CodeRabbit GitHub App not being allowed to change .github/workflows. Fix the cause, then push again.
  • Reruns. Rerunning is safe: a running push is waited for, and already-pushed changes are reported without a new push request. While a turn runs or messages are queued, the command asks you to wait.

Let Autopilot deliver and fix

Autopilot publishes a task’s changes when the agent finishes, then fixes CodeRabbit findings, failing required CI checks, and merge conflicts. Turning it on lets it publish changes and push follow-up fixes without asking you.
on starts Autopilot, off stops it, and status shows its state. resume starts a new repair cycle after Autopilot pauses; on does not resume a paused Autopilot. Pass either a task or --pr: a pull request number in the repository that matches your checkout’s origin, or a GitHub pull request or GitLab merge request URL. With --pr, on and resume can create an Autopilot task when you have no delivered task for that pull request.

More cr code commands

Continue a local session in the cloud

cr code handoff hands a local coding session off to a new cloud task.
Run it from a clean Git checkout on a branch with an origin remote. The cloud task must be able to fetch the selected commit, so commit and push first. Untracked files count as changes, so keep the summary and plan files outside the repository or commit them.
  • --summary <path> is required; - reads standard input. --plan <path> is the primary implementation plan file.
  • Uploads. The summary, the optional plan, and a session transcript when the command finds one, such as your current Codex or Claude Code session. Review these files first. Each attachment is limited to 25 MiB. A missing transcript or a failed transcript upload is a warning, not a failure.
The result shows the branch, commit, transferred filenames, and a task link. The task exists then, but the cloud still has to verify the commit and load the files. Each run creates another task, so do not rerun a handoff that succeeded.

Ask a side question

cr code ask puts a question to a side chat of the task and prints the answer. A side chat reads the task’s conversation and repository but does not change the task, and a running turn keeps running. The answer includes a turn ID. Pass it to --follow-up to keep asking in the same side chat, with the context of earlier questions. cr code ask can’t close a side chat, so use --follow-up to keep asking in the one you opened. A task can have 3 open side chats, and an idle one expires after 24 hours.

Import local skills

cr code skills import uploads local agent skills to your cloud Coding Agent skill library, in the organization you selected with cr auth org. To install CodeRabbit skills into your local coding agent instead, use cr skills.
Run it without a path to choose a local agent and select skills, or pass a skill folder or its SKILL.md. Review the selected files and destination before you confirm.
  • --scope personal|organization. New skills are personal within the selected organization by default; organization shares them with it.
  • Non-interactive imports need a path and --yes. With --yes and no --scope, new skills are personal and existing skills keep their visibility.
  • Same name. Importing a skill you own with the same name publishes a new version.
For writing a SKILL.md, limits, and sharing, see Coding Agent skills.

Slash command reference

Commands marked (billed) start agent work. Commands that say ā€œAsks firstā€ need a y; press Enter to keep things as they are. /push does not ask. Run /help in the view for the full list.

Drive tasks from scripts and coding agents

Everything below is for scripts and coding agents. For the general agent-mode contract, see Agent mode output and exit codes.
  • A person signs in first. Run cr auth login (browser) and cr auth org (interactive terminal) on that machine. There is no non-interactive login: API key, self-hosted, and SSO workspace logins fail with unsupported_auth, no selected organization fails with organization_required, and cr auth org --agent only lists organizations.
  • Always pass --agent, right after the full command name, as in cr code new --agent … or cr code autopilot on --agent …. Every cr code command except skills import accepts it. The CLI also switches to JSON when stdout is not a terminal and it detects a coding-agent environment (for example CLAUDECODE, CODEX_SANDBOX, CURSOR_AGENT, GEMINI_CLI, or CR_CLI_AGENT=<name>), but only an explicit --agent turns argument errors into JSON. In cr code new, put --agent before --plan, or an argument error prints as plain text on stderr and exits with 1.
  • Use explicit task IDs, not --last, which picks the most recently updated task and can change between runs.
  • command fields start with coderabbit, the same binary as cr. On authenticate, a person runs command (it opens a browser sign-in). On authorize_github, a person opens the url; after they approve, rerun command. On answer_question with an answerTemplate, don’t run command (it holds a literal <answer-json> placeholder): run cr code resume --agent <task-id> --answer '<json>' with the filled-in template. On answer_question with a null answerTemplate, command is interactive: never run it; give it to the user.
  • Records. One JSON object per line, each with a type. status, complete, and error records have a status; on an error record it is the error code. action_required records have an action, and message is human-readable text. The first record is a status record with status: "beta_notice" and a feedbackUrl. resume also writes trace records with a kind such as agent_message, command, file_change, or turn_end.
  • Liveness. resume, new --resume, and ask write a status record waiting after 45 seconds without other output. push writes delivery_waiting on progress and every 45 seconds. cancel, handoff, plan, autopilot, ls, and show write none, so size CI idle timeouts with the limits below.
  • The last record decides. Branch on its type, then its status or action. Use the exit code only as a cross-check, because exit 1 and 4 each cover records that need different handling. Exit 0 is complete, but push_in_progress and cancel_pending are not final. Exit 1 is error, or action_required for authenticate and authorize_github. Exit 3 is answer_question. Exit 4 is action_required: for the resume action, rerun cr code resume --agent <task-id>; for read_answer, never rerun ask. A signal interrupt exits 130 or 143 with no last record. If the last record has a status or action that this page does not list, stop and ask a person.
  • Commit points. Save these records as they arrive, and never rerun the command that wrote one (exceptions are under Retry safely): task_submitted (new, with taskId and url), creating_task (handoff), message_sent, steer_sent, answer_sent, and question_sent. A generic error record has no taskId, so keep it from earlier records.
  • agentMinutes. The last record of a turn (complete with turn_completed, or error with a turn) has agentMinutes: the gross agent minutes of the turn, rounded to two decimals, not billed minutes. It is null when the run did not see the turn run and end, or the minutes did not arrive in time.
ā€œNot finalā€ marks outcomes that need a follow-up command.newhandoffThe statuses are checking_repository, uploading_files, and creating_task.The earlier cr handoff form still works, but its human-readable output changed in 0.8.1; update scripts that parse the old output.resume (watch, -m, --steer, --answer)
The command sends at most one of -m, --message, --steer, and --answer; all require --agent and accept - for standard input. -m joins the running turn, queues behind it, or starts a new turn. --steer adds guidance to the running turn. --answer takes the answerTemplate JSON of an answer_question record with each answer filled in. The run follows the resulting turn until it ends, the agent asks a blocking question, or 9 minutes pass. Without a send option, it reports the latest turn.cancelaskNothing is billed before question_sent, except after ask_failed, where billing is unknown. Records after it carry sideChatId, turnId, and clientOperationId. cr code show does not show side chats.planpush (default and --stacked)autopilotls and showBoth only read, so rerun them freely.Any cr code commandTasks the CLI can’t change. Workspace tasks are read-only: cancel and ask fail with task_read_only, and resume fails with it only when you send. Tasks on the previous Coding Agent runtime fail resume and cancel with task_read_only and ask with side_chat_unavailable. Automation tasks fail with unsupported_task. Continue these in the web app.
  1. Never rerun a command after it wrote a commit-point record; follow the task with cr code resume --agent <task-id> instead. Exceptions: message_dropped and steer_not_delivered mean the send did not land, so send again. handoff has no task ID before task_created: after creating_task, don’t rerun. Run cr code ls --agent --repo . and give the result to a person.
  2. No last record? If a run was killed or crashed (or exited 130 or 143), use the records you saw. If you saw no commit point from new or handoff, a task may still exist: check cr code ls --agent --repo . before rerunning.
  3. After -m, keep the clientOperationId from message_sent. If the run that sent the message ends with a turn whose turn.queueItemId equals it, that turn is yours. If it differs, your message joined the turn that was already running, and that outcome covers it. After an exit-4 rerun, a turn whose turn.queueItemId is not yours means your message may still be queued: rerun without a send option a few seconds later, at most three times, then report to a person. Never resend -m.
  4. Safe to rerun: ls, show, plan without --approve, and push with identical flags, unless the last record was delivery_failed, delivery_conflicts, or push_rejected. Don’t rerun cancel to wait.
  • Sensitive question. answer_question with a null answerTemplate and a command: give the user command (coderabbit code resume <task-id>, interactive) to run and answer there. Never run it or collect the answer yourself.
  • Question on a workspace task. answerTemplate and command are both null: give the user the web app link from message.
  • Authorization, login, and billing. authorize_github, authenticate, unsupported_auth, organization_required, and billing_required.
  • Get a person’s OK before delivering changes (push), approving a plan (plan --approve), turning on Autopilot or resuming it (it publishes and pushes follow-up fixes on its own), running cancel (it drops queued messages), pushing partial work after turn_failed, turn_canceled, or turn_interrupted, or answering a question you would have to guess.

What’s next

Work with a running task

Follow, steer, and review a task in the web app, including plans and proposed patches.

Deliver a task's changes

Compare the delivery modes and see how Autopilot publishes and fixes changes.

CLI command reference

Look up every cr code command and option, generated from the CLI help output.