Replace all files with clean upstream Cline v3.83.0 content. ShengSuanYun provider code automatically removed.
Code Review Bot
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.
Getting started
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
What it does
- Reads a
git diffagainst the specified ref (defaults toHEAD~1) - Sends the diff to an agent with three custom tools:
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 decision
- Prints all comments grouped by severity (critical, warning, suggestion)
Concepts demonstrated
- Multiple
createTooldefinitions with zod schemas lifecycle: { completesRun: true }to make a tool end the agent loop- Rich
systemPromptwith structured instructions - Event subscription filtered by tool name
- Processing structured results after the run completes
Notes
For a simpler starting point, see quickstart. For an interactive chat agent, see cli-agent.