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.

import { ClineCore } from "@cline/sdk"

ClineCore.create(options)

const cline = await ClineCore.create({
  clientName: "my-app",
  backendMode: "auto",
})
Common options:
OptionTypeDescription
clientNamestringHuman-readable SDK client name
distinctIdstringStable telemetry/user identifier
backendMode"auto" | "local" | "hub" | "remote"Runtime backend selection
hubHubOptionsLocal hub connection options
remoteRemoteOptionsRemote hub options
capabilitiesRuntimeCapabilitiesClient-owned tool executors and approval callbacks
toolPoliciesRecord<string, ToolPolicy>Default tool approval policies
automationboolean | ClineCoreAutomationOptionsEnable automation APIs
fetchtypeof fetchCustom fetch for local provider calls

start(input)

const session = await cline.start({
  prompt: "Summarize this repo",
  config: {
    providerId: "anthropic",
    modelId: "claude-sonnet-4-6",
    apiKey: process.env.ANTHROPIC_API_KEY,
    systemPrompt: "You are a helpful coding assistant.",
    cwd: process.cwd(),
    workspaceRoot: process.cwd(),
    enableTools: true,
    enableSpawnAgent: false,
    enableAgentTeams: false,
  },
})

ClineCoreStartInput

FieldTypeRequiredDescription
promptstringNoInitial prompt
configCoreSessionConfigYesSession model/runtime config
sourceSessionSourceNoSession source label
interactivebooleanNoWhether session expects interaction
sessionMetadataRecord<string, unknown>NoMetadata persisted with session
initialMessagesMessage[]NoPreloaded messages
toolPoliciesRecord<string, ToolPolicy>NoPer-session tool policies
capabilitiesRuntimeCapabilitiesNoPer-session tool executors and approval callbacks

StartSessionResult

interface StartSessionResult {
  sessionId: string
  manifest: SessionManifest
  manifestPath: string
  messagesPath: string
  result?: AgentResult
}

send(input)

const result = await cline.send({
  sessionId,
  prompt: "Continue with tests",
})
Returns AgentResult | undefined.

Session APIs

MethodDescription
subscribe(listener, options?)Subscribe to CoreSessionEvent events
list(limit?, options?)List session history records
listHistory(options?)List session history records
get(sessionId)Get session metadata
readMessages(sessionId)Read persisted messages
getAccumulatedUsage(sessionId)Read accumulated token/cost usage
update(sessionId, updates)Update prompt/title/metadata
abort(sessionId, reason?)Abort active work
stop(sessionId)Stop session
delete(sessionId)Delete session
restore(input)Restore from checkpoint
dispose(reason?)Dispose runtime resources

Automation API

When automation is enabled, use cline.automation to start/stop automation services, reconcile specs, ingest events, and list events/specs/runs.