ClineCore.create(options)
| Option | Type | Description |
|---|---|---|
clientName | string | Human-readable SDK client name |
distinctId | string | Stable telemetry/user identifier |
backendMode | "auto" | "local" | "hub" | "remote" | Runtime backend selection |
hub | HubOptions | Local hub connection options |
remote | RemoteOptions | Remote hub options |
capabilities | RuntimeCapabilities | Client-owned tool executors and approval callbacks |
toolPolicies | Record<string, ToolPolicy> | Default tool approval policies |
automation | boolean | ClineCoreAutomationOptions | Enable automation APIs |
fetch | typeof fetch | Custom fetch for local provider calls |
start(input)
ClineCoreStartInput
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | No | Initial prompt |
config | CoreSessionConfig | Yes | Session model/runtime config |
source | SessionSource | No | Session source label |
interactive | boolean | No | Whether session expects interaction |
sessionMetadata | Record<string, unknown> | No | Metadata persisted with session |
initialMessages | Message[] | No | Preloaded messages |
toolPolicies | Record<string, ToolPolicy> | No | Per-session tool policies |
capabilities | RuntimeCapabilities | No | Per-session tool executors and approval callbacks |
StartSessionResult
send(input)
AgentResult | undefined.
Session APIs
| Method | Description |
|---|---|
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
Whenautomation is enabled, use cline.automation to start/stop automation services, reconcile specs, ingest events, and list events/specs/runs.
