mirror of
https://github.com/cline/cline.git
synced 2026-09-19 02:05:44 +08:00
* feat: add SDK cookbook examples with difficulty progression Add three new example apps to apps/examples/ organized as a difficulty ladder from beginner to advanced, similar to Cursor's SDK cookbook. Includes a top-level README linking all examples. - quickstart: minimal ~15 line agent, send a prompt, stream response - cli-agent: interactive terminal chat with a shell tool - code-review-bot: structured code review with custom tools and completion lifecycle * feat: add multi-agent fan-out example with streaming web UI Spawns three specialist agents in parallel, streams their responses to the browser via SSE, then a synthesizer agent combines their findings into a unified answer. Single-file server with inline HTML. * chore: replace pnpm with bun in example docs and source * fix: use claude-sonnet-4-6 model ID in examples * fix(examples): use Cline keys in cookbook * docs(examples): add SDK build step
696 B
696 B
Quickstart
The simplest possible Cline SDK example. Creates one agent, sends a single prompt, and streams the response to stdout.
Getting started
Use Node.js 22 or newer.
Install dependencies:
bun install
bun run build:sdk
Set an API key:
export CLINE_API_KEY="cline_..."
Run:
bun dev
What it does
- Creates an
Agentwith a provider and model - Subscribes to
assistant-text-deltaevents to stream output - Calls
agent.run()with a prompt - Prints token usage when done
Notes
For an interactive terminal chat, see cli-agent. For custom tools and structured workflows, see code-review-bot.