Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-forge
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 6bb13f964d hive-c0re: validate forge env at startup; char-safe short revs
HIVE_FORGE_URL (set + parseable) and HIVE_ASSETS_DIR are checked once in
main before workers start. Short revs in container_view and pr_status
take 12 chars instead of byte-slicing.
2026-10-09 10:51:39 +02:00
..
src hive-c0re: validate forge env at startup; char-safe short revs 2026-10-09 10:51:39 +02:00
tests hive-forge: credential-helper fails closed when the configured forge URL won't parse 2026-10-04 14:31:05 +02:00
Cargo.toml swarm CA: describe the store's pki root as the only anchor in docs and comments 2026-10-05 21:17:10 +02:00
README.md forge: external forge accounts live in swarm bao; the agent fetches them itself 2026-10-01 18:05:33 +02:00

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, 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.

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/tools/forge.md.