sdk/apps/examples/code-review-bot/README.md
An AI-powered code review agent that reads a git diff, analyzes it, and produces structured review comments with severity levels. Demonstrates custom tools, completion tools, and system prompts.
Install dependencies:
bun install
bun run build:sdk
Set an API key:
export CLINE_API_KEY="cline_..."
Review the last commit:
bun dev
Review against a specific ref:
bun dev main
bun dev HEAD~5
bun dev abc123
git diff against the specified ref (defaults to HEAD~1)get_file_context - reads full file contents for surrounding contextadd_review_comment - records a review comment with file, line, severity, and messagesubmit_review - a completion tool that ends the run with a summary and approve/reject decisioncreateTool definitions with zod schemaslifecycle: { completesRun: true } to make a tool end the agent loopsystemPrompt with structured instructionsFor a simpler starting point, see quickstart. For an interactive chat agent, see cli-agent.