Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-forge/README.md
iris 6739bb903d docs: sort the top-level directories into five sections by what the reader wants
Every docs directory moves under 1-getting-started, 2-handbook,
4-implementation or 5-project; the options reference (section 3) comes from
the website and has no directory here. trust-boundary stays whole under the
handbook for now. web-ui, swarm and tools split between handbook and
implementation, and the command-line references move to
2-handbook/reference. Links, path references in code and nix, and the docs
index follow the moves; no page content changes.
2026-11-06 18:46:57 +01:00

35 lines
1.5 KiB
Markdown

# hive-forge
Typed CLI wrapper around the in-cluster Forgejo's REST API — issues,
PRs, comments, labels, reviews, CI status, attachments, triage.
Replaces the old bash-script wrapper so agents and operators get
consistent error handling, exit codes, and JSON shapes. This is the
**only supported path** to the forge from inside an agent container;
never `curl` it directly.
Reads credentials from the environment (`HIVE_FORGE_URL`, required — no default,
`HYPERHIVE_STATE_DIR`); `-f/--forge <label>` retargets a
swarm-UI-linked external forge account instead. The active repo
resolves `-r/--repo` > the `origin` remote of the cwd's git checkout >
`HIVE_FORGE_REPO` (last-resort override, unset by default) > a hard
error — see `client::Client::from_env`. `HIVE_FORGE_DEADLINE` (seconds,
default 900) caps one invocation; past it the binary exits 75 (see
`src/deadline.rs`).
## When to use it
Reach for this crate when adding or changing a forge verb — it's the
single place issue/PR/comment/CI logic lives for every agent and
`hivectl`. Adding a _tool_ an agent's claude session calls is
`hive-agent-mcp` wrapping a shellout to this binary, not new logic
here.
## Shape
- **`verbs/`** — one module per subcommand (clap `Args` + `run`).
- **`client.rs`** — the Forgejo client wrapper + token loading.
- **`notify.rs`** — the read-before-comment guard, backed by forge's
own notification read-state (no local mirror to drift).
- **`body.rs`** — shared `--body`/`--body-file`/stdin resolution.
Full verb reference: `docs/2-handbook/tools/forge.md`.