Prompt the CLI for repository work

Ask cbp to explain code, fix a small bug, or add a feature with checks.

Updated:

Ask for a read-only explanation first

Run cbp in your project folder. A good first request names the question and asks for file references without changing anything:

Explain how this app handles login form submission. Name the entry point and the test that covers it. Do not edit files or run mutating commands. If there is no test, say so.

Illustrative answer from a fictional project

src/LoginForm.tsx handles the form submission and calls signIn() in src/auth/client.ts. src/LoginForm.test.tsx covers a successful login, but has no duplicate-submission test. No files were changed.

For a one-off answer, use cbp -p "Explain the login flow in this repository. Do not edit files.".

Give a coding task an end condition

Example prompt

The login form sometimes submits twice. Find the cause, show a short plan, make the smallest fix, and run the focused login-form test. Report the files changed and the test result. Ask before changing unrelated files.

Illustrative summary from a fictional project

Cause: both the form submit handler and the button click handler called the same request.

Change: removed the duplicate click handler.

Check: the login-form test passed; one request is sent per submit.

Your project may have a different cause, files, and tests. Read the diff and test output before accepting the result. For a larger feature, ask for a plan first and split the work into small steps.

Diagnose a failing test before editing

Example prompt

The date-range test fails when the start and end dates are the same day. Run only that test, trace the failing assertion to the implementation, and suggest the smallest fix. Do not edit files yet. Show the test command, relevant file paths, and what you are still unsure about. If you cannot run the test, explain why.

Illustrative answer from a fictional project

The focused test expects the end date to be inclusive, but src/dateRange.ts uses an exclusive comparison. tests/dateRange.test.ts fails on the same-day case. No files were changed; the proposed fix is to adjust that comparison and rerun the focused test.

Add a small feature without widening scope

Example prompt

Add a Clear search button to the results page only when the search box is not empty. Reuse the existing search state and button style; do not change the search API or add a dependency. Add a focused test for clearing the query, run it, and report the changed files and result.

Illustrative summary from a fictional project

Added the button to src/SearchPage.tsx and a clearing test to src/SearchPage.test.tsx. The focused test passed. No API files or dependencies changed.

Review a diff without making changes

Example prompt

Review my uncommitted diff for behavior regressions. Do not edit files or run mutating commands. Report only actionable issues with file and line references, the situation that triggers each issue, and its severity. If you find none, say so.

Illustrative finding from a fictional project

src/search.ts:48 — Clearing the query leaves the previous results visible because the empty-query branch skips resetting the result list. No files were changed.

These examples use fictional files. Replace their paths and behaviors with your own project, and ask the CLI to say when it cannot verify a claim.

Choose a model

Run cbp models or use /model in an interactive session to see the current CLI choices. Try Gemini 3.8 Flash for a quick code explanation; compare ChatGPT 6 Sol or Claude Sonnet 5 for a multi-file edit. Availability and gem cost depend on your account, so check the list and footer.

For setup and permissions, see Complete your first CLI coding task.

Need more help?

Tell us what you were trying to do and what happened.

Contact us →