sdk/apps/examples/cline-core-cli-agent/README.md
An interactive terminal chat agent powered by the ClineCore runtime. This example is similar in spirit to cli-agent, but uses stateful ClineCore sessions and built-in runtime tools instead of the stateless Agent class, to leverage Cline's internal agent harness.
Install dependencies:
bun install
bun run build:sdk
Set an API key:
export CLINE_API_KEY="sk_..."
Run:
bun dev
Type any message at the you: prompt to see a streaming response. Type exit to quit.
The example defaults to Cline's gateway provider and Claude Sonnet:
export CLINE_PROVIDER_ID="cline"
export CLINE_MODEL_ID="anthropic/claude-sonnet-4.6"
ClineCore runtime with ClineCore.create()cline.start()cline.send({ sessionId, prompt })agent_event text to stdout as the assistant respondscline.stop() and cline.dispose() during shutdownClineCoresessionIdCoreSessionEvent subscription via cline.subscribe()read_files, search_codebase, run_commands, etc.)Use this example when you want the full ClineCore runtime with sessions, persistence, and built-in tools. For the smallest possible SDK example, see quickstart. For the lightweight stateless runtime, see cli-agent.