Klein Kit

CLI & example apps

The tiny CLI, the reference app, and the Electron demo

The monorepo ships three runnable consumers of the SDK — use them as living documentation.

Tiny CLI

Interactive coding-agent session with the first installed provider:

pnpm cli

Or pick a provider and send an initial task:

pnpm cli -- --provider codex "fix the failing tests"

Flags: -p/--provider, -C/--cwd, -m/--mode <read-only|ask|accept-edits|full-auto> (default ask), --model.

Inside the REPL:

CommandEffect
/switch claudeChange agents. Each provider's conversation stays live while parked — switching back restores its session.
/model opusChange the active provider's model; selections are remembered per provider.
/providersShow availability.
/newReset only the active conversation.
/status, /clear, /help, /exitThe usual.

The CLI asks before privileged actions by default. Ctrl-C interrupts the active turn first, quits second.

Reference app

apps/reference exercises the core API end to end:

pnpm --filter klein-kit-reference start detect
pnpm --filter klein-kit-reference start chat codex "explain this repo"
pnpm --filter klein-kit-reference start pipeline "add a health endpoint"

It also hosts the live smoke suite — one real turn per provider in a temp dir (uses real quota):

pnpm --filter klein-kit-reference smoke            # all providers
pnpm --filter klein-kit-reference smoke codex pi   # a subset

Electron demo

apps/demo-ui-app is a React chat UI over the SDK:

pnpm demo-ui

The main process owns sessions and pumps AgentEvents to the renderer — its src/shared/ipc.ts is a good reference for exposing Klein Kit over an IPC or HTTP boundary.

On this page