Skip to content

Repository files navigation

Rein

Composable agents, built for the edge.

A focused terminal agent harness for endpoint coding workflows.

MIT License Node.js 24 or newer Linux ARM64 and macOS ARM64 TypeScript and ESM

English | 中文

rein is a small terminal coding agent built on the public modules of DeepSeek Harness (dsh). It gives a selected Agent preset a fluent endpoint front door while leaving agent execution, shell, PTY, approval, and session persistence to dsh.

✨ What makes rein different

🧩 Preset-first 🔌 dsh-native 🖥️ Endpoint-ready
Compose persona, tools, context, and compaction for a specific kind of work. Use dsh's official shell, terminal, session, approval, and plugin seams. Run a line-oriented REPL on Linux ARM64 and macOS ARM64 with no full-screen TUI.

⚡ Quick start

Install from GitHub

Requires Node.js 24 or newer.

curl -fsSL https://raw.githubusercontent.com/processmission/rein/main/install.sh | sh

The installer downloads the current source archive, installs dependencies in a temporary staging directory, builds dist/bin.js, and registers the rein command in a user-writable bin directory. No package-registry publication or manual build step is required.

Configure credentials

Use an environment variable:

export DEEPSEEK_API_KEY=your-key

Or store the key in ~/.rein/.credentials.yaml with mode 0600.

Start

# Interactive REPL
rein

# One-shot request
rein --ask "inspect this project and summarize its architecture"

🧭 Everyday interaction

❯ inspect the current repository
  • Press Tab after / or a command prefix for live command completion.
  • Type / and press Enter, or use /help <text>, to search commands.
  • End a physical line with \ to continue one logical prompt on the next line.
  • Use Up/Ctrl+P to recall accepted input from ~/.rein/history.jsonl.
  • Press Ctrl+C, or Escape while an Agent turn is running, to cancel it.

Common commands:

Command Purpose
/status Show session, model, cwd, and token state.
/resume Resume a saved session.
/new Start a fresh session.
/model Inspect or switch the model route.
/preset Inspect or switch the Agent preset.
/skills List available skills.
/trace Inspect the event and tool timeline.
/help Search the command catalog.

For local shell interaction, !command runs through the dsh shell seam and !!command also sends the captured output back as model context.

🧠 Agent presets

Presets are rein's main model-performance unit. A preset can define the persona, tool roster, terminal capabilities, context guidance, and compaction policy used for a particular workflow.

  • minimal is the only built-in preset and is immutable.
  • User presets are copy-derived and live under ~/.rein/.agent-presets.
  • Custom dsh plugins are declared by the selected Cordis composition; rein does not introduce a second plugin format.

The built-in minimal preset combines dsh's persistent Bash tool over the official terminal/PTy seam with filesystem, task, skill, goal, plan, subagent, and terminal capabilities.

🔧 Runtime capabilities

flowchart LR
    C[CLI / REPL] --> B[rein boot]
    P[Agent preset] --> A[dsh Agent]
    B --> A
    A --> S[dsh shell seam]
    A --> T[dsh terminal seam]
    A --> L[dsh session JSONL]
    A --> X[dsh plugin registry]
Loading
  • Shell: bounded commands use the official dsh shell path.
  • Terminal: persistent state and interactive stdin use dsh's PTY-backed terminal capability.
  • Sessions: dsh owns append-only JSONL records, compression, resume, and compaction.
  • Approval: all permission decisions flow through dsh-user-approval.
  • Extensions: dsh Cordis composition, command registry, skills, and Agent presets remain the extension points.

rein owns the endpoint layout, CLI arguments, REPL presentation, and adapters that translate dsh events and domain operations into line-oriented output. It does not provide a second shell, PTY, approval, or session implementation.

📁 Configuration and data

Scope Location Contents
Global ~/.rein/ dsh settings, credentials, presets, skills, history, and fallback data.
Project <project>/.rein/ Project skills, session records, and traces.
Composition ~/.rein/cordis.yml The active dsh Cordis composition.

rein sets the official DSH_HOME input to ~/.rein, preserving dsh's original file names without using the default ~/.dsh. Project configuration, credentials, and presets are not silently merged into a second layer.

🛠️ Development

pnpm install
pnpm lint
pnpm test
pnpm build

Run the local build:

make run
make cli ARGS='--ask "run the tests"'

To register a checked-out build as the global rein command:

pnpm add -g .

Architecture decisions live in DESIGN.md. Development conventions live in AGENTS.md. The Chinese guide is available in README.zh.md.

📄 License

MIT

About

Composable agents, built for the edge.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages