rei-code
v0.1.0
Published
Claude Code–parity terminal coding agent powered by REI Labs Units/Reigents
Maintainers
Readme
REI Code
Claude Code–style terminal coding agent powered by REI Labs Units/Reigents.
What it does
- Interactive and one-shot CLI for repo-aware coding assistance
- Tooling: read/write/apply patch, search, git status/diff/log, run commands (deny-by-default)
- Session persistence and resumable conversations (repo-local state)
- REI Labs provider integration (Units/Reigents) with debug logging and retry/backoff (no streaming yet)
- REPL IO purity: all REPL/slash output flows through injectable IO channels (write/info/warn/error/debug/log)
Install (npm)
Global install (adds rei to your PATH):
npm install -g rei-code
rei --helpRun without global install:
npx rei-code --helpPrerequisites
- Node.js 18+ (required for CLI runtime)
- REI Labs API key (export
REI_API_KEYor pass--api-key)
For contributors/developers in this repo:
- Bun 1.0+ (used for dev workflow and tests) — install from https://bun.sh
Dev install & build
bun install
bun run buildRun
Interactive REPL:
bun run start
# or
node dist/index.jsOne-shot prompt:
node dist/index.js "Add tests for foo"Print/pipe mode (Claude parity flag):
echo "Summarize src/cli.ts" | node dist/index.js -pCommon flags (parity-inspired):
-p, --print– print response and exit-c, --continue– continue most recent session in this repo-r, --resume <id>– resume by session id--unit / --reigent <name>– pick model/unit (unit is resolved server-side; we do not send model)--allow-cmd <prefix>– allowlist a command prefix (still prompts to run)--show-permissions– print current permissions/policy summary at startup--yes– auto-approve safe file writes (never auto-approves commands)
REI-specific subcommands:
rei agents:get– fetch agent details (REI REST API)rei chat:test [message]– minimal chat completion testrei mcp list– list MCP servers from the registryrei mcp enable <id>– enable an MCP server in.rei/mcp.json
State & config
Repo-local state lives in .rei/ (see REI.md):
.rei/config.json– repo overrides.rei/sessions/– session logs (JSONL; retention and redaction supported via SessionStore options)
Debugging
Set REI_DEBUG=1 to print request/response envelopes, retry attempts, and provider errors (payloads redacted, unit noted but not sent):
REI_DEBUG=1 node dist/index.js "hello"See DEBUGGING.md for more.
Testing
bun testSee TESTING.md for the testing taxonomy and near-term coverage goals.
Embedding / IO purity
REPL IO is injectable (write/info/warn/error/debug/log). This enables embedding in TUIs/webviews and transcript capture without stdout scraping. See EMBEDDING_USE_CASES.md for concrete scenarios.
Contributing / repo guide
See REI.md for architecture, conventions, and safety/UX expectations. For migration notes, see BUN_MIGRATION.md.
Roadmap & parity
PRD.md contains the parity charter and current workstreams. Short-term roadmap items are tracked there.
Beta status (current)
Shipped in beta:
- Provider hardening (capabilities, retry/backoff, structured debug logging)
- Session persistence/resume (
.rei/sessions/*.jsonl) - Deny-by-default command policy with allowlist + approval prompts
- MCP discovery and interactive trust flow (
/mcp discover,/mcp inspect,/mcp connect) - REPL IO purity (injectable IO channels used across REPL/slash flows)
Deferred to post-beta:
- Streaming model output
- Checkpoint/hook/plugin parity beyond command plugins
- Full parity for all Claude Code subcommands/flags
