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.