A local-first AI memory system and orchestration layer for existing coding agents like Codex CLI, Claude Code, and Gemini CLI
RexCLI (CLI command aios) is a local-first AI agent bootstrap that provides three shared infrastructures for coding agents like Codex CLI, Claude Code, Gemini CLI, and OpenCode without replacing their model invocation capabilities: a cross-CLI persistent memory system (ContextDB) based on better-sqlite3, unified browser automation via Playwright MCP (browser_* toolset with CDP support), and an automatic Privacy Guard for sensitive file sanitization.
Shared Infrastructure#
- ContextDB: Cross-CLI filesystem persistent storage supporting session / event / checkpoint / context:pack subcommands, built on better-sqlite3 (requires Node ABI match)
- Unified Browser Automation: Playwright MCP Server provides standardized
browser_*toolset with CDP (Chrome DevTools Protocol) connection support - Privacy Guard: Automatic sanitization before reading config/key files, config stored at
~/.rexcil/privacy-guard.json, optional local Ollama (qwen3.5:4b) path
Operator Toolbox#
- Quality Gate:
aios quality-gate full/pre-pr --profile strictfor repo health + ContextDB regression guards - Learn-Eval:
aios learn-eval --limit 10converts checkpoint telemetry into actionable insights - Orchestrate: Blueprint orchestration + local scheduling skeleton + token-free dry-run;
--dispatch local --execute livefor actual model calls - Team Runtime:
aios team 3:codex "Ship X"for multi-agent parallel collaboration with dry-run / resume / retry-blocked support - HUD:
aios hud --provider codex --watch --preset fullfor session visibility - Snapshot Rollback: Pre-mutation snapshots + post-incident rollback for recovery
Skills System#
Standardized skill source tree supporting global and project scopes. Core skill set includes skill-constraints, aios-project-system, aios-long-running-harness, contextdb-autopilot, etc., with interactive install/uninstall via TUI SkillPickerScreen.
Architecture & Call Chain#
User → codex/claude/gemini
→ (zsh wrapper: contextdb-shell.zsh)
→ contextdb-shell-bridge.mjs
→ ctx-agent.mjs
→ contextdb CLI (init/session/event/checkpoint/pack)
→ start native codex/claude/gemini (with context packet)
→ mcp-server/browser_* (optional browser automation)
Native CLI calls are transparently intercepted via a zsh wrapper, bridged through contextdb-shell-bridge.mjs, and processed by ctx-agent.mjs for ContextDB session initialization and context packing before launching the native CLI with a context packet.
Upstream Agent Integration#
- Codex CLI: Deep adaptation for v0.114+ structured exec outputs (
--output-schema+--output-last-message+ stdin), fallback to stdout parsing for older versions - Claude Code / Gemini CLI: Unified access via Shell Wrapper
- OpenCode: Documented support
Installation & Prerequisites#
Runtime strictly requires Node.js 22 LTS ("engines": { "node": ">=22 <23" }), supporting macOS, Linux, and Windows (PowerShell).
macOS / Linux one-line install:
curl -fsSL https://github.com/rexleimo/rex-cli/releases/latest/download/aios-install.sh | bash
source ~/.zshrc
aios
Windows PowerShell one-line install:
irm https://github.com/rexleimo/rex-cli/releases/latest/download/aios-install.ps1 | iex
. $PROFILE
aios
Key Environment Variables#
| Variable | Description |
|---|---|
AIOS_SUBAGENT_CLIENT | Sub-agent client: codex-cli / claude-code / gemini-cli |
AIOS_SUBAGENT_CONCURRENCY | Concurrent sub-agent count |
AIOS_EXECUTE_LIVE | Set to 1 to enable live execution with actual model calls |
AIOS_SUBAGENT_PRE_MUTATION_SNAPSHOT | Set to 1 to create file snapshots before live execution |
CTXDB_WRAP_MODE | repo-only (default) / opt-in (requires .contextdb-enable marker) |
RL Experiment Module#
Repository contains experiments/rl-shell-v1 providing RL (reinforcement learning) experiment infrastructure with benchmark, training (phase 2A), evaluation (phase 2B), and campaign scripts. Production readiness status is unclear.
Unconfirmed Information#
- No LICENSE file found in repository root; open-source license type cannot be confirmed
- No associated Hugging Face model page or academic paper citations found
- Privacy Guard local Ollama path's specific model capabilities are unverified