feat(hyperguild): tier subcommand

Adds the tier subcommand to the hyperguild CLI. Reuses
internal/tier.Detect verbatim, sources probe URLs from
ANTHROPIC_PROBE_URL (default https://api.anthropic.com) and
LITELLM_BASE_URL (no default — empty triggers airplane).

Human-readable output by default; --json emits the same Info struct
as the supervisor's tier MCP returns. Tests cover all three tier
states via httptest fakes.
This commit is contained in:
2026-05-03 21:27:33 +02:00
parent 5c88eff46f
commit 3c4e8e8bb8
4 changed files with 122 additions and 3 deletions
+2 -2
View File
@@ -35,8 +35,8 @@ func TestDispatch_UnknownSubcommand_ReturnsTwo(t *testing.T) {
func TestDispatch_KnownSubcommand_RoutesAndReturnsExitCode(t *testing.T) {
var out, errBuf bytes.Buffer
code := dispatch(context.Background(), []string{"tier"}, strings.NewReader(""), &out, &errBuf)
// At Task 1 time, tier returns the not-implemented error → exit 1.
code := dispatch(context.Background(), []string{"brain"}, strings.NewReader(""), &out, &errBuf)
// At this point, brain still returns the not-implemented error → exit 1.
assert.Equal(t, 1, code)
assert.Contains(t, errBuf.String(), "not implemented")
}