mirror of
https://github.com/cline/cline.git
synced 2026-09-15 21:04:27 +08:00
* Move the apps to the root dir * Update all references from sdk/apps/ to apps/ * Update dependencies * Install bun types * Fix types * Fix types * Fix linter * Ingore apps from vscode * Fix security warning * Fix windows install * Enable windows dev mode * Revert "Enable windows dev mode" This reverts commita46c99282e. * Revert "Ingore apps from vscode" This reverts commit47f7b265d2. * Revert "Fix windows install" This reverts commit1dabba1556. * update the repo root * fix root dir * fix path * fix other path * Fix unrelated changes * fix: address apps move follow-up blockers (#11228) * fix: update root app command paths * fix: include moved apps in root checks * fix: clean up moved app path references --------- Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
Cline Core CLI Agent
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.
Getting started
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.
Optional model configuration
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"
What it does
- Creates a local
ClineCoreruntime withClineCore.create() - Starts one interactive session with
cline.start() - Sends each user turn with
cline.send({ sessionId, prompt }) - Streams
agent_eventtext to stdout as the assistant responds - Logs tool calls and tool results inline
- Uses ClineCore's built-in tools instead of defining custom tools
- Calls
cline.stop()andcline.dispose()during shutdown
Concepts demonstrated
- Stateful sessions with
ClineCore - Multi-turn conversation using a single
sessionId CoreSessionEventsubscription viacline.subscribe()- Built-in runtime tools (
read_files,search_codebase,run_commands, etc.) - Basic tool policies: file reads/search are auto-approved, other tools request approval
Notes
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.