Abstract CLI
A coding agent CLI built on Cersei — single binary, graph memory, 34 tools.
Abstract CLI
Abstract is a complete CLI coding agent built on the Cersei SDK. One binary, zero runtime dependencies, graph memory by default.
Install
cargo install --git https://github.com/pacifio/cersei abstract-cliUsage
abstract # Interactive REPL
abstract "fix the failing tests" # Single-shot
abstract --resume # Resume last session
abstract --model opus --max # Opus with max thinking
abstract --no-permissions --json # CI mode with NDJSON output
abstract --provider openai # Force OpenAI
abstract -C /path/to/project # Working directoryConfiguration
Config is layered (lowest to highest priority):
- Hardcoded defaults
~/.abstract/config.toml(global).abstract/config.toml(project)- Environment variables (
ABSTRACT_MODEL, etc.) - CLI flags
# ~/.abstract/config.toml
model = "gpt-4o"
provider = "openai"
max_turns = 20
max_tokens = 16384
effort = "medium"
theme = "dark"
auto_compact = true
graph_memory = true
permissions_mode = "interactive"Authentication
abstract login # Interactive chooser
abstract login claude # Anthropic OAuth
abstract login openai # Enter OpenAI key
abstract login key # Auto-detect from prefix
abstract login status # Show auth status
abstract logout # Remove credentialsOr set environment variables:
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...Provider Auto-Detection
OPENAI_API_KEYset → uses OpenAI (auto-switches model to gpt-4o)ANTHROPIC_API_KEYset → uses Anthropic- Both set → prefers OpenAI (override with
--provider anthropic)
Project Initialization
abstract initCreates .abstract/config.toml and .abstract/instructions.md in the current directory. Instructions are injected into every conversation's system prompt.
Session Management
abstract sessions list # List all sessions
abstract sessions show <id> # Show transcript
abstract sessions rm <id> # Delete session
abstract --resume # Resume last session
abstract --resume <id> # Resume specific sessionSessions are stored as JSONL at ~/.claude/projects/<path>/<id>.jsonl — compatible with Claude Code format.
MCP Servers
abstract mcp add github npx @modelcontextprotocol/server-github
abstract mcp list
abstract mcp remove githubMCP servers are configured in .abstract/config.toml and started on demand.
Graph Memory
Graph memory (Grafeo) is ON by default. Stores relationships between memory entries:
(:Memory) --[:RELATES_TO]--> (:Memory)
(:Topic) --[:TAGGED]------> (:Memory)Graph recall returns results in 98 microseconds — indexed lookups instead of scanning every file.
Architecture
Abstract is a thin CLI shell around the Cersei SDK:
User Input → InputReader (rustyline)
→ REPL loop
→ Agent::run_stream() (Cersei SDK)
→ Provider (Anthropic/OpenAI)
→ Tool dispatch (34 tools)
→ Memory (graph + flat files)
→ Hooks, permissions, auto-compact
→ StreamRenderer (termimad)
→ Terminal outputThe SDK does 95% of the work. The CLI handles presentation, config, and user interaction.