Skip to main content
For concepts, see Sessions and Realms.
Rust examples use the runtime-backed SessionService path, which is the same canonical session lifecycle used by the other surfaces.

Create a session

rkat run --model claude-sonnet-4-5 "What is the capital of France?"

Multi-turn

# Resume the most recent session
rkat resume last "Now explain it in more detail"

# Or use the shortcut
rkat continue "Now explain it in more detail"

Resume by ID or alias

CLI supports short prefix matching and relative aliases for resuming sessions.
# Full UUID
rkat resume 01936f8a-7b2c-7000-8000-000000000001 "Keep going"

# Short prefix (git-style, fails on ambiguity)
rkat resume 019c8b99 "Keep going"

# Most recent session
rkat resume last "Keep going"

# 2nd most recent
rkat resume ~2 "Go back to this one"

# Shortcut for `resume last`
rkat c "Keep going"

List sessions

rkat sessions list
rkat sessions list --limit 10
rkat sessions list --limit 10 --offset 20

Read session state

rkat sessions show 01936f8a-...

Archive a session

rkat sessions delete 01936f8a-...

Interrupt a turn

Cancel an in-flight turn. No-op if the session is idle.
rkat sessions interrupt 01936f8a-...

Event streaming

# Basic streaming
rkat run --stream "Tell me a story"

# Stream view modes
rkat run --stream --stream-view primary "Plan the release"
rkat run --stream --stream-view mux "Plan the release"
rkat run --stream --stream-view focus --stream-focus mob:planner "Draft steps"

# Short flags
rkat run -s -w mux "Plan the release"

Model and provider selection

rkat run --model gpt-5.2 --provider openai "Hello"
rkat run --model gemini-3-flash-preview --provider gemini "Hello"
rkat run --model claude-opus-4-6 "Hello"

Config management

# Read config
rkat config get
rkat config get --format json --with-generation

# Replace config
rkat config set --json '{"agent": {"model": "gpt-5.2"}}'

# Merge-patch with optimistic concurrency
rkat config patch --json '{"budget": {"max_tokens": 50000}}' --expected-generation 3

Realm selection

Realms scope sessions and config. Surfaces that share a realm_id see the same state. Realm is set at startup for server surfaces (RPC, REST, MCP) and per-command or per-connection for CLI and SDKs.
rkat --realm team-alpha run "Plan release"
rkat --realm team-alpha --instance worker-1 sessions list
rkat --realm team-alpha --realm-backend sqlite resume last "Continue"