Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hivectl
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas ddb7d7196d matrix: swarm-controller is the only minter
Every hive is in a swarm and every swarm runs matrix, so every swarm has a
swarm-controller, and since #4810 its hive_sender pass mints each hive's
@hive-<hive>: sender token into the store every five minutes. The two
other minters of that token go:

- swarm-matrix-ctl mint: the systemd.services.swarm-matrix-ctl unit in the
  hive-matrix container, Command::Mint and src/mint.rs. The binary, its
  appservice render/publish verbs, ctlPackage, ctlActive and the ctl cert
  role stay. bao-matrix-reader's checks on the deleted unit are removed;
  the leaf-identity and no-token-in-env checks now look at
  swarm-matrix-appservice-publish, which runs under the same identity.
- the hive-side mint ladder in hive-c0re's ensure_hive_user
  (register/appservice-login/password-login with the local as_token), with
  read_appservice_token, paths::matrix_appservice_token and the helpers
  only it used. ensure_hive_user now takes the store's token, keeps the
  file when the store has none or can't be reached, and fails otherwise.
- hivectl matrix sync-admin: the verb, HostRequest::MatrixSyncAdmin and
  handle_matrix_sync_admin. The periodic MatrixSweep (ensure_all) is
  unchanged apart from no longer reading the local as_token.

This removes the double-mint race #4810's review flagged: two minters
logging in on one pinned device could leave a dead token in the store
until the next pass.

Closes #4813
Closes #4814
2026-09-30 00:46:46 +02:00
..
src matrix: swarm-controller is the only minter 2026-09-30 00:46:46 +02:00
Cargo.toml hivectl: migrate dag_progress to hive-jobq-wire's generic GraphNode 2026-08-03 20:35:24 +02:00
README.md refactor(hive-c0re): drop the request_init_config tool and InitConfig approval 2026-09-14 19:03:44 +02:00

hivectl

The operator-facing host CLI. A thin client for the hive-c0re daemon — speaks the host admin socket protocol (hive-host-sock) and does not link the daemon crate. Container lifecycle, the approval queue, and provisioning verbs all forward to the daemon and need it running; a few (wg/peer-config, choom) work off local host state instead.

When to use it

Reach for this crate when adding an operator-run host command — agents talk to the daemon over their own MCP tool surface (hive-agent-mcp), not this binary. hivectl is what a human operator (or a host-side script) runs.

Shape

One module per subcommand family; main.rs is just the clap parse + dispatch:

  • agents.rs — container lifecycle (start/stop/create/kill/rebuild/restart/…).
  • approvals.rs — the config/spawn/meta-input approval queue.
  • dag_progress.rs — rebuild-queue progress rendering.
  • power.rs — restart/start/stop at the container level.
  • choom.rs — drop into an interactive claude session in a container.
  • forge.rs, matrix.rs, github.rs, gateway.rs — per-integration account/token provisioning.
  • wg.rs — WireGuard mesh helpers.
  • subvol.rs — btrfs state-subvolume ops.
  • quota.rs, util.rs, completions.rs, open.rs — shared helpers, shell completions, browser-open.

Full verb reference: docs/tools/hivectl.md.