Skip to main content

research-helper

rh — orchestrate an AI research project end to end from the terminal.

CI PyPI Python License: MIT

rh turns a research idea into a gated pipeline — config → intake → environment → literature → plan → state → implement → critique → manuscript → close — with every artifact, task, and decision kept in files an agent can read.

The CLI is the product. The skill is additive: it teaches an AI agent (pi, Claude, Codex, …) how to drive rh, ask the user the right questions, and respect the gates. Install the CLI, then optionally install the skill globally.


Install

# once published to PyPI (distribution name: rh-cli, command: rh)
uv tool install rh-cli

# or straight from git
uv tool install git+https://github.com/hitaishi2222/research-helper

# or from a clone
git clone https://github.com/hitaishi2222/research-helper
cd research-helper
uv tool install .

pipx install rh-cli and pip install --user rh-cli work too. Verify with:

rh --version
rh describe

Install the skill (optional)

rh skill install                 # ~/.agents/skills/research-helper/
rh skill install --dest ~/.pi/agent/skills/research-helper   # pi-specific location

Pi and other Agent Skills clients discover ~/.agents/skills/ automatically. The skill is bundled in the wheel, so there is nothing else to download.


Quickstart

rh init                          # in the project directory; rich wizard with detected options (Enter keep, Tab next, s skip, q finish)
rh init --dry-run                # preview without writing anything, not even the prompt files
rh init --force                  # archive a copy of env.json/tasks.json to .rh/.bak/ before writing
rh init --clean                   # archive the whole .rh/ (event logs, notes) then recreate it
rh env set agents.count=2 agents.backend=tmux agents.cli=pi \
  agents.skills=research-helper,crw literature.search=crw \
  literature.library=papr project.git=true
rh env show                 # config as a table, validated
rh tasks phase 4            # gated: refuses to skip unmet exits
rh tasks phase              # what the current phase still needs
rh describe                 # the map an agent reads
rh resume --dry-run         # the exact command the orchestrator would start
rh spawn researcher "implement S07 of PLAN.md"
rh info PLAN.md             # what that file is for, its sections, its template

The Orchestrator (your agent) interviews you for the environment and writes .rh/ENVIRONMENT.md; rh never probes or auto-fills binaries. rh init also writes your role files and .rh/CHECKLIST.md — the Orchestrator's to-do list. A tool on PATH does not mean this project should use it.


Commands

