Files
cline/apps/examples/cline-core-cli-agent
Tomás BarreiroandSaoud Rizwan 220a21bdcf Move sdk/apps/ to apps/ (#11200)
* 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 commit a46c99282e.

* Revert "Ingore apps from vscode"

This reverts commit 47f7b265d2.

* Revert "Fix windows install"

This reverts commit 1dabba1556.

* 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>
2026-06-03 01:49:57 +02:00
..
2026-06-03 01:49:57 +02:00
2026-06-03 01:49:57 +02:00
2026-06-03 01:49:57 +02:00
2026-06-03 01:49:57 +02:00

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 ClineCore runtime with ClineCore.create()
  • Starts one interactive session with cline.start()
  • Sends each user turn with cline.send({ sessionId, prompt })
  • Streams agent_event text 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() and cline.dispose() during shutdown

Concepts demonstrated

  • Stateful sessions with ClineCore
  • Multi-turn conversation using a single sessionId
  • CoreSessionEvent subscription via cline.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.