Skip to content

Repository files navigation

rein

rein is a minimal terminal coding agent built on DeepSeek Harness (dsh). It keeps the runtime focused by composing dsh's public capabilities and targets Linux ARM64 and macOS ARM64, with RISC-V64 support where the selected dsh providers are available.

中文文档

Features

  • Interactive terminal sessions and one-shot prompts.
  • dsh's shell tool for bounded commands and its persistent Bash tool over the PTY seam.
  • dsh's filesystem, editor, task, skill, goal, plan, subagent, and terminal tools when they are mounted by the active preset.
  • A line-oriented command surface covering session, workspace, model, provider, settings, permissions, skills, plugins, and trace operations.
  • Append-only JSONL sessions compressed with zstd.
  • Project-local sessions and traces, plus user presets.
  • Command approval through dsh-user-approval.
  • A single built-in minimal preset composed from public dsh modules.

Install

Node.js 24 or newer is required.

pnpm add -g @processmission/rein

Use

Start an interactive session:

rein

The REPL uses for a new input and for continuation. End a physical line with \ to continue the same logical prompt on the next line. Accepted input is recalled per workspace from the private ~/.rein/history.jsonl file.

Type / or a slash-command prefix and press Tab to complete a registered command. Multiple candidates are shown as aligned command/description rows, bounded to the terminal width and twenty entries. Candidates come from the active dsh command registry. Enter / or use /help <text> for the searchable command catalog; discovered skills remain available through completion and /skills without flooding Help.

The command surface includes /status, /resume, /tree, /fork, /trace, /workspace, /settings, /model, /preset, /skills, /plugins, and /help. Commands that need a picker print a numbered list and accept a number or an exact name. /trace inspect <seq> and /trace aggregate provide text diagnostics for the current session.

!command runs a local command through dsh's shell seam and prints its output; !!command also sends the captured output back as model context.

Run one prompt and exit:

rein --ask "run the tests"
# short aliases:
rein "run the tests"
rein ask "run the tests"

Resume a persisted session:

rein ask --resume <session-id> "continue from the last step"

Useful run-time options:

--model <id>       Select a model for this run.
--preset <id>      Select a preset for this run.
--resume <id>      Resume a persisted session.
--config <path>    Use an alternate cordis.yml.
--yes              Automatically approve dsh approval requests.
--version          Print the version.
--help             Print command help.

Use --yes only when the invocation is already trusted. In non-interactive input, approval fails closed unless this option is present.

Configuration and data

  • Credentials come from DEEPSEEK_API_KEY first, then ~/.rein/.credentials.yaml. The credentials file is expected to be mode 0600, is hot-reloaded, and is always global.
  • The Harness home is relocated by setting DSH_HOME=~/.rein. dsh therefore keeps its original names under that root: settings.yaml, .credentials.yaml, .env, skills/, and .agent-presets/. rein adds its direct cordis.yml, preferences, history.jsonl, and fallback data there.
  • A project opts in by creating .rein; project skills/, sessions/, and traces/ stay local. Project settings, credentials, compositions, and presets are not separate layers.
  • --config overrides the global ~/.rein/cordis.yml for one run.
  • The only built-in preset is minimal. dsh discovers and authors user presets through ~/.rein/.agent-presets.

Ordinary commands use the dsh shell seam. Work that requires persistent state or interactive stdin uses dsh's line-oriented terminal capability. rein does not provide a second shell or PTY implementation; a deployment must declare the dsh provider required by the selected preset.

Develop

pnpm install
pnpm lint       # TypeScript checks
pnpm test       # Build and run the complete test suite
pnpm build      # Build dist/bin.js

To run the local build without installing it globally:

pnpm build
./dist/bin.js --help

The same flow is available through the Makefile:

make run
make run ARGS='ask "run the tests"'
make cli ARGS='--ask "run the tests"'
make cli ARGS='"run the tests"'
make cli ARGS='--model deepseek-v4-flash "inspect this project"'

Architecture decisions are recorded in DESIGN.md. Development conventions are in AGENTS.md.

License

MIT

About

The rein of DeepSeek Harness — a minimal, Unix-shell-like TUI built as a plugin

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages