mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
hanzoskills.com/llms.txt now opens with the install line, the API reference index and the company index, so an agent that lands on any one of the three can find the rest. robots.txt claimed 537 documents while llms.txt counts 920. The number is gone from robots.txt; llms.txt derives it. public/ is regenerated from scripts/site.py, which it had fallen behind: the copy-prompt menu and agent bar were in the generator and not in the committed pages. tests/site.mjs passes against the result. Co-authored-by: Hanzo Dev <[email protected]>
348 lines
32 KiB
HTML
348 lines
32 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head>
|
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>hip-0041</title>
|
|
<meta name="color-scheme" content="dark">
|
|
<style>
|
|
/* Committed to one visual world: a dark instrument panel. No light variant —
|
|
the dot field and the hairline rules only read on black, and a naive
|
|
inversion would wash both out. Every colour is painted explicitly so the page
|
|
never borrows a host background. */
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
|
|
|
|
:root{
|
|
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
|
|
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
|
|
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
|
|
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
|
|
--font-zen-pixel-square:'Zen Pixel Square',monospace;
|
|
--mono:var(--font-zen-mono);
|
|
--sans:var(--font-zen-sans);
|
|
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
|
|
--r:999px; --r-soft:14px;
|
|
}
|
|
*{box-sizing:border-box}
|
|
html{-webkit-text-size-adjust:100%}
|
|
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
|
|
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
|
|
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
|
|
|
|
/* The dot field. A halftone made of one repeating radial-gradient, faded out
|
|
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
|
|
/* No overflow clip here: the dot field is inset to the box already, and a clip
|
|
would cut off the copy-prompt menu. */
|
|
.hero{position:relative;border-bottom:1px solid var(--line)}
|
|
.hero::before{content:"";position:absolute;inset:0;
|
|
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
|
|
background-size:7px 7px;
|
|
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
pointer-events:none}
|
|
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
|
|
|
|
nav{border-bottom:1px solid var(--line)}
|
|
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
|
|
justify-content:space-between;align-items:center;gap:1rem}
|
|
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--ink);text-decoration:none;
|
|
display:inline-flex;align-items:center;gap:.6rem}
|
|
.brand i{font-style:normal;color:var(--faint)}
|
|
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
|
|
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--soft);text-decoration:none}
|
|
nav a.up:hover{color:var(--ink)}
|
|
|
|
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
|
|
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
|
|
h1 em{font-style:normal;color:var(--faint)}
|
|
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
|
|
|
|
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
|
|
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
|
|
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
|
|
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
|
|
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
|
|
line-height:1.2;font-weight:400}
|
|
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
|
|
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
|
|
.btn.solid:hover{background:#d8d8d4}
|
|
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
|
|
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
|
|
|
|
/* Copy-prompt selector. Each row copies the prompt for its own target. */
|
|
.copy{position:relative;display:inline-flex}
|
|
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
|
|
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
|
|
padding:.4rem;display:flex;flex-direction:column;
|
|
box-shadow:0 12px 32px rgba(0,0,0,.75)}
|
|
.menu[hidden]{display:none}
|
|
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
|
|
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
|
|
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
|
|
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
|
|
white-space:nowrap}
|
|
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
|
|
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
|
|
.mi:hover .mark{color:var(--ink)}
|
|
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
|
|
letter-spacing:.1em;text-transform:uppercase}
|
|
|
|
/* Works-with bar: one scrolling row, name and mark per agent. */
|
|
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
|
|
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
|
|
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
|
|
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
|
|
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
|
|
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
|
|
display:flex;align-items:center}
|
|
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
|
|
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
|
|
-webkit-overflow-scrolling:touch;
|
|
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
|
|
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
|
|
.bar::-webkit-scrollbar{display:none}
|
|
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
|
|
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
|
|
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
|
|
text-decoration:none;background:var(--ground)}
|
|
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
|
|
.agent .mark{width:.95rem;height:.95rem}
|
|
|
|
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
|
|
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
|
|
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
|
|
p{margin:0 0 1rem;max-width:70ch}
|
|
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
|
|
li{margin:.22rem 0}
|
|
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
|
|
text-decoration-color:var(--line-hi)}
|
|
a:hover{text-decoration-color:var(--ink)}
|
|
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
|
|
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
|
|
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
|
|
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
|
|
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
|
|
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
|
|
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
|
|
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
|
|
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
|
|
display:block;overflow-x:auto}
|
|
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
|
|
|
|
.curl{display:block;background:var(--panel);border:1px solid var(--line);
|
|
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
|
|
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
|
|
white-space:pre;line-height:1.9}
|
|
.curl b{color:var(--ink);font-weight:400}
|
|
.curl i{font-style:normal;color:var(--faint)}
|
|
|
|
/* index */
|
|
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
|
|
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
|
|
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
|
|
#q:focus{outline:none;border-color:var(--soft)}
|
|
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
|
|
text-transform:uppercase;margin:0 0 2rem}
|
|
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
|
|
padding-bottom:.45rem}
|
|
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
|
|
border-radius:var(--r-soft);text-decoration:none}
|
|
.row:hover{background:#0a0a0a}
|
|
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
|
|
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
|
|
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
|
|
color:var(--faint);font-size:.85rem}
|
|
footer a{color:var(--soft)}
|
|
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
|
|
margin:0 0 2rem;font-size:.85rem}
|
|
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
|
|
border-bottom:1px solid var(--line);padding-bottom:.4rem}
|
|
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
|
|
.fmap a:hover{text-decoration:underline}
|
|
.fmap div{color:var(--faint);line-height:1.5}
|
|
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
|
|
|
|
@media (max-width:640px){
|
|
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
|
|
.btns{gap:.5rem}
|
|
.btn{padding:.75rem 1.15rem;font-size:.68rem}
|
|
.copy,.copy .btn{width:100%;justify-content:center}
|
|
.menu{left:0;right:0;min-width:0}
|
|
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
|
|
.strip b{border-right:0;padding-right:0}
|
|
.bar{width:100%}
|
|
}
|
|
</style>
|
|
<link rel="alternate" type="text/markdown" href="/hip-0041.md">
|
|
|
|
<link rel="icon" href="/favicon.svg">
|
|
<link rel="canonical" href="https://hanzoskills.com/hip-0041">
|
|
</head>
|
|
<!-- Reading this with a machine? Every page here is also plain markdown.
|
|
This one: https://hanzoskills.com/hip-0041.md
|
|
Index: https://hanzoskills.com/llms.txt
|
|
Corpus: https://hanzoskills.com/all.md
|
|
Append .md to any path for the markdown twin. -->
|
|
<body>
|
|
<nav><div class="in">
|
|
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
|
|
<a class="up" href="/">All skills</a>
|
|
</div></nav>
|
|
|
|
<div class="wrap">
|
|
<h1>hip-0041</h1><p class="lede">HIP-41: The Hanzo CLI — a Projection of the Served API. Status Final. Hanzo architectural specification.</p><h1>HIP-0041: The Hanzo CLI — a Projection of the Served API</h1>
|
|
<h2>Abstract</h2>
|
|
<p><code>github.com/hanzoai/cli</code> is the terminal surface of Hanzo Cloud: one binary, <code>hanzo</code>, whose command tree is <strong>generated from the API document the cloud serves</strong> rather than written by hand. Every operation the cloud publishes is reachable as a command, and no command exists that the cloud does not publish.</p>
|
|
<p>That is the whole design, and everything else in this document follows from it. A hand-written CLI drifts from its API the moment either changes, and the drift is invisible until a user runs the command. A generated one cannot drift in one direction at all: <strong>a projection cannot describe a route its source lacks.</strong> Commands that do not exist upstream are impossible by construction, not by diligence.</p>
|
|
<p>This HIP replaces its own earlier contents. The previous revision specified a hand-written Go binary with a fixed command list (<code>hanzo chat</code>, <code>hanzo complete</code>, <code>hanzo deploy</code>), a plugin system and an auto-updater. The CLI is written in Rust, its commands are generated, and none of that command list survives. A specification that describes something nobody built is worse than none, because it gets quoted.</p>
|
|
<p><strong>Numbers here were measured on 2026-08-04</strong>, each against the artifact named beside it. Re-measure before quoting one.</p>
|
|
<h2>Specification</h2>
|
|
<p>The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as in RFC 2119.</p>
|
|
<h3>§1 The generation chain</h3>
|
|
<p>The command tree MUST be derived from the API document the cloud serves, by this chain and no other:</p>
|
|
<p> cloud@<ref>/openapi.yaml -> genspec -> spec/cloud.json -> genproduct -> src/commands/product/generated.rs (committed)</p>
|
|
<p>Four properties are normative:</p>
|
|
<ol><li><strong>Generation happens at maintainer time, not at build or run time.</strong> <code>genspec</code></li></ol>
|
|
<p> sits behind a cargo feature of that name; there is no <code>build.rs</code>. The shipped binary parses no YAML and fetches no document. A CLI that reads a remote document at startup fails when the network does, and produces a different command tree for two users on one version.</p>
|
|
<ol><li><strong>The generated source is committed.</strong> It is reviewable, and the diff of a</li></ol>
|
|
<p> regeneration is the diff of the API surface. A capability appearing or disappearing shows up as lines in a pull request.</p>
|
|
<ol><li><strong>The source is pinned by content, not by name.</strong> <code>.spec-lock</code> records the</li></ol>
|
|
<p> repository, the path, the ref and the SHA-256 of the document that generation consumed. A ref alone is a moving target; the digest is what makes a regeneration reproducible.</p>
|
|
<ol><li><strong>There is no default source, and guessing is refused.</strong> <code>genspec</code> fails</li></ol>
|
|
<p> rather than assume which deployment a captured document describes — a host cannot say which deploy a capture came from, and a wrong guess produces a command tree that is confidently wrong. <strong>Refusing to guess is a feature and MUST be preserved.</strong></p>
|
|
<h3>§2 The invariant, and its honest limit</h3>
|
|
<p><strong>Phantom commands are impossible by construction.</strong> Every command is projected from an operation in the source document, so a command naming a route the cloud does not serve cannot be generated. This direction of the invariant is structural and needs no gate to hold.</p>
|
|
<p>The other direction is <em>not</em> structural. An operation the cloud serves may fail to reach the CLI — because the pin is behind, because the operation is unreachable in the projection, or because the document itself is inconsistent. That direction MUST be measured by a gate comparing the generated tree against the served document, reporting three counts:</p>
|
|
<ul><li><strong>present</strong> — served and reachable as a command;</li><li><strong>absent</strong> — served and not reachable; a defect in this repository;</li><li><strong>unfalsifiable</strong> — the comparison cannot decide. This count MUST be reported</li></ul>
|
|
<p> rather than folded into either bucket. A gate that silently treats what it cannot check as passing is not a gate.</p>
|
|
<p><strong>Current result, and it is red.</strong> The gate exits non-zero today: <code>2036 present, 8 absent, 177 unfalsifiable; products reachable 174 of 181</code>, plus six routes under <code>/v1/ai/*</code> where the served document contradicts itself about its own paths. Two of the reported phantoms are deliberately injected fixtures that prove the gate detects them.</p>
|
|
<p>This HIP does not claim the surface is drift-free. It claims the invariant makes one direction of drift impossible and requires the other direction to be counted. <strong>A standard that asserts a property its own gate disproves is worthless exactly when it matters.</strong> Closing the 8 and resolving the 177 is the work; the six self-contradictions are a cloud defect and MUST be fixed there, not absorbed by the projection.</p>
|
|
<h3>§3 Command grammar</h3>
|
|
<p> hanzo <product> [<node>...] <verb> [flags]</p>
|
|
<p>The tree is <strong>variable-depth</strong>, not two-level, because the API's own resource nesting is. Measured depth distribution over the generated tree — intermediate nodes between product and verb:</p>
|
|
<p>| Intermediate nodes | Commands | |---:|---:| | 0 | 655 | | 1 | 1,040 | | 2 | 355 | | 3 | 74 | | 4 | 5 |</p>
|
|
<p>The deepest real command is <code>hanzo iam scim v2 Users owner get</code>. A specification fixing the grammar at <code><product> <verb></code> would describe 655 of 2,129 commands.</p>
|
|
<p>Rules:</p>
|
|
<ol><li><code><product></code> MUST be the first path segment after <code>/v1/</code>. The path is the</li></ol>
|
|
<p> authority for the name; there is no second list of product names to maintain.</p>
|
|
<ol><li>Intermediate nodes MUST follow the resource nesting of the path, in order.</li><li><code><verb></code> MUST be derived from the operation, and the same operation MUST</li></ol>
|
|
<p> produce the same command name on every regeneration.</p>
|
|
<ol><li>A command name MUST NOT be hand-assigned. An operation whose generated name is</li></ol>
|
|
<p> wrong is fixed by fixing the operation upstream, which fixes it for the SDKs and the documentation in the same change.</p>
|
|
<p>Measured today: <strong>2,127</strong> commands at <code>HEAD</code> (2,129 in the working tree) against <strong>2,341</strong> operations in the served document. These count different artifacts — the generated tree and the live document — and MUST always be quoted as a pair with the artifact named, never merged into one figure.</p>
|
|
<h3>§4 Typed arguments, and the 469</h3>
|
|
<p>An operation with a typed request body MUST project to typed flags: one flag per field, carrying the field's type, its documentation as help text, and required fields enforced before any request is sent.</p>
|
|
<p>An operation <strong>without</strong> a typed request body has nothing to project, and falls back to a single opaque <code>--data</code> blob. That is not a CLI design decision; it is the CLI faithfully reflecting an operation that does not describe its own input.</p>
|
|
<p>Measured: <strong>469 of 926 write operations — 50.6% — take an untyped <code>--data</code> blob.</strong> By product:</p>
|
|
<p>| Product | Untyped writes | |:--------|---:| | ai | 72 | | iam | 43 | | store | 19 | | o11y | 16 | | admin | 15 | | platform | 13 |</p>
|
|
<p><strong>The fix does not belong in this repository.</strong> Each is an operation in the cloud that declares no request schema; adding the schema there types the CLI flag, the SDK method and the documentation together. Typing them in the CLI would create a second description of the request body — the drift this design exists to prevent. This HIP therefore states the target, <strong>zero untyped writes</strong>, and locates the work upstream.</p>
|
|
<h3>§5 Help</h3>
|
|
<p><code>--help</code> MUST work at every level of the tree, MUST exit 0, and MUST be generated from the same source as the command it documents.</p>
|
|
<p>The root help MUST carry the sections a UNIX user expects, in this order: <code>NAME</code>, <code>SYNOPSIS</code>, <code>DESCRIPTION</code>, <code>GLOBAL FLAGS</code>, <code>GROUPS</code>, <code>COMMANDS</code>.</p>
|
|
<p><strong>State: implemented.</strong> <code>--help</code> returns 0 at every depth, and the root renders that layout across 177 groups and 11 commands.</p>
|
|
<h3>§6 Man pages — REQUIRED, not implemented</h3>
|
|
<p>The CLI MUST install manual pages in section 1, generated from the same source as <code>--help</code>:</p>
|
|
<ul><li><code>man hanzo</code> — the root page: name, synopsis, description, global flags, groups.</li><li><code>man hanzo-<product></code> — one page per product, listing that product's commands.</li></ul>
|
|
<p>Section 1 is where a user command's manual page belongs by long-standing UNIX convention, and <code>man <tool>-<subcommand></code> is the established shape for a multi-command tool. Pages MUST be generated, never written, for the same reason the commands are.</p>
|
|
<p><strong>State: absent.</strong> There is no roff output and no man-page generator in the dependency graph. <code>src/commands/man.rs</code> renders help text to a terminal; it does not produce a manual page, and its name is misleading.</p>
|
|
<h3>§7 Shell completion — REQUIRED, not implemented</h3>
|
|
<p>The CLI MUST emit completion scripts for <strong>bash</strong>, <strong>zsh</strong> and <strong>fish</strong>:</p>
|
|
<p> hanzo completion bash hanzo completion zsh hanzo completion fish</p>
|
|
<p>Completion MUST cover the full command tree and each command's flags, and MUST be generated from the command tree rather than maintained as a script.</p>
|
|
<p><strong>State: absent.</strong> No completion generator appears in the manifest or the lockfile. The subcommand name is reserved and unimplemented.</p>
|
|
<h3>§8 Output — REQUIRED, not implemented</h3>
|
|
<p>Every command returning data MUST accept <code>--format</code> with exactly three values:</p>
|
|
<p>| Value | Meaning | |:------|:--------| | <code>table</code> | Human-readable columns. The default when stdout is a terminal. | | <code>json</code> | The response body, unmodified. The default when stdout is not a terminal. | | <code>yaml</code> | The same value, as YAML. |</p>
|
|
<p>Defaulting on whether stdout is a terminal is what lets one command be read by a person and piped to a program without a flag in either case.</p>
|
|
<p><strong>State: absent.</strong> Output is always pretty-printed JSON of the response envelope's <code>data</code> field, with no way to select a format; the whole binary declares only three command-line arguments. A <code>--raw</code> flag exists in name only, and its three references contradict each other: one hardcodes it false, one claims the flag exists, one states it does not. <code>--raw</code> MUST be deleted rather than repaired — <code>--format json</code> is the same capability with a defined meaning.</p>
|
|
<h3>§9 Context: <code>--org</code> and <code>--project</code> — REQUIRED, not implemented</h3>
|
|
<p>Hanzo is multi-tenant and every request is scoped to an organization. The CLI MUST accept:</p>
|
|
<ul><li><code>--org <slug></code> — the organization to act as, sent as the identity header the</li></ul>
|
|
<p> gateway expects (HIP-0111).</p>
|
|
<ul><li><code>--project <slug></code> — the project within it.</li></ul>
|
|
<p>Both MUST be settable persistently, resolving in the order <strong>flag → environment → config file → the identity's default</strong>.</p>
|
|
<p>The CLI MUST NOT invent an org it was not given. Where no org resolves and the operation requires one, it MUST fail with a message naming the flag rather than guessing.</p>
|
|
<p><strong>State: absent, and currently refused.</strong> No org flag exists, the org header is never sent, and a test asserts that passing <code>--org</code> to <code>auth show</code> is an error. The refusal is not the bug — sending an unvalidated org would be. The gap is that the flag does not exist to be validated.</p>
|
|
<h3>§10 Configuration and profiles</h3>
|
|
<p>Configuration MUST live in one file, <code>~/.config/hanzo/config.toml</code>, following the XDG base directory convention, and MUST hold no secret in plaintext.</p>
|
|
<p>The file MUST support <strong>named profiles</strong> — one identity, org, project and endpoint per profile — selected by <code>--profile <name></code> or <code>HANZO_PROFILE</code>. One person routinely holds more than one identity, and re-authenticating in order to switch is the failure this replaces.</p>
|
|
<p><strong>State: partial.</strong> The config file exists at the specified path. Named profiles do not; the closest mechanism is multi-identity selection via <code>hanzo auth use</code>, which switches the active identity but carries no org, project or endpoint with it.</p>
|
|
<h3>§11 Exit codes</h3>
|
|
<p>The CLI MUST distinguish failures by exit status, so a script can branch without parsing output. <code>0</code> means success and non-zero means failure, per the UNIX convention; beyond that:</p>
|
|
<p>| Code | Meaning | |---:|:--------| | 0 | Success | | 1 | Unspecified error | | 2 | Usage error — unknown command, missing or invalid flag | | 3 | Authentication required or expired | | 4 | Permission denied for the resolved identity and org | | 5 | The named resource does not exist | | 6 | The server failed (5xx) | | 7 | The server could not be reached |</p>
|
|
<p>A caller MUST be able to tell "not logged in" (3) from "not allowed" (4) from "not there" (5) without reading a message, because those three demand different responses from a script and all three are reported identically today.</p>
|
|
<p><strong>State: absent.</strong> Only 0 and 1 are produced, and no exit-code enumeration exists.</p>
|
|
<h3>§12 Authentication</h3>
|
|
<p><code>hanzo auth login</code> MUST authenticate against Hanzo IAM (HIP-0111) and MUST NOT implement any authentication of its own. Credentials MUST be stored outside the config file, in the platform credential store where one exists, and with file permissions restricting them to the user otherwise.</p>
|
|
<p>The subcommands MUST be: <code>login</code>, <code>logout</code>, <code>show</code>, <code>list</code>, <code>use</code>, <code>token</code>.</p>
|
|
<p><strong>State: implemented.</strong> All six exist, with <code>--brand</code> and <code>--provider</code> selection and <code>--token -</code> to read a token from stdin rather than a command line, where it would land in the shell history and the process table.</p>
|
|
<h3>§13 One name, one binary</h3>
|
|
<p><strong><code>hanzo</code> MUST name exactly one program.</strong> It does not today, and this is a correctness problem rather than a tidiness one:</p>
|
|
<ul><li>Two live crates both declare <code>name = "hanzo-cli"</code> with <code>[[bin]] name = "hanzo"</code></li></ul>
|
|
<p> — this repository at 1.9.x, and the inference engine's CLI at 1.3.x — on unrelated version lines.</p>
|
|
<ul><li>Four Python distributions claim the <code>hanzo</code> entry point, and in at least one</li></ul>
|
|
<p> environment the winner is not the intended one.</p>
|
|
<ul><li>On a machine measured for this HIP, the <code>hanzo</code> first on <code>PATH</code> was 19 patch</li></ul>
|
|
<p> versions behind the source tree.</p>
|
|
<p>Requirements:</p>
|
|
<ol><li>The crate published for this CLI MUST be <code>hanzo-cli</code>, and the binary it</li></ol>
|
|
<p> installs MUST be <code>hanzo</code>.</p>
|
|
<ol><li>No other crate MAY install a binary named <code>hanzo</code>. The inference engine's CLI</li></ol>
|
|
<p> MUST be renamed.</p>
|
|
<ol><li>Any document saying "the <code>hanzo-cli</code> crate" MUST disambiguate until rule 2</li></ol>
|
|
<p> holds.</p>
|
|
<p><strong>State: <code>hanzo-cli</code> is not published on crates.io.</strong> Any documented <code>cargo install hanzo-cli</code> instruction therefore fails, and MUST be removed or corrected wherever it appears until publication.</p>
|
|
<h3>§14 Conformance</h3>
|
|
<p>An implementation conforms when all of the following hold. Each is a command that either succeeds or does not.</p>
|
|
<ol><li><code>hanzo --help</code> exits 0 and prints <code>NAME</code>, <code>SYNOPSIS</code>, <code>DESCRIPTION</code>,</li></ol>
|
|
<p> <code>GLOBAL FLAGS</code>, <code>GROUPS</code>, <code>COMMANDS</code>.</p>
|
|
<ol><li><code>--help</code> exits 0 at every depth of the tree.</li><li>The drift gate reports <strong>0 absent</strong> and <strong>0 unfalsifiable</strong>.</li><li>Untyped <code>--data</code> operations number <strong>0</strong>.</li><li><code>man hanzo</code> and <code>man hanzo-<product></code> resolve for every product.</li><li><code>hanzo completion {bash,zsh,fish}</code> each emit a script the shell loads without</li></ol>
|
|
<p> error.</p>
|
|
<ol><li><code>--format {table,json,yaml}</code> is accepted by every data-returning command, and</li></ol>
|
|
<p> the default flips on whether stdout is a terminal.</p>
|
|
<ol><li><code>--org</code> and <code>--project</code> resolve flag → environment → config → identity default.</li><li>Named profiles select identity, org, project and endpoint together.</li><li>The exit codes of §11 are produced and documented.</li><li><code>hanzo</code> on <code>PATH</code> resolves to exactly one program.</li></ol>
|
|
<p><strong>Measured on 2026-08-04: 1, 2 and 12 pass. 3 through 11 do not.</strong></p>
|
|
<h2>Rationale</h2>
|
|
<p><strong>Why generation rather than hand-written commands.</strong> With 2,341 operations, a hand-written CLI is a subset chosen by whoever had time, and the choice is invisible to the user, who cannot tell "not supported" from "not written yet". A projection has no such state.</p>
|
|
<p><strong>Why maintainer-time generation.</strong> Generating at build time makes the build depend on a network fetch and lets two builds of one commit differ. Generating at run time moves that failure into the user's terminal. Generating at maintainer time, committed and pinned by digest, puts the change in a diff where it can be reviewed.</p>
|
|
<p><strong>Why the untyped-body fix is upstream.</strong> Typing 469 request bodies inside the CLI would create a second, competing description of each body. The first time one changed upstream the CLI would be confidently wrong — precisely the failure the generation chain removes. One description, in the document, projected everywhere.</p>
|
|
<p><strong>Why so much of this document describes things that do not exist.</strong> Because they do not, and a specification that quietly described only what was already built would be a summary rather than a standard. The gaps carry counts so that progress against them is countable.</p>
|
|
<h2>Security Considerations</h2>
|
|
<ul><li><strong>Tokens.</strong> Credentials MUST NOT be written to the config file in plaintext and</li></ul>
|
|
<p> MUST NOT be passed as command-line arguments — the process table and the shell history are both readable. <code>--token -</code> exists so a token can arrive on stdin.</p>
|
|
<ul><li><strong>Org scoping.</strong> <code>--org</code> selects the tenant a request claims; it is not a grant.</li></ul>
|
|
<p> Authorization is the gateway's and IAM's decision (HIP-0111), and the CLI MUST NOT treat a locally configured org as evidence of anything.</p>
|
|
<ul><li><strong>The pin is a supply-chain control.</strong> <code>.spec-lock</code> carries a digest, so a</li></ul>
|
|
<p> regeneration against a substituted document fails rather than silently producing a command tree that points somewhere else.</p>
|
|
<ul><li><strong>A stale binary is a security property, not only an annoyance.</strong> With <code>hanzo</code></li></ul>
|
|
<p> ambiguous across crates and package managers, a user may be running a build far behind the one that fixed a defect. §13 is the mitigation.</p>
|
|
<h2>References</h2>
|
|
<ul><li>HIP-0040 — Multi-Language SDK Standard</li><li>HIP-0111 — IAM Authentication Standard</li><li>HIP-0119 — Hanzo Service Conventions</li><li>HIP-0128 — Resource Surface Standard</li><li>HIP-0135 — What Is Public</li><li>RFC 2119 — Key words for use in RFCs to Indicate Requirement Levels</li></ul>
|
|
<h2>Copyright</h2>
|
|
<p>Released under CC0 1.0 Universal Public Domain Dedication.</p>
|
|
<footer>
|
|
<div class="fmap">
|
|
<div><b>Build</b>
|
|
<a href="https://hanzo.app">hanzo.app</a> app builder
|
|
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
|
|
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
|
|
<div><b>Run</b>
|
|
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
|
|
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
|
|
<div><b>Account</b>
|
|
<a href="https://hanzo.id">hanzo.id</a> sign in
|
|
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
|
|
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
|
|
<div><b>Company</b>
|
|
<a href="https://hanzo.ai">hanzo.ai</a> canonical
|
|
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
|
|
</div>
|
|
<div class="fend"><a href="/hip-0041.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
|
</footer>
|
|
</div></body></html> |