From eab8775f5f1e05dc239858011c414744e975eadf Mon Sep 17 00:00:00 2001 From: Mathias Bergqvist Date: Sun, 3 May 2026 21:56:20 +0200 Subject: [PATCH] feat(hyperguild): README + Taskfile integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds cmd/hyperguild/README.md (subcommands, env vars, install path) and three Taskfile targets: task hyperguild:dev — go run from source task hyperguild:build — build into ./bin/hyperguild task hyperguild:install — go install into $GOBIN Concludes Plan 4 of the hyperguild migration. The binary replaces the supervisor's tier MCP and surfaces brain HTTP REST access plus mode bootstrap to shell pipelines and ad-hoc agent prompts. --- Taskfile.yml | 16 ++++++ cmd/hyperguild/README.md | 110 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 cmd/hyperguild/README.md diff --git a/Taskfile.yml b/Taskfile.yml index f8bdddb..67f8657 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -39,6 +39,22 @@ tasks: cmds: - go run ./cmd/supervisor + hyperguild:dev: + desc: Run hyperguild CLI from source (e.g. task hyperguild:dev -- tier) + cmds: + - go run ./cmd/hyperguild {{.CLI_ARGS}} + + hyperguild:build: + desc: Build the hyperguild binary into ./bin/hyperguild + cmds: + - mkdir -p bin + - go build -o bin/hyperguild ./cmd/hyperguild + + hyperguild:install: + desc: Install hyperguild into $GOBIN + cmds: + - go install ./cmd/hyperguild + ingestion:dev: desc: Run ingestion server in development mode dir: ingestion diff --git a/cmd/hyperguild/README.md b/cmd/hyperguild/README.md new file mode 100644 index 0000000..a27d56d --- /dev/null +++ b/cmd/hyperguild/README.md @@ -0,0 +1,110 @@ +# hyperguild CLI + +A small Go binary for tier probing, brain HTTP REST access, and +`.mcp.json` mode bootstrap. Replaces the supervisor's `tier` MCP and +gives shell scripts a stable interface to the brain. + +## Install + +```bash +task hyperguild:install +# or: go install ./cmd/hyperguild +``` + +The binary lands at `$(go env GOBIN)/hyperguild` (typically +`~/go/bin/hyperguild`). Make sure that's on your PATH. + +## Subcommands + +### `hyperguild tier` + +Probes Anthropic and LiteLLM and reports the current operating tier. + +```bash +$ hyperguild tier +tier 1 (full-online) managed_agents=true + +$ hyperguild tier --json +{ + "tier": 1, + "label": "full-online", + "available_models": null, + "managed_agents": true +} +``` + +Probe URLs are read from environment: + +| Var | Default | +|-----------------------|-------------------------------| +| `ANTHROPIC_PROBE_URL` | `https://api.anthropic.com` | +| `LITELLM_BASE_URL` | (empty → falls through to airplane) | + +### `hyperguild brain query ` + +BM25 search over the brain's knowledge + wiki entries. + +```bash +$ hyperguild brain query "find -H symlink" +knowledge/2026-05-03-find-h-not-l-symlinked-root.md score=12 Use find -H, not find -L +... +``` + +Flags: + +- `--limit N` — max results (default 5) +- `--json` — emit the raw response envelope + +### `hyperguild brain write ` + +Reads markdown from stdin, writes a knowledge entry. + +```bash +$ cat <` + +Writes a `.mcp.json` template for the chosen operating mode. + +```bash +$ hyperguild mode cloud --out ./.mcp.json +wrote ./.mcp.json (mode: cloud) +``` + +Flags: + +- `--out PATH` — output file (default `./.mcp.json`) +- `--force` — overwrite an existing file + +Modes: + +- **cloud** — brain MCP only. Claude Code with no routing. +- **client-local** — brain + routing placeholder. The routing entry's + URL points at `koala:30310/mcp`; a `_routing_pending` field marks it + as awaiting Plan 6 of the hyperguild migration. +- **sovereign** — brain only, with a `_mode_note` explaining that this + mode primarily uses Crush + LiteLLM and the `.mcp.json` is a Claude + Code fallback for emergency offline use. + +## Environment + +| Var | Default | Used by | +|-----------------------|--------------------------|---------------------| +| `BRAIN_URL` | `http://koala:30330` | `brain *`, `mode *` | +| `ANTHROPIC_PROBE_URL` | `https://api.anthropic.com` | `tier` | +| `LITELLM_BASE_URL` | (empty) | `tier` | + +Override `BRAIN_URL` if your brain pod is at a different Tailscale name +or port. + +## See also + +- `docs/superpowers/specs/2026-05-03-hyperguild-cli-design.md` — full spec +- `docs/superpowers/plans/2026-05-03-hyperguild-cli.md` — implementation plan