CLI Agent
An interactive terminal chat agent with streaming output and a shell tool. Type messages, get responses, and let the agent run shell commands on your behalf.
Getting started
Install dependencies:
bun install
bun run build:sdk
Set an API key:
export CLINE_API_KEY="cline_..."
Run:
bun dev
Type any message at the you: prompt to see a streaming response from the agent.
What it does
- Creates a conversational
Agentwith ashelltool usingcreateTool - Streams
assistant-text-deltaevents to stdout as the agent responds - Logs tool calls and their results inline
- Uses
agent.run()for the first message andagent.continue()for follow-ups to maintain conversation context
Concepts demonstrated
createToolwith zod schema validation- Event subscription for streaming and tool call visibility
- Multi-turn conversation with
run()/continue() systemPromptconfiguration
Notes
For the simplest possible example, see quickstart. For structured workflows with multiple tools, see code-review-bot.