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-6 "What is the capital of France?"

Multi-turn

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

# Or target a specific prior session
rkat run --resume ~2 "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 run --resume 01936f8a-7b2c-7000-8000-000000000001 "Keep going"

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

# Most recent session
rkat run --resume last "Keep going"

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

# Omitting the session value resumes `last`
rkat --resume "Keep going"

List sessions

rkat session list
rkat session list --limit 10
rkat session list --limit 10 --offset 20

Read session state

rkat session show 01936f8a-...

Archive a session

rkat session delete 01936f8a-...

Interrupt a turn

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

Event streaming

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

Model and provider selection

rkat run --model gpt-5.5 --provider openai "Hello"
rkat run --model gemini-3.5-flash --provider gemini "Hello"
rkat run --model claude-opus-4-8 "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.5"}}'

# 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 session list
rkat --realm team-alpha --realm-backend sqlite run --resume last "Continue"

Next step