Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cline.bot/llms.txt

Use this file to discover all available pages before exploring further.

The Cline SDK is a set of TypeScript packages for embedding Cline’s agent runtime in your own applications. Use it to build:
  • in-process agents with custom tools
  • coding agents with file, shell, search, and web tools
  • persistent sessions
  • chat connectors
  • scheduled automations
  • multi-agent workflows

Install

npm install @cline/sdk
@cline/sdk re-exports everything from @cline/core. You only need @cline/agents or @cline/llms if you want lower-level control over the agent runtime or model gateway directly. Requires Node.js 22 or later.

Minimal Agent

import { Agent } from "@cline/sdk"

const agent = new Agent({
  providerId: "anthropic",
  modelId: "claude-sonnet-4-6",
  apiKey: process.env.ANTHROPIC_API_KEY,
  maxIterations: 1,
})

agent.subscribe((event) => {
  if (event.type === "assistant-text-delta") {
    process.stdout.write(event.text ?? "")
  }
})

const result = await agent.run("Explain what an SDK is in two sentences.")
Here is a complete quickstart example. Clone it and run bun dev to try it.

Packages

PackagePurpose
@cline/sdkPublic SDK surface (re-exports @cline/core)
@cline/coreNode runtime for sessions, built-in tools, persistence, hub support, automation
@cline/agentsBrowser-compatible stateless agent execution loop
@cline/llmsProvider gateway and model catalogs
@cline/sharedTypes, schemas, tool helpers, hooks, storage helpers
See Packages for package boundaries and exports.

Runtime Choices

RuntimeUse when
ClineCoreThe fully featured Cline agent that you can customize and build upon. Includes session management, built-in tools, approvals, config discovery, channels, and scheduling
Agent / AgentRuntimeA stateless in-process loop that offers even more control. ClineCore depends on the Agents package. Build with Agents directly if you want to control tools, session persistence, and configuration directly
See Agent vs ClineCore.

Next Steps

Examples

Browse complete, runnable SDK examples.

Plugins

Extend Cline’s functionality.

Tools

Add actions the model can call.

Building an Agent

Build a complete SDK agent from a tutorial.