oxi-store
Shared persistent state for oxi — sessions, settings, auth, model registry.
Overview
oxi-store provides the persistence layer for the oxi coding assistant:
- Session management — append-only JSONL storage with tree branching and forking
- Settings store — layered configuration (defaults → global → project → env → CLI)
- Auth storage — secure API key and OAuth token storage
- Model registry — model definitions with pricing, context windows, and capabilities
- Settings validation — startup validation to prevent runtime panics
Quick Start
use Settings;
// Load settings (layered: defaults → global → project → env)
let settings = load?;
// Validate
let report = settings.validate;
assert!;
// Access
println!;
println!;
Core Types
| Type | Purpose |
|---|---|
SessionManager |
Create, persist, and navigate conversation sessions |
SessionEntry |
Single entry in a session tree (message + metadata) |
Settings |
Layered configuration with validation |
ValidationReport |
Settings validation results (errors + warnings) |
AuthStorage |
Secure API key and credential storage |
CliModelRegistry |
Model definitions with auth integration |
Session Tree
Sessions are stored as trees — each entry has a parent_id, enabling branching:
Session Root
├── Entry 1 (user message)
├── Entry 2 (assistant response)
│ ├── Entry 3 (fork A: user follow-up)
│ └── Entry 4 (fork B: alternative follow-up)
Settings Layers
Settings are resolved in order (later overrides earlier):
- Built-in defaults
- Global config:
~/.oxi/settings.toml - Project config:
.oxi/settings.toml - Environment variables (
OXI_*) - CLI arguments (
-m,-p,--thinking)