Command What it does
rh init [--force] [--clean] [--dry-run] create the .rh/ workspace here — env.json, .rh/agents/*.md, .rh/CHECKLIST.md, an empty .rh/HANDOFF.md — non-destructively (archives before writing or removing); the project name is the directory, changeable with rh env set project.name=
rh env show print config as a table + .rh/ENVIRONMENT.md notes, validate
rh env set KEY=VALUE ... set any key from the §2 schema (rh env list)
rh env list every settable key, type, choices, help
rh add note <heading> [-m BODY] [--file NAME] create/append a note file
rh add literature <DOI-or-heading> [-m BODY] append under that DOI/heading in LITERATURE.md
rh add layout <heading> [-m BODY] append to OUTPUT_LAYOUT.md (patterns + our layout)
rh add gaps|problem|plan|status|manuscript <heading> [-m BODY] same for the other artifacts
rh add log --role R --title T [-m BODY] §7 log file
rh add task "title" [--id S01] [--phase N] [--owner ROLE] [--state idle|working|complete|cancelled] [--verify CMD] [--deliverable FILE] [--depends-on S01,S02] [--kind build|spike] add a board task
rh search <query> [--max N] rg-first local search over .rh/ + artifacts
rh tasks set <id> <idle|working|complete|cancelled> change a task or subtask state (cancelled = plan killed by a later finding)
rh tasks info <id> [--json] one task or subtask in full: phase, owner, state, deliverable, verify, risk, timebox, dependencies, subtasks, timestamps
rh tasks rm <id> [--force] drop a task (with its subtasks) or one subtask; refuses working work and tasks others depend on unless --force; ids are never renumbered
rh tasks reorder <id> (--before | --after) <id> move a task inside its phase; list order is display order. Hand-editing .rh/tasks.json for removal/reordering is allowed after user approval (valid JSON, ids and current_phase untouched)
rh tasks [--phase N] [--state S] [--cancelled] the board: every task + subtask, state, progress bars; cancelled tasks are counted in one footer line — -c/--cancelled shows them
rh tasks phase [0-9] show the current phase and its exit gate, or set the phase — gated; --force records a waiver
rh status header, phase rail, per-phase progress
rh workflow display the agent-authored .rh/workflow.mmd as ASCII (--tools, --example, --png, --svg)
rh resume / rh -r run the orchestrator in this terminal — command from agents.commands.orchestrator (wiring .rh/agents/orchestrator.md in as the system prompt), only agents.skills loaded; opens with the skill read and does not echo the prompt
rh spawn <role> [prompt] open another role agent (literature, researcher, reviewer, critique, writer or your own) with the command written in .rh/env.json; --inline, --dry-run, --prompt-file, --split
rh spawn terminal <cmd> open a plain shell terminal in a new pane (shell from agents.shell/$SHELL, layout from agents.split); --dry-run, --split
rh agent list / rh agent info <role> / rh agent write [role] the per-role files in .rh/agents/ (the only role description — no role info is hardcoded in rh); info renders the file, write creates missing starter roles without overwriting an edited one
rh agent status who is running, on which model, from .rh/logs/spawns.jsonl
rh handoff / rh handoff --clear show the handoff the Orchestrator wrote for the next session (.rh/HANDOFF.md), or empty it after reading; empty at rh init, never generated from STATUS.md/PLAN.md
rh info [FILE] what that artifact is for: owner, phase, sections, template, rules (--json, --template)
rh skill install [--dest DIR] [--force] install the bundled skill globally
rh describe [--json] the AI map: layout, phases, env keys, artifacts, spawn, budget

Global flags (before or after the subcommand): --root DIR, --json; --version prints the release. rh -t is rh tasks; rh -r is rh resume. A wrong command or flag prints the full --help, nothing else (exit 2). Every command supports --json for agent reads — never parse the pretty UI.


Launching agents (nothing hardcoded)

rh does not know any agent CLI's flags. The commands live in .rh/env.json, and rh substitutes placeholders into them:

rh env set \
  'agents.roles.orchestrator={"provider":"pi","model":"glm-5","thinking":"high"}' \
  'agents.commands.orchestrator=pi --model {model} --thinking {thinking} --append-system-prompt {agent_file} {prompt}' \
  'agents.spawn=tmux new-window -n rh-{project}-{agent} -c {root} {command}'
rh resume            # → pi --model glm-5 --thinking high --append-system-prompt .rh/agents/orchestrator.md "Load the `research-helper` skill now…"
rh spawn researcher "read S07 and implement it"

Placeholders: {role} {agent} {prompt} {prompt_file} {root} {name} {project} {provider} {model} {thinking} {skills}, plus {command} in agents.spawn. A template that omits {model}/{thinking}/{skills} still runs — rh warns that your env.json is not being honoured instead of guessing a flag. {project} is the project-name slug: name every pane rh-<project>-<role>, so two projects running at the same time never collide.

Pane backends are data, not flags you have to know. agents.backend picks one, and rh spawn resolves the pane command in this order:

  1. agents.spawn — your own template, always wins;
  2. the backend's shipped template, when agents.spawn is blank:
backend template
tmux tmux new-window -n rh-{project}-{role} -c {root} {command} (needs a running tmux server, i.e. call it from inside tmux)
tuios tuios new-window -s "$TUIOS_SESSION" rh-{project}-{role} --cwd {root} --no-focus --keep-open -- {command} (inside a tuios pane; elsewhere replace $TUIOS_SESSION with tuios ls's name)
herdr herdr pane split --json then herdr pane run <new pane> {command} — herdr has no create-pane-with-command call, so the shipped line decodes the split's pane id with python3; edit it if your herdr differs
  1. otherwise a detached process whose output goes to .rh/logs/.

The templates live in harnesses.json inside the package, so correcting one is a config/package edit, not a code change. rh doctor reports a missing backend binary and whether the pane command will come from your template or the backend. Ready-made scripts and per-role prompt templates live in examples/.


How it works

0 CONFIG → 1 INTAKE → 2 ENVIRONMENT → 3 LITERATURE → 4 PLAN → 5 STATE
        → 6 IMPLEMENT → 7 CRITIQUE → 8 MANUSCRIPT → 9 CLOSE
                            ↑            │
                            └── replan ──┘

Each phase has an exit gate; rh tasks phase refuses to advance past an unmet one. State lives in plain files, not a database:

<project>/
  .rh/                env.json, ENVIRONMENT.md, CHECKLIST.md, HANDOFF.md, agents/, logs, tasks
  src/                implementation
  results/            every number + the script that produced it
  papers/             downloaded PDFs (papr/Zotero or by hand; kept, never deleted by rh)
  PROBLEM.md          purpose, goal, scope, success criteria, falsifier
  OUTPUT_LAYOUT.md    output skeleton + patterns from comparable papers
  PLAN.md             approved steps
  STATUS.md           truth
  LITERATURE.md       paper takes with DOI
  GAPS.md             implementation sourcing + upstream gaps
  MANUSCRIPT.md       write-up

.rh/env.json is the single config file — rh env set writes it, rh env show reads it. .rh/ENVIRONMENT.md holds the phase-2 environment notes, and .rh/CHECKLIST.md is the Orchestrator's generated to-do list.


The skill (additive)

src/rh/skills/research-helper/SKILL.md is the agent-facing half of the project. It defines the phases, roles, gates, templates, and the ask-before list. The CLI does not need it; the skill does not need to reimplement the CLI.

rh skill install

What the skill adds:

  • Roles — Orchestrator (always the current runner), Literature, Researcher, Reviewer, Critique, Writer, with a budget mapping for 1–4 parallel agents, and rh spawn <role> to put one of them to work with the command from env.json.
  • Gates — user approves the plan, critique veto, "no result without a file".
  • Templates — .rh/ENVIRONMENT.md, STATUS.md, OUTPUT_LAYOUT.md, PLAN.md steps, logs — the same descriptions rh info <FILE> prints, so an agent can check before writing.
  • Reading discipline — one layout, a pattern tally, DOI anchors, no paraphrasing unread papers.

Development

uv sync --extra dev         # .venv with pytest, pyflakes and build
uv run pytest -q
uv run pyflakes src/rh tests
uv build                     # sdist + wheel in dist/
uv tool install dist/*.whl   # smoke-test the installed command

uv run uses the project .venv. If the dev extra is not synced, uv run pytest falls back to a pytest on PATH, which can import an already-installed rh instead of this checkout — a green run that tested the wrong code. Sync first, and check uv run python -c "import rh; print(rh.__file__)" when in doubt.

Layout:

pyproject.toml
src/rh/                 the CLI package
src/rh/skills/          the bundled skill (package data)
tests/                  pytest smoke tests
examples/               agent-facing spawn scripts + role prompt templates
docs/IDEA.md            original design notes
ROADMAP.md              where this is going

Roadmap

See ROADMAP.md. Short version: publish to PyPI, harden the CLI, then add real agent orchestration.

License

MIT © 2026 Hitaishi V

Metadata

Release files for rh-cli 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rh-cli 0.2.1
File Size Uploaded Provenance Actions
rh_cli-0.2.1.tar.gz 143.4 kB With provenance Details for rh_cli-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rh-cli 0.2.1
File Interpreter ABI Platform Actions
rh_cli-0.2.1-py3-none-any.whl Python 3 none any Details for rh_cli-0.2.1-py3-none-any.whl

Total release size: 251.8 kB

Release files / rh_cli-0.2.1.tar.gz

Download URL rh_cli-0.2.1.tar.gz
Size 143.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ab863b04e7afd1eff011b177c55f8c3a425e0d905ef6df6e01d930c4ca2cb390
BLAKE2b-256 checksum
How to use checksums
ee927494e5acbb808820ecbc904b97fbc4c126fe9f6f3b85bb22d511f63c8cb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / rh_cli-0.2.1-py3-none-any.whl

Download URL rh_cli-0.2.1-py3-none-any.whl
Size 108.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69094250444582b827592a7b425971a84cd76a40699800f99b3757e5252345b6
BLAKE2b-256 checksum
How to use checksums
1110229c11d886841bbc22ff3cd3470f7458c584a69ccffd793dca45b3d76430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for rh-cli 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rh_cli-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page