CLI Reference
Huitzo CLI Reference¶
The huitzo CLI is your primary tool for developing, testing, and managing Intelligence Packs and Dashboards. See CLI Overview for installation and design philosophy.
Installation¶
# Using uv (recommended)
uv pip install huitzo-cli
# Using pip
pip install huitzo-cli
# Verify installation
huitzo --version
Global Options¶
These options are available for all commands:
| Option | Short | Description |
|---|---|---|
--help |
-h |
Show help message |
--version |
-V |
Show version |
--verbose |
-v |
Enable verbose output |
--quiet |
-q |
Suppress non-error output |
--config |
-c |
Path to config file |
--output |
-o |
Output format (text, json). JSON mode emits a structured envelope |
--non-interactive |
Suppress prompts, spinners, and confirmations. Implied by --output json |
Styling. The CLI writes colour and other terminal styling only to a real terminal. Help, error and command output that is piped or redirected to a file is plain text, whatever FORCE_COLOR says. Setting NO_COLOR to a non-empty value removes all styling (colour, bold, dim, underline) on a terminal too.
Project Commands¶
The huitzo project ... group is scaffolding only — three commands that set up a fullstack Project directory holding a Pack and (optionally) a Dashboard. Lifecycle work (dev, validate, build, publish, test) uses the existing Pack and Dashboard CLI groups, run from inside pack/ or dashboard/.
Canonical references: Intelligence Projects, Project Layout, Project Authoring.
huitzo project init¶
Scaffold a new Project directory.
# pseudocode
huitzo project init [OPTIONS] [NAME]
| Argument | Required | Description |
|---|---|---|
NAME |
No | Project directory name (prompts if not provided). kebab-case. |
| Option | Default | Description |
|---|---|---|
--with-dashboard |
— | Scaffold dashboard/ (skips the interactive prompt) |
--no-dashboard |
— | Do not scaffold dashboard/ (skips the interactive prompt) |
--template |
default |
Project template (default, scheduled, mcp) |
--non-interactive |
(implied by --output json) |
Suppress prompts. Requires one of --with-dashboard / --no-dashboard. |
Behavior:
- Validates the name (kebab-case, 3-50 chars, no collision with existing directory).
- Creates the Project directory.
- Scaffolds
pack/viahuitzo pack new. - If neither
--with-dashboardnor--no-dashboardwas passed, prompts: "Add a Dashboard to this Project? (y/N)". Ony, scaffoldsdashboard/viahuitzo dashboard new; onNor empty input, skips the Dashboard. - Seeds
docs/with placeholderspec.md,architecture.md,runbook.md— each with a traceability header stub. - Seeds
.claude/with Project-scoped rules and settings. - Writes
README.md.
No Project-level manifest is written. The Pack and Dashboard manifests inside the subdirectories are the only manifests involved.
Exit codes: 0 success, 3 name validation error, 1 other errors.
huitzo project add-pack¶
Populate the pack/ subdirectory of an existing Project. Used when a Project was initialized Dashboard-only.
# pseudocode
huitzo project add-pack [OPTIONS]
Run from the Project root.
| Option | Default | Description |
|---|---|---|
--template |
basic |
Pack template (same values as huitzo pack new --template) |
--namespace |
(from Project directory name) | Pack namespace |
Errors:
| Error | Cause |
|---|---|
Pack already exists |
pack/huitzo.yaml is already present |
Not a Project directory |
Current directory is not a Project (no pack/ or dashboard/ subdirectory found) |
Exit codes: 0, 3, 1.
huitzo project add-dashboard¶
Add a dashboard/ subdirectory to a Project that started pack-only.
# pseudocode
huitzo project add-dashboard [OPTIONS]
Run from the Project root.
| Option | Default | Description |
|---|---|---|
--template |
basic |
Dashboard template (same values as huitzo dashboard new --template) |
Errors: same shape as add-pack (Dashboard already exists, Not a Project directory).
Exit codes: 0, 3, 1.
Commands¶
huitzo pack new¶
Scaffold a new Intelligence Pack project.
huitzo pack new [OPTIONS] [NAME]
Arguments:
| Argument | Required | Description |
|---|---|---|
NAME |
No | Pack name (prompts if not provided) |
Options:
| Option | Default | Description |
|---|---|---|
--template |
basic |
Template to use (basic, advanced, full) |
--namespace |
(from name) | Pack namespace |
--author |
(from git) | Author name |
--python |
3.11 |
Minimum Python version |
--pack-version |
0.0.0 |
The pack's first version, written to huitzo.yaml (pack.version) and to the package's __version__. Must be MAJOR.MINOR.PATCH with ASCII digits only (at most 20 characters); anything else exits with status 3 (validation). Studio's runner passes the version the Hub chose (pack-identity delivery). Not --version, which is the root option |
Pack-name validation rules¶
A pack name is the human-readable slug for the project on disk and the Python module name it generates. The CLI validates names with a single rule set; the same rules apply at three points so an invalid name is caught before it can wedge downstream tools:
| When | Where |
|---|---|
| Interactive prompt | huitzo pack new re-prompts on rejection rather than aborting |
| Argument parsing | huitzo pack new <NAME> exits with status 3 (validation) on rejection |
pack validate |
A hand-edited huitzo.yaml (the pack.name field) is rejected before install |
The rules:
| Rule | Why |
|---|---|
| 3–40 characters | Module names beyond 40 chars are unwieldy; below 3 is too ambiguous |
| Starts with a lowercase letter | A leading digit produces an invalid Python module identifier — the CLI substitutes hyphens for underscores when generating the module name (name_to_module), but it cannot rewrite a leading digit |
| Ends with a lowercase letter or digit | A trailing hyphen becomes a trailing underscore after name_to_module substitution (my-pack- → my_pack_), which is valid Python but visually ambiguous and breaks PyPI normalisation |
Inner characters from [a-z0-9-] only |
Pack names and namespace slugs share the same hyphen-delimited format; mixing in underscores creates an inconsistent identifier shape across the platform |
| Not a reserved word | The blocklist prevents shadowing first-party tooling (e.g., a pack named huitzo would mask the CLI itself on the import path) |
The reserved-name blocklist (case-insensitive after lowercasing):
# pseudocode — the canonical list lives in tools/cli's validation module
huitzo, core, system, admin, test, dev, api, www
Validation errors are surfaced as PackNameError with a human-readable
rule label (e.g., "starts with a letter", "reserved name"). The exit-code
contract for the non-interactive path is the standard VALIDATION (3)
defined in Exit Codes. See
tools/cli for the implementation.
Examples:
# Interactive mode — prompts re-prompt on validation failure
huitzo pack new
# Quick start with name (exits with code 3 if name is invalid)
huitzo pack new my-pack
# Full customization
huitzo pack new my-pack --template advanced --namespace mycompany --author "John Doe"
# These all fail validation:
# huitzo pack new My_Pack # uppercase + underscore
# huitzo pack new 1pack # leading digit
# huitzo pack new my-pack- # trailing hyphen
# huitzo pack new huitzo # reserved name
Generated Structure:
my-pack/
├── pyproject.toml
├── huitzo.yaml
├── README.md
├── src/
│ └── my_pack/
│ ├── __init__.py
│ └── commands/
│ ├── __init__.py
│ └── hello.py
└── tests/
├── __init__.py
└── test_hello.py
huitzo pack dev¶
Start a development session for testing your pack. This starts a local proxy that forwards requests to Huitzo's cloud sandbox where your pack code executes.
Important: Requires authentication. Run
huitzo loginfirst.
huitzo pack dev [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--port |
8080 |
Local proxy port |
--host |
localhost |
Host to bind to |
--persist |
false |
Keep sandbox alive after Ctrl+C |
--watch |
true |
Auto-upload on file changes |
--log-level |
debug |
Logging level |
--no-docs |
false |
Disable local docs server |
--docs-port |
8124 |
Local docs server port |
Examples:
# Start with defaults
huitzo pack dev
# Custom proxy port
huitzo pack dev --port 9000
# Keep sandbox alive for debugging
huitzo pack dev --persist
# Network accessible (for testing from other devices)
huitzo pack dev --host 0.0.0.0 --port 8080
# Without docs server (faster startup)
huitzo pack dev --no-docs
Output:
🔐 Authenticating... OK ([email protected])
📦 Packaging pack... 3 commands found
☁️ Uploading to sandbox... done
📚 Starting docs server... done
🚀 Development session started
Proxy: http://localhost:8080
API docs: http://localhost:8080/docs
Huitzo docs: http://localhost:8124
Commands:
- POST /api/v1/commands/mypack/command-1
- POST /api/v1/commands/mypack/command-2
- POST /api/v1/commands/mypack/command-3
📊 Quota: 847/1000 executions this month
⌨️ Press Ctrl+C to stop
[12:34:56] Watching for file changes...
[12:35:01] POST mypack/command-1 → 200 OK (142ms)
[12:35:15] File changed: commands/example.py
[12:35:16] Re-uploading... done
How It Works:
- CLI authenticates with Huitzo using your JWT token
- Pack code is packaged and uploaded to a cloud sandbox
- Local proxy starts on your machine (
localhost:8080) - Docs server clones/updates from
github.com/Huitzo-Inc/docsand starts (localhost:8124) - Requests to the proxy are forwarded to the sandbox
- File changes trigger automatic re-upload
Shutdown Contract:
huitzo pack dev honours a single, deterministic shutdown contract whether it ends locally (Ctrl+C) or remotely (Hub admin kills the session). The contract is enforced client-side by the CLI.
| Trigger | Default REPL (--repl) |
Headless (--no-repl) |
|---|---|---|
| 1× Ctrl+C while a command line is being edited | Clears the current input line. Session stays up. | Exits the process. |
| 2× Ctrl+C within 2 seconds | Exits the process cleanly. | n/a (first Ctrl+C already exits) |
exit / quit / Ctrl+D |
Exits the process cleanly. | n/a |
| Hub clicks Kill session | Heartbeat detects 410/404 → REPL unblocks the prompt and exits cleanly. No Ctrl+C required. | Heartbeat sets the freeze flag → loop wakes and exits cleanly. |
| Token refresh fails during heartbeat | Same as Hub kill — REPL exits cleanly. | Same as Hub kill — loop exits cleanly. |
Notes:
- The tiered Ctrl+C is REPL-specific.
prompt_toolkitowns SIGINT while the prompt is mounted, so the first Ctrl+C is delivered to the prompt as "clear line". The session tracks the timestamp of the previous Ctrl+C; if a second one arrives within the 2 s window, it sets the running flag to false and unwinds. - Server-driven kill goes through
freeze_event. The REPL races prompt input againstfreeze_event.wait()withasyncio.wait(..., return_when=FIRST_COMPLETED), so a kill from Hub interrupts an idle prompt without any user keystroke. - There is no self-
SIGINTescalation. The CLI never sends a signal to its own PID to force exit — that pattern conflicted withprompt_toolkit's signal handler and produced a stuck terminal after a server-driven kill (issue #541). sandbox.stop()andheartbeat.stop()always run in afinallyblock, so the sandbox HTTP server and heartbeat thread are torn down on every exit path.
Local Docs Server:
The docs server provides:
- Web UI: Browse docs at http://localhost:8124
- MCP endpoint: http://localhost:8124/mcp for AI agent integration
- Always current: Pulls latest docs from official repo on startup
Endpoints Available (via proxy):
GET /health- Health checkGET /docs- OpenAPI documentationGET /api/v1/commands- List commandsPOST /api/v1/commands/{namespace}/{name}- Execute command
Rate Limits:
| Metric | Limit | Notes |
|---|---|---|
| Executions | 1000/month | Hard limit, resets monthly |
| Concurrent sessions | 1 | Soft limit (warns on second) |
| Storage per sandbox | 100 MB | Per-session limit |
Note: You don't need PostgreSQL, Redis, or any other infrastructure locally. The cloud sandbox provides isolated storage, mock LLM services, and the full execution environment.
huitzo pack test¶
Run tests for your pack.
huitzo pack test [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--coverage |
false |
Generate coverage report |
--verbose / -v |
false |
Verbose test output |
--parallel / -p |
false |
Run tests in parallel |
--filter / -k |
- | Filter tests by name pattern |
Test environment: the command always runs the suite through uv against
the pack's own environment (synced from huitzo.yaml first) so the pack's
runtime and dev dependencies are available — async command tests, which
every real pack has, need them. When the manifest declares dev_dependencies
the tests run under the dev extra; otherwise the runner falls back to
providing pytest + pytest-asyncio so async tests still work. --coverage
and --parallel layer their plugins on top. If uv is unavailable, an
actionable error names the exact command to run instead.
Examples:
# Run all tests
huitzo pack test
# Run with coverage
huitzo pack test --coverage
# Filter by name
huitzo pack test --filter "test_greet"
# Verbose, parallel run
huitzo pack test --verbose --parallel
Output:
Running tests for my-pack...
tests/test_hello.py::test_hello_basic PASSED
tests/test_hello.py::test_hello_with_name PASSED
tests/test_hello.py::test_hello_error PASSED
========================= 3 passed in 0.42s =========================
Note: Queue selection is not inferred from test timings. The runtime resolves an omitted or auto queue from the command's declared timeout. See Pack Manifest - Queue Resolution.
huitzo pack validate¶
Validate pack structure and manifest.
huitzo pack validate [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--path |
. |
Path to the pack root |
--strict |
false |
Treat warnings as errors, and check that each pipeline stage's args model fits the previous stage's return model |
--check-capabilities / --no-check-capabilities |
off | Cross-check the manifest's extensions: against the active deployment's /api/v1/capabilities. Off by default so validate works offline; huitzo pack publish always runs the check |
--json |
false |
Print one JSON object to stdout and nothing else: {"ok": bool, "errors": [...], "warnings": [...]} |
Examples:
# Validate current directory
huitzo pack validate
# Validate specific path
huitzo pack validate --path ./my-pack
# Strict mode
huitzo pack validate --strict
# Machine-readable findings
huitzo pack validate --json
Read-only. validate writes no file, in any mode. It does not regenerate pyproject.toml: one that is missing, or older than huitzo.yaml, is a finding that names the command to run.
| State | Finding | Plain validate |
--strict |
|---|---|---|---|
pyproject.toml older than huitzo.yaml |
pyproject.toml is out of sync with huitzo.yaml. Run 'huitzo pack sync' to regenerate. |
Warning | Error |
pyproject.toml missing |
pyproject.toml not found, plus the finding above |
Error | Error |
Run huitzo pack sync to regenerate the file, then validate again. huitzo pack build, huitzo pack dev and huitzo pack test regenerate a stale pyproject.toml themselves.
pyproject.toml read. validate opens pyproject.toml without following links and caps it at 256 KiB. A symlink to an existing file, a hard-linked file, a FIFO or device or an oversized file is reported as Could not read pyproject.toml (code PYPROJECT-UNREADABLE in Studio's manifest gate). A dangling link reports pyproject.toml not found (code PYPROJECT-MISSING). Replace the link with a regular file. On native Windows, which has no no-follow open, the read falls back to a plain open with the same file-type, link-count and size checks.
Studio's manifest gate. In a Studio build, the runner reads huitzo.yaml first through a guarded reader; only a manifest that reader accepts reaches the SDK loader validate uses. A manifest it refuses fails the gate with code MANIFEST-REFUSED, after any NAMESPACE-MISMATCH or POLICY-MISMATCH. When the Hub delivered a pack name and version (pack-identity delivery), the gate also fails with PACK-NAME-MISMATCH when pack.name differs and VERSION-MISMATCH when pack.version differs or is missing, reported right after NAMESPACE-MISMATCH. Refusal reasons: not a regular file or a followed link (unsafe-path), a hard link, larger than 64 KiB, not UTF-8, nesting deeper than 64, a YAML alias, merge key (<<) or explicit tag, more than 50,000 YAML events, an integer of magnitude 2^64 or more, a file that is unreadable or not valid YAML, or a document that is not a mapping. An absent manifest is still MANIFEST-MISSING. The dashboard manifest (dashboard/huitzo-dashboard.yaml) goes through the same reader in the dashboard stage and in publish; a refusal there fails the dashboard stage as scaffold_failed, or the publish as manifest_invalid, never the manifest gate. A huitzo.yaml the reader refuses in the dashboard stage fails that stage as dashboard_failed. See the runner threat model, G2.
Hosted-runtime check. A published pack runs in the hosted runtime, where each command executes in an isolated child process. A few SDK calls work locally (the SDK's in-memory test backends implement them) but are not available there, so a pack can pass its own tests and still fail on its first hosted write. validate scans every .py file under src/ and reports each use as an error in plain and --strict mode, naming the code, file and line, and what to do instead:
| Code | Call | In the hosted runtime | Do instead |
|---|---|---|---|
RUNTIME-DB-TXN |
ctx.db.transaction() |
Raises NotImplementedError |
Run each statement with ctx.db.execute(), or make the change one SQL statement |
RUNTIME-INTEGRATIONS |
ctx.integrations |
Always an empty registry; any attribute raises AttributeError |
Use the matching ctx.* service (ctx.http, ctx.db, ctx.llm, ...) |
The scan is static and has blind spots. It follows a function parameter annotated Context (or the second parameter of an @command function), attribute chains from it, and plain aliases (storage = ctx.storage), including in nested functions. It does not follow a context passed to an unannotated helper, stored on an object (self.ctx), unpacked from a tuple, or reached through getattr, so a clean result is not proof that a pack is hosted-safe. A file that does not parse or is over 1 MiB is skipped with a warning (hosted-runtime scan skipped). The code table lives in tools/cli/src/huitzo_cli/hosted_runtime.py and is kept in step with the backend's isolation proxies; see the CLI README, Hosted-runtime calls, for the full rules. Studio's build manifest gate runs the same check and reports the code, e.g. 1 manifest violation, RUNTIME-DB-TXN.
Pipeline checks. When the manifest has a pipelines: block, validate checks each stage against the pack's own commands:
| Check | Plain validate |
--strict |
|---|---|---|
An intra-pack stage reference (namespace:command) names a command the pack declares |
Warning | Error |
| Each stage's args model fits the previous stage's return model | Not checked | Error |
A model-provider host in services.http.allowed_domains or policy.data_scope.external_domains (model access goes through ctx.llm) |
Warning | Error |
A reference to another pack's command, the link into a parallel block and the link out of a streaming stage are checked only when the pipeline runs. See Authoring for the Run View.
Output:
Validation: PASSED
Warnings:
README.md not found
A failed run prints Validation: FAILED and an Errors: list, and exits 1. A manifest the loader rejects is one huitzo.yaml <field>: <message> entry per field.
huitzo pack build¶
Build a distributable pack package.
huitzo pack build [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--output |
./dist |
Output directory |
--format |
wheel |
Output format (wheel, tar.gz, both) |
--sign |
false |
Sign the package |
Examples:
# Build wheel
huitzo pack build
# Build to specific directory
huitzo pack build --output ./packages
# Build signed package
huitzo pack build --sign
Output:
Building my-pack...
📦 Created: dist/my_pack-1.0.0-py3-none-any.whl
Size: 12.4 KB
SHA256: abc123...
Build completed successfully!
Note: The build embeds no execution statistics. Each command's queue comes from its declaration, or — when omitted or auto — is resolved at runtime from its declared timeout. See Pack Manifest - Queue Resolution.
Note: pyproject.toml is automatically regenerated from huitzo.yaml before building if it is out of date.
huitzo pack add-command¶
Scaffold a new command in an existing pack: the command module, its test, and the huitzo.yaml entry.
huitzo pack add-command [OPTIONS] [NAME]
Arguments:
| Argument | Required | Default | Description |
|---|---|---|---|
NAME |
No | (prompted) | Command name (lowercase, hyphens OK) |
Options:
| Option | Default | Description |
|---|---|---|
--description / -d |
(prompted) | Command description |
--permissions / -p |
(prompted) | Comma-separated permissions to record for the pack |
--timeout / -t |
60 |
Timeout in seconds |
--queue / -q |
default |
Queue: fast, medium, long, default |
--retries / -r |
3 |
Number of retries |
--path |
(cwd) | Path to pack root |
Pass an explicit empty value (-p "") to skip the permissions prompt in non-interactive use; omitting the flag entirely prompts.
Examples:
# Scaffold a command with no permissions
huitzo pack add-command analyze-data -d "Analyze data" -p ""
# Grant a platform capability
huitzo pack add-command summarize -d "Summarize text" -p llm:complete
# Grant permission to run another pack's commands from a pipeline
huitzo pack add-command extract -d "Extract fields" -p commands:execute:@acme/claims
Where permissions land: --permissions records pack-level permissions (ADR-003 D4) — the top-level permissions: list plus policy.allowed_actions, which the Policy Card requires to be a superset. There is no per-command permission list; commands[].permissions is not part of the v2 schema and a manifest carrying one fails to load.
Values are validated against the manifest vocabulary before anything is written: the fixed tokens, or the parameterized commands:execute:<@scope/pack> grant. A typo is rejected with the valid token set; a malformed grant is rejected with the target-identity grammar it failed.
When the manifest cannot be edited safely, the command still scaffolds the files and still exits 0, but it leaves huitzo.yaml untouched and prints the entries to add by hand, grouped under each key. This happens when a permissions block is missing entirely, or is present in a shape the editor will not risk rewriting (flow style, unexpected indentation). Only what a given list is actually missing is listed — a token already present in one of the two is not re-suggested for that list, because adding it twice makes the manifest fail to load.
Non-interactive callers must read the result rather than the output: in JSON mode the human-readable warning is suppressed, and the dropped entries appear in the envelope under permissions_not_recorded (empty on full success). A caller that only checks ok will not notice a grant was skipped.
Output:
Adding command to pack "my-pack" (@my-ns)
Creating files...
Created src/my_pack/commands/extract.py
Updated huitzo.yaml
Created tests/test_extract.py
Done! Command "@my-ns/my-pack/extract" added.
huitzo pack plan¶
Plan an Intelligence Pack from a plain-language intent: create an Intent and CLARIFY-score it against the Studio Hub. Three verbs share one local cache at ~/.huitzo/studio_intents/ (one JSON file per intent id, plus a latest marker). status reads live from the Hub's GET /api/v1/studio/intents/{id} (S205) whenever a client can be constructed, refreshing the cache on every successful read and falling back to the cache when the Hub is unreachable; answer still drives off the cached intent, since it always re-POSTs answers against the cached intent id.
huitzo pack plan "<intent>"
huitzo pack plan status [INTENT_ID]
huitzo pack plan answer QID ANSWER [OPTIONS]
huitzo pack plan "<intent>"
| Argument | Required | Description |
|---|---|---|
INTENT |
Yes | Plain-language description of the pack to build |
# pseudocode
intent = create_intent(text, source="cli")
if non_interactive:
save_to_cache(intent)
print_deferral_summary(intent.open_questions) # if any
exit(0)
while intent.status == "draft" and intent.open_questions:
answers = [guarded_prompt(q) for q in intent.open_questions]
intent = record_answers(intent.id, answers)
save_to_cache(intent)
Interactively, each server-reported open question is asked via a guarded prompt and answered immediately, looping until the Hub reports no more open questions. Non-interactively, prompting is never attempted — there is no server-side auto-resolve flag to send — so the command instead prints a deferral summary of the open questions and exits 0 with the intent left in its reported status (typically draft).
huitzo pack plan status [INTENT_ID]
| Argument | Required | Default | Description |
|---|---|---|---|
INTENT_ID |
No | Most recently planned intent | Intent id to inspect |
Renders the intent's id, status, confidence, and any open questions — live from the Hub when reachable (labeled live, cache refreshed), otherwise from the cache (labeled cached — Hub unreachable). A live 404 with a cached copy renders the cache labeled stale; a live 404 with no cache, or no live read and no cache, exits 3 (not_found) — run pack plan first.
huitzo pack plan answer QID ANSWER
| Argument | Required | Description |
|---|---|---|
QID |
Yes | 0-based index into the cached intent's open questions (see pack plan status) |
ANSWER |
Yes | Answer text |
| Option | Default | Description |
|---|---|---|
--intent-id |
Most recently planned intent | Intent id to answer against |
Submits one answer for the question at QID, re-scores the intent against the Hub, and updates the cache. Exits 3 (not_found) if no cached intent exists, or 3 (validation_error) if QID is out of range for the cached intent's open questions.
Examples:
# Start planning (interactive: prompts for each clarifying question)
huitzo pack plan "a pack that summarizes support tickets daily"
# Start planning headlessly — deferral summary, no prompting, exits 0
huitzo pack plan "a pack that summarizes support tickets daily" --non-interactive
# Check the last-known state
huitzo pack plan status
# Answer question 0 against a specific intent
huitzo pack plan answer 0 "Ticket source is Zendesk" --intent-id intent_abc123
huitzo pack plan decide / decompose¶
Two more verbs on the same plan group, driving the Hub's DECIDE/DECOMPOSE surface for an existing build_plans row. Unlike the Intent flow above, PLAN_ID is always an explicit argument — there is no local cache for these. Errors (auth, network, server, or validation failures — including a 503 LLM/policy refusal) surface via the CLI's standard error envelope and matching exit code.
huitzo pack plan decide PLAN_ID
huitzo pack plan decompose PLAN_ID
huitzo pack plan decide PLAN_ID
Runs DECIDE: capability-diffs the plan's approved Spec against the target manifest. A non-empty diff drafts a Decision; an empty diff means no decision is needed.
# pseudocode
result = client.decide(plan_id) # always 200
print_capability_diff(result.capability_diff)
if result.decision is None:
print("No capability diff — no decision needed.")
else:
render_decision(result.decision) # context, question, options, choice, ruling, confidence
huitzo pack plan decompose PLAN_ID
Runs DECOMPOSE: sizes the plan's scope manifest into Tasks once the distinct-path-glob count exceeds the DECOMPOSE threshold. The response always distinguishes "fired" from "not fired" via a fired field rather than a different status code — a plan small enough to build as one task returns fired: false with an empty task list, not an error.
Examples:
huitzo pack plan decide plan_abc123
huitzo pack plan decompose plan_abc123
See also: docs/cli/agent-integration.md#non-interactive-mode.
huitzo pack plan decisions / tasks / accept-decision¶
Three more verbs on the plan group, rounding out the DECIDE/DECOMPOSE surface from the previous section.
huitzo pack plan decisions PLAN_ID
huitzo pack plan tasks PLAN_ID
huitzo pack plan accept-decision DECISION_ID [OPTIONS]
huitzo pack plan decisions PLAN_ID / huitzo pack plan tasks PLAN_ID
List every Decision, or every Task, recorded against the plan, rendering the same shapes as decide/decompose (a Task's budget is always labeled advisory — it never gates the CLI's own exit behavior).
huitzo pack plan accept-decision DECISION_ID
| Option | Default | Description |
|---|---|---|
--note |
none | Reviewer note; becomes the accepted ruling (defaults to the choice) |
The human review gate for a proposed Decision. A Decision that is not currently proposed (already accepted, or raced by a concurrent accept) returns a 409, surfaced as a validation-class CLI error.
Examples:
huitzo pack plan tasks plan_abc123
huitzo pack plan accept-decision decision_xyz --note "Approved: use existing webhook capability"
See also: docs/cli/agent-integration.md#non-interactive-mode.
huitzo pack evaluate¶
Runs the four deterministic quality gates locally, then — advisory, gates-green-only — the Tier-3 intent-acceptance judge. This is a local mirror of the runner's own EVALUATE stage (same underlying evaluation logic the daemon drives after BUILD), exposed as a manual, terminal-facing entry point.
huitzo pack evaluate [OPTIONS]
| Option | Default | Description |
|---|---|---|
--path |
Current directory | Path to pack root |
--spec-id |
None | Approved Spec id to anchor this evaluation to (Hub persistence) |
--spec-file |
None | Path to the approved Spec's markdown text, fed to the Tier-3 judge |
--diff-file |
None | Path to a diff to feed the Tier-3 judge (e.g. git diff > file). At most 95,800 characters are read (200 under the judge's 96,000-character diff budget); a longer file ends in an explicit [truncated: --diff-file holds N bytes; only its first M characters are shown] marker. The judge also receives the pack's static command inventory |
--build-run-id |
None | An existing build run id to anchor this evaluation to (Hub persistence) |
Two distinct verdicts, never conflated. The deterministic gate verdict (traceability / pytest / ruff / mypy, all-or-nothing) and the Tier-3 intent_acceptance verdict (pass / fail / unknown) have different failure semantics:
# pseudocode
gate_results = run_gates(workspace)
all_green = all(g.passed for g in gate_results)
# Always called — the cost short-circuit lives INSIDE judge_intent_acceptance,
# which returns NOT_RUN without invoking the judge when any gate is red.
# There is no caller-side branch on all_green before this call.
verdict = judge_intent_acceptance(gate_results, diff, spec)
render(gate_results, verdict)
exit(0 if all_green else 1) # verdict itself never changes the exit code
- A red gate verdict fails the command (exit
1), mirroringpack validate. - A non-
passTier-3 verdict never fails the command — it is advisory-only.unknownis a legitimate, non-blocking outcome in every mode; the CLI never auto-resolves it to pass or fail. - Cost short-circuit: any failed deterministic gate means the Tier-3 judge is never invoked at all.
Persistence and anchors. With no --spec-id or --build-run-id, the evaluation still runs locally (gates, then Tier-3 if green) but is explicitly not persisted to the Hub — the output notes "not persisted (no anchor)" rather than guessing an anchor. Passing either option persists the gate verdicts and intent-acceptance result against that anchor.
Headless behavior. In non-interactive mode, an unknown Tier-3 verdict (when Tier-3 actually ran) is additionally surfaced as an explicit Deferral in the output — printed, and included in the JSON payload's deferrals field — rather than silently folded into either verdict.
Examples:
# Local-only: gates + Tier-3, not persisted
huitzo pack evaluate
# Anchor to an approved Spec and feed it + a diff to the Tier-3 judge
huitzo pack evaluate --spec-id spec_abc123 --spec-file SPEC.md --diff-file changes.diff
See also: docs/architecture/studio-evaluation.md#pack-evaluate-verb, docs/architecture/studio-evaluation.md#tier3-intent-acceptance.
huitzo pack sync¶
Regenerate pyproject.toml from huitzo.yaml.
huitzo pack sync [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--path |
. |
Path to pack root directory |
Examples:
# Sync pyproject.toml from huitzo.yaml
huitzo pack sync
# Sync a pack in another directory
huitzo pack sync --path ./my-pack
Output:
Regenerated pyproject.toml
pyproject.toml is auto-generated from huitzo.yaml on huitzo pack build, huitzo pack dev and huitzo pack test. Use huitzo pack sync to regenerate it manually after editing huitzo.yaml. huitzo pack validate never writes it: it reports a stale file and names this command.
huitzo pack publish¶
Publish pack to a registry.
huitzo pack publish [OPTIONS] [PACKAGE]
Run from the pack root. The target backend is derived from your api_url
config (set via huitzo login / huitzo config); authentication uses your
stored session. By default publish clean-builds the wheel from current
source so the uploaded artifact always matches HEAD (a pack version is
immutable once registered, so a stale wheel cannot be corrected without a
delete).
Options:
| Option | Default | Description |
|---|---|---|
--no-build |
false |
Break-glass: publish the existing dist/ wheel as-is instead of clean-building. Warns that wheel/source parity is not guaranteed. |
--skip-capability-check |
false |
Skip the pre-publish extension-capability check against the backend. |
Examples:
# Clean-build from source and publish (default)
huitzo pack publish
# Publish the existing dist/ wheel without rebuilding (you own parity)
huitzo pack publish --no-build
Output:
Building [email protected] from source...
Registering pack @scope/my-pack...
Pack created
✅ Published successfully!
huitzo pack delete¶
Delete a pack from the registry: the pack and all its versions, commands, and access grants. Requires developer mode and an owner or admin role in the owning tenant.
huitzo pack delete <PACK> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
PACK |
Yes | Pack name to delete |
Options:
| Flag | Description |
|---|---|
--force / -f |
Skip confirmation prompt |
--output json |
Machine-readable JSON output (global flag) |
Examples:
# Interactive (prompts for confirmation)
huitzo pack delete financial-analysis
# Non-interactive (CI/automation)
huitzo pack delete financial-analysis --force --output json
Output:
Deleting financial-analysis...
✅ Removed [email protected]
Errors:
| Error | Cause |
|---|---|
| "Developer mode required" | User account is not in developer mode |
| "Pack not found" | No pack with that name owned by the current tenant |
| "Only pack owner can delete packs" | Pack belongs to a different tenant |
| "Only a tenant owner or admin can delete packs" | Your role in the owning tenant is member, or you are signed in with an API key |
huitzo pack list¶
List the packs in the registry that are visible to you. Requires huitzo login.
huitzo pack list
The command has no options of its own. JSON output uses the global --output json flag, not a subcommand-specific --json option.
Examples:
# List your packs
huitzo pack list
# JSON output
huitzo --output json pack list
Output:
Your Packs
Scope Name Visibility Created
@acme financial-analysis organization 2026-03-02
@acme notes private 2026-02-11
The list comes from the deployment you are logged in to, read page by page until the last one (from CLI 0.23.1, cli #551). huitzo pack delete finds the pack by name the same way. To see the commands of the pack you are developing locally, use huitzo pack list-commands.
huitzo run¶
Execute a pack command directly via the backend API. Also available as
huitzo pack run.
huitzo run <COMMAND> [ARGS...]
Arguments:
| Argument | Required | Description |
|---|---|---|
COMMAND |
Yes | Command in @scope/pack/command format (the pack:command shorthand is also accepted and expanded to @pack/command) |
ARGS |
No | Command arguments as passthrough --key value / --key=value flags, merged with --args (flags win on conflict) |
Options:
| Option | Default | Description |
|---|---|---|
--args |
{} |
JSON object of arguments. Use this for lists or nested objects that passthrough flags can't express. |
--raw |
false |
Print full raw output without truncation |
Examples:
# Run command with passthrough flags
huitzo run @yc/yc-weather-demo/current-weather --city san-francisco
# Run command with JSON args
huitzo run @scope/pack/cmd --args '{"city":"sf"}'
# Mix JSON args with an overriding flag (flags win on conflict)
huitzo run @scope/pack/cmd --args '{"city":"sf"}' --priority high
Output:
Executing @yc/yc-weather-demo/current-weather...
{
"city": "san-francisco",
"temperature_f": 61,
"conditions": "fog"
}
huitzo login¶
Authenticate with Huitzo services. Required before using huitzo pack dev or publishing packs.
huitzo login [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--url, --api-url |
https://huitzo.ai |
Override the API URL |
--email |
- | Account email address |
--tenant |
last acting tenant | Switch to this tenant after login |
The password is never accepted on the command line. Set HUITZO_PASSWORD for non-interactive flows, or enter it at the prompt. To use an externally managed token instead of credential-based login, export HUITZO_AUTH_TOKEN (env-token mode is not persisted).
The API URL must be https://, or plain http:// on a loopback host (localhost, 127.0.0.1, ::1) for local development. Any other URL is refused before a password or token is sent, with HTTPS required to send credentials. Use an https:// URL, or localhost for development. and exit code 3. The same rule applies to every command that sends a token, and to the Hub URL a runner is paired with.
Examples:
# Interactive login (prompts for email and password)
huitzo login
# Non-interactive login
HUITZO_PASSWORD=... huitzo login --email [email protected]
# Self-hosted instance
huitzo login --url https://huitzo.acme-internal.com --email [email protected]
huitzo logout¶
Log out from Huitzo services.
huitzo logout
huitzo account¶
Manage your Huitzo account. Publishing packs requires developer mode, which creates an organization for your account.
huitzo account developer-mode [OPTIONS] # enable developer mode
huitzo account mode # show current account mode
Options (developer-mode):
| Option | Default | Description |
|---|---|---|
--org-name |
auto | Custom organization name (requires --org-slug) |
--org-slug |
auto | Custom organization slug (requires --org-name) |
With no options, the organization name and slug are auto-generated from your
email. Enabling developer mode when it is already enabled succeeds
idempotently. The current account mode is also shown by huitzo status.
Examples:
# Enable developer mode with an auto-generated org
huitzo account developer-mode
# Enable with a custom org
huitzo account developer-mode --org-name "Acme Corp" --org-slug acme
# Check your account mode
huitzo account mode
huitzo status¶
Display comprehensive environment status including authentication, server connectivity, codebase validity, and active dev sessions.
huitzo status [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--json |
false |
Output as JSON |
Examples:
# Show full status
huitzo status
# Machine-readable output
huitzo status --json
Output sections:
| Section | Description |
|---|---|
| Identity | Email, role, organization, account mode |
| Server | API URL, reachability, server version |
| Codebase | Whether current directory is a valid Intelligence Pack |
| Dev Sessions | Active development sessions (if authenticated) |
| Quick Reference | Common commands for daily use |
Output (authenticated):
╭─ Identity ──────────────────────────────╮
│ Email [email protected] │
│ Role developer │
│ Org acme │
╰─────────────────────────────────────────╯
╭─ Server ────────────────────────────────╮
│ API URL https://huitzo.ai │
│ Status healthy │
│ Version 0.3.0 │
╰─────────────────────────────────────────╯
Output (not authenticated):
╭─ Identity ──────────────────────────────╮
│ Not authenticated │
│ Run: huitzo login │
╰─────────────────────────────────────────╯
huitzo config¶
Manage CLI configuration.
huitzo config <SUBCOMMAND> [OPTIONS]
Subcommands:
| Subcommand | Description |
|---|---|
get <KEY> |
Get config value and the layer it came from (--reveal shows a sensitive value unmasked) |
set <KEY> <VALUE> |
Set config value (--scope user by default, or --scope project) |
unset <KEY> |
Remove a key from a config file (--scope user or --scope project) |
list |
List all config |
path |
Show config file path (--scope user or --scope project) |
Examples:
# Get value
huitzo config get api_url
# Set value
huitzo config set api_url https://huitzo.acme-internal.com
# List all
huitzo config list
# Show path
huitzo config path
Project config sets dev only. The project file ./huitzo.yaml is also the pack manifest and arrives with any cloned pack, so it can contribute the dev section (for example dev.port) and nothing else. api_url, auth and telemetry in it are ignored: config get and config list print a warning that names the file, and config list carries the keys as ignored_project_keys in JSON output. huitzo config set api_url <url> --scope project fails; set those keys in the user config. huitzo config unset <key> --scope project still works, so a stale entry can be removed.
HTTPS. api_url is where the CLI sends your password and tokens. A plain http:// URL is accepted only for a loopback host (localhost, 127.0.0.1, ::1); see huitzo login.
huitzo secrets¶
Manage secrets in a local developer store on this machine — the OS keychain
when one is available, otherwise a <pack>.json file under
~/.huitzo/secrets/ (%APPDATA%\huitzo\secrets\ on Windows), owner-only and
not encrypted. On Windows the ACL restriction is best-effort: a failure is
only logged, leaving the file at the inherited directory ACL.
This is not how a user configures a deployed pack's secrets. There is no cloud sync (the command says so when it runs), so nothing written here reaches a Hub, and
ctx.secretsin an installed pack never sees it. Configure thesecret_valueintegration a deployed pack actually reads withhuitzo integrations secrets— the CLI-native path — or in the Hub; see Secrets Management.
huitzo secrets <SUBCOMMAND> [OPTIONS]
Subcommands:
| Subcommand | Description |
|---|---|
set <NAME> [--value <V>] [--pack <PACK>] |
Set a secret. With no --value, reads HUITZO_SECRET_VALUE from the environment, and failing that prompts with hidden input. |
list [--pack <PACK>] |
List this store's secret names; every value renders as ******** |
remove <NAME> [--pack <PACK>] |
Remove a secret |
--pack defaults to default; the store is partitioned by that name.
Examples:
# Set a secret (hidden prompt — nothing to leak)
huitzo secrets set PLAID_CLIENT_ID --pack financial-sync
# Non-interactive: same command, with the value exported first so the literal
# never reaches the command line (and so shell history never records it)
export HUITZO_SECRET_VALUE="$(pass show plaid/client-id)"
huitzo secrets set PLAID_CLIENT_ID --pack financial-sync
unset HUITZO_SECRET_VALUE
# Names only; values come back masked
huitzo secrets list --pack financial-sync
# Remove
huitzo secrets remove PREMIUM_DATA_KEY --pack financial-sync
No subcommand prints a value. list returns ******** for every entry and
there is no get, show, or --reveal path.
That is a property of the CLI surface, not of the storage. When no OS
keychain is available the value is written as plaintext JSON to
~/.huitzo/secrets/<pack>.json — the CLI says so when it falls back — so cat
reads it back, as can anything else running as your user (an editor extension, a
postinstall script, a backup agent). Treat this store as developer convenience,
not a vault, and keep production credentials out of it.
On keeping values out of shell history: --value <V> and an inline
HUITZO_SECRET_VALUE=… huitzo … prefix are both recorded verbatim by bash and
zsh. The history-safe forms are the default hidden prompt, or exporting
HUITZO_SECRET_VALUE from a file or secret manager (export
HUITZO_SECRET_VALUE="$(pass show …)") rather than typing the literal on the
command line.
huitzo integrations¶
Manage secrets on tenant integrations — the Integration rows a deployed
pack's runtime consumes: a secret_value integration (read via ctx.secrets),
or the secret slots on a typed integration like ssh or postgres (bound to
ctx.db by resolve_for_command — a separate resolution path
from ctx.secrets; see
Conceptual Model).
ssh rows bind to ctx.ssh for packs that declare them in ssh_targets.allowed
(see SSH Execution). This
is the CLI-native counterpart to configuring those rows in the Hub; unlike
huitzo secrets (above), everything here goes over the network to the
tenant's backend.
huitzo integrations <SUBCOMMAND> [OPTIONS]
Subcommands:
| Subcommand | Description |
|---|---|
secrets list <INTEGRATION_ID> |
List the secret key names configured on an integration. Values are never returned — the response body doesn't carry them. |
secrets set <INTEGRATION_ID> <KEY> [--value <V>] |
Upsert one secret key. With no --value, reads HUITZO_SECRET_VALUE from the environment, and failing that prompts with hidden input — the same ladder as huitzo secrets set. |
secrets remove <INTEGRATION_ID> <KEY> |
Drop one secret key from the integration. |
Read-modify-write, not a single call. set and remove both mutate via
PATCH /api/v1/integrations/{id}/secrets, whose body requires
expected_updated_at — the row's updated_at as last read — with no default;
omitting it is a 422. So every set/remove is two round trips: a
GET /api/v1/integrations/{id} to capture the current updated_at, then the
PATCH. If some other write (the Hub, another CLI session) lands in between,
the row's updated_at has moved and the PATCH comes back 409 — re-read and
retry rather than surfacing a raw HTTP error. See
Partial secret rotation
for the full backend contract.
RBAC. A member may mutate secrets on integrations they own. A
tenant-shared integration (created by an admin or owner, user_id IS NULL) is
admin/owner-only to mutate — a member's attempt gets 403.
No subcommand prints a value. secrets list returns key names only;
secrets set and secrets remove never echo a secret back. --value,
HUITZO_SECRET_VALUE, and the hidden-prompt fallback work exactly as in
huitzo secrets — including the same shell-history
guidance: prefer the hidden prompt or an exported HUITZO_SECRET_VALUE over
passing --value on the command line.
Examples:
# List the secret key names on an integration (values are never shown)
huitzo integrations secrets list 3f9a1b2c-4d5e-4f60-8a1b-2c3d4e5f6071
# Set a key via hidden prompt
huitzo integrations secrets set 3f9a1b2c-4d5e-4f60-8a1b-2c3d4e5f6071 PLAID_CLIENT_ID
# Non-interactive: export the value first so it never reaches the command line
export HUITZO_SECRET_VALUE="$(pass show plaid/client-id)"
huitzo integrations secrets set 3f9a1b2c-4d5e-4f60-8a1b-2c3d4e5f6071 PLAID_CLIENT_ID
unset HUITZO_SECRET_VALUE
# Remove a key
huitzo integrations secrets remove 3f9a1b2c-4d5e-4f60-8a1b-2c3d4e5f6071 PREMIUM_DATA_KEY
huitzo mcp¶
Manage MCP (Model Context Protocol) integration. The subcommands cover two distinct concerns:
setup— connect an external MCP client (Claude Code, Cursor, etc.) to a Huitzo-hosted MCP server. Mints a scoped, long-livedsk-huitzo-*API key and writes the client config.list-servers,list-tools,call,test— interact with MCP servers declared by a pack'shuitzo.yaml(the pack-context surface).
huitzo mcp <SUBCOMMAND> [OPTIONS]
Subcommands:
| Subcommand | Description |
|---|---|
setup <SERVICE> |
Configure an external MCP client to use a Huitzo-hosted MCP server |
list-servers |
List MCP servers declared in the current pack's huitzo.yaml |
list-tools <SERVER> |
List tools from a pack-declared MCP server |
call <SERVER> <TOOL> [ARGS] |
Execute a tool from a pack-declared MCP server |
test <SERVER> |
Test connectivity to a pack-declared MCP server |
huitzo mcp setup¶
Configure an external MCP client (Claude Code, Cursor, etc.) to use a
Huitzo-hosted MCP server. Mints a long-lived, scoped sk-huitzo-* API key
for the connector — not your session JWT — and writes a Streamable HTTP
MCP config pointing at the chosen service.
The key is single-disclosure: the plaintext value is shown exactly once
(at mint time, via the chosen output mode). It is individually revocable
per-connector at <api_url>/settings.
huitzo mcp setup <SERVICE> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
SERVICE |
Yes | Service to configure. Currently supported: docs. |
Options:
| Option | Default | Description |
|---|---|---|
--write, -w |
false |
Write config into ~/.claude.json — the file Claude Code reads MCP servers from. |
--stdout |
false |
Print JSON config to stdout (for piping into other tools). |
Write target. --write always writes to ~/.claude.json (top-level
mcpServers map). That is the file Claude Code reads MCP servers from
for the user scope; the same file is also Anthropic's per-project-local
location (under .projects.<cwd>.mcpServers), and a user-scope entry is
already visible from every project.
.claude/settings.jsonis NOT a valid MCP target. Earlier versions exposed a--scope project-privateoption that wrote there; Claude Code ignoresmcpServersinsettings.json(it's reserved for hooks, permissions, env vars, statusLine). Issue #566 removed that option. If you have a strandedsk-huitzo-*key in any.claude/settings.jsonfrom before the fix, revoke it at<api_url>/settingsand remove themcpServersblock from that file by hand.No
project-sharedscope. A<project>/.mcp.jsontarget would commit a per-usersk-huitzo-*API key into the repository — a credential leak by design. The backend does not currently expose a shared team-key primitive; when one ships, a safe shared scope can be added.
Resolved endpoint URL. The MCP server is mounted at /mcp on the same
host that serves the REST API (app.mount("/mcp", mcp_app) in
apps/backend/src/backend/main.py). The connector URL is <api_url>/mcp/;
the bare <api_url>/mcp is served identically and does not redirect.
Key naming. The minted key is named huitzo-docs-mcp (<hostname>) so it
is identifiable in <api_url>/settings. Empty socket.gethostname() is
rendered as unknown-host.
Safety guarantees on --write:
- Echoes the resolved target path (
~/.claude.json) before minting so the user can abort with Ctrl-C before a one-shot credential is burned. - Atomic replace via
os.replacefrom a sibling temp file in the same directory; a crash mid-write cannot truncate the target. - File mode
0o600(parent directory0o700when newly created) — a credential-bearing config is not world-readable on multi-user hosts. - POSIX advisory file lock around the read-modify-write of
~/.claude.jsonso a concurrent Claude Code edit cannot lose-update the MCP server entry. - Refuses to overwrite a non-JSON, non-object, or malformed
mcpServerstarget. The plaintext key is surfaced to the caller (stderr in human mode,error.dataenvelope in--output jsonmode) so the user can recover it manually before exit. - Crash-safe temp-file cleanup covers SIGINT and any other non-
OSErrorexit, not just disk failures.
Examples:
# Print setup instructions (no key minted into a config file)
huitzo mcp setup docs
# Write to ~/.claude.json — every project on this machine sees the server
huitzo mcp setup docs --write
# Pipe JSON config to another tool (mints the key — single-disclosure)
huitzo mcp setup docs --stdout > huitzo-mcp.json
Output (huitzo mcp setup docs, no --write):
Huitzo Docs MCP Configuration
Endpoint: https://huitzo.ai/mcp/
Key: sk-huitzo-deadbe...
Key name: huitzo-docs-mcp (laptop.local)
Add this to your MCP client configuration:
{
"huitzo-docs": {
"type": "streamable-http",
"url": "https://huitzo.ai/mcp/",
"headers": {
"Authorization": "Bearer sk-huitzo-..."
}
}
}
Or run with --write to auto-configure Claude Code (writes to ~/.claude.json).
This key is long-lived. Revoke or rotate it at: https://huitzo.ai/settings
Output (--write success):
Will write to ~/.claude.json after mint (Ctrl-C to abort).
Updated ~/.claude.json with huitzo-docs MCP server
Key: sk-huitzo-deadbe...
Key name: huitzo-docs-mcp (laptop.local)
This key is long-lived. Revoke or rotate it at: https://huitzo.ai/settings
Paths under
$HOMEare rendered with~/shorthand in human output to avoid leaking the user's full home directory into terminal recordings or CI logs.
Failure recovery (--write after a successful mint). If the write
step fails after the key has been minted, the backend has already
recorded the key and will never disclose the plaintext again. The CLI
exits non-zero and prints a recovery block containing the full MCP
config snippet, the key prefix, and the revocation URL. In --output
json mode, the same data is wrapped inside the structured error
envelope under error.data for programmatic recovery.
See also:
docs/architecture/security.md#api-keys-machine-to-machine— backing design forsk-huitzo-*keys (scope, expiry, revocation).
huitzo mcp list-servers¶
List all MCP servers configured in the current pack's manifest.
huitzo mcp list-servers [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--json |
false |
Output as JSON |
Example:
huitzo mcp list-servers
Output:
MCP Servers (from huitzo.yaml):
NAME TYPE STATUS
github stdio ✅ Available
postgres stdio ✅ Available
slack http ✅ Available
huitzo mcp list-tools¶
List available tools from an MCP server.
huitzo mcp list-tools <SERVER> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
SERVER |
Yes | Name of the MCP server |
Options:
| Option | Default | Description |
|---|---|---|
--tool |
- | Filter to specific tool |
--schema |
false |
Show JSON schema for tools |
--json |
false |
Output as JSON |
Examples:
# List all tools from GitHub server
huitzo mcp list-tools github
# Get schema for a specific tool
huitzo mcp list-tools github --tool create_issue --schema
# JSON output
huitzo mcp list-tools github --json
Output:
Tools from github:
TOOL DESCRIPTION
create_issue Create a new GitHub issue
list_issues List issues in a repository
get_issue Get details of a specific issue
add_labels Add labels to an issue
create_pull_request Create a new pull request
list_repositories List repositories for a user/org
...
Found 15 tools. Use --tool <name> --schema for details.
Schema Output:
huitzo mcp list-tools github --tool create_issue --schema
Tool: create_issue
Description: Create a new GitHub issue
Schema:
{
"type": "object",
"properties": {
"owner": {"type": "string", "description": "Repository owner"},
"repo": {"type": "string", "description": "Repository name"},
"title": {"type": "string", "description": "Issue title"},
"body": {"type": "string", "description": "Issue body"}
},
"required": ["owner", "repo", "title"]
}
huitzo mcp call¶
Execute an MCP tool directly from the CLI.
huitzo mcp call <SERVER> <TOOL> [ARGS]
Arguments:
| Argument | Required | Description |
|---|---|---|
SERVER |
Yes | Name of the MCP server |
TOOL |
Yes | Name of the tool to execute |
ARGS |
No | Tool arguments as JSON string |
Options:
| Option | Default | Description |
|---|---|---|
--timeout |
30 |
Timeout in seconds |
--json |
false |
Output raw JSON result |
Examples:
# Call with JSON arguments
huitzo mcp call github create_issue '{"owner": "acme", "repo": "test", "title": "Test issue"}'
# Call with timeout
huitzo mcp call postgres query '{"sql": "SELECT * FROM users"}' --timeout 60
# Get raw JSON output
huitzo mcp call github list_issues '{"owner": "acme", "repo": "test"}' --json
Output:
Calling github.create_issue...
✅ Tool executed successfully
Result:
{
"number": 42,
"title": "Test issue",
"html_url": "https://github.com/acme/test/issues/42",
"state": "open"
}
huitzo mcp test¶
Test connectivity and authentication to an MCP server.
huitzo mcp test <SERVER> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
SERVER |
Yes | Name of the MCP server |
Options:
| Option | Default | Description |
|---|---|---|
--verbose |
false |
Show detailed connection info |
Examples:
# Basic connectivity test
huitzo mcp test github
# Verbose output
huitzo mcp test github --verbose
Output:
Testing connection to github...
✅ Connection successful
✅ Authentication valid
✅ Tools discovered: 15
Server: github
Type: stdio
Command: uvx mcp-server-github
Status: Ready
Verbose Output:
Testing connection to github...
[DEBUG] Spawning subprocess: uvx mcp-server-github
[DEBUG] Environment: GITHUB_TOKEN=****** (set)
[DEBUG] Sending initialize request...
[DEBUG] Received initialize response
[DEBUG] Sending tools/list request...
[DEBUG] Received 15 tools
✅ Connection successful
✅ Authentication valid
✅ Tools discovered: 15
Server Details:
Name: github
Type: stdio
Command: ["uvx", "mcp-server-github"]
Protocol Version: 2024-11-05
Tools: create_issue, list_issues, get_issue, ...
Runner Commands¶
The runner is the local agent that executes Studio jobs for a tenant (see Runner channel). Its behaviour as of CLI 0.23.1:
- Reconnect. When the connection to the Hub drops during a job, the runner re-dials and renews the same lease. The job's processes keep running and the job is not failed as "runner lost" unless the lease expires before a heartbeat is accepted.
- Workspace fingerprint.
node_modules/no longer counts toward a build's workspace fingerprint (contract). A dashboard build that finished before the upgrade and is fixed or published after it asks once to confirm "workspace changed"; confirm it, or plan again. - Reports after a reconnect. Gate verdicts and audit events are sent again after the runner reconnects, so a dropped connection no longer loses them. If the Hub already ended the job (it recorded the terminal status or reaped the job), the runner ends that job and keeps serving instead of stopping. If the Hub answers that the job is still open but refuses the lease, the runner halts. See Runner channel for the Hub's side.
- Stop. When the Hub tells the runner to stop a job, the job's processes are killed at once, even if the connection drops at that moment. A stop received on a live connection also cancels a project-source upload or restore that is already running, so the runner halts without waiting for its time limit; a shutdown no longer waits through re-dials (cli #527).
- Diagnostics.
runner doctorreports uv, claude, git, npm and node as the running runner sees them and says whether builds and dashboard builds can run;runner statusflags DIVERGED only when the running runner's build differs from the shell's. A judge self-check that did not complete names its cause in the log (for examplecanary-timeout,canary-spawn-failed,canary-output-over-caporcanary-exit-nonzero), and one passed self-check serves every job for up to 6 hours (cli #524). A judge self-check that timed out on its own deadline or exited non-zero is measured once more after about 10 seconds, only while the evaluation step's time budget still holds the wait, a second self-check and the judge run; a breach, an AI rate limit, a failed spawn, an over-cap output and a timeout whose process leader was reaped elsewhere are never retried, and each attempt is its own log line (cli #532). The self-check line of any kind (author, plan or judge) also carriesinit_seenandtimeout_kind(empty when the verdict was cached rather than measured, and always empty forinit_seenon an author self-check), and a self-check of any kind that timed out, or a plan or judge self-check that exited non-zero, leaves the last 16 KiB of each output stream in an owner-only file under the runner'srunner-auditfolder (the newest 20 are kept). Nothing in those files, and not their path, leaves the machine: no log line, doctor bundle, snapshot or Hub message carries them (cli #532). The judge's short rationale reaches the Hub only after a sanitizer drops any text with a web address (://, orhttp:orhttps:followed by/or\, in any case), a run of 32 or more key-like characters, or any format character (Unicode category Cf, such as zero-width, bidirectional or tag characters); a bare domain, a//host, a short key or a visible look-alike character can still pass, and the Hub shows the line as plain text. - Pack name and version. For a build the Hub decides the pack name and the next free version; the runner scaffolds them, tells the author, writes the version into
huitzo.yaml,pyproject.tomland__version__just before validation, and fails the build on a different pack name (it never renames a pack). A runner older than 0.22.0 ignores them, and the Hub then refuses a publish whose built name or version differs (contract, cli #529). - Approval wait. A connection reset while a build waits for approval no longer loses the build: the wait's heartbeats and pulls go through the job's re-dial link, so the runner re-dials, renews the same lease and keeps waiting for the grant, the rejection or the approval's expiry. The approval request is never sent twice; a job the runner can neither resume nor report is logged with a closed token and given up, and the runner keeps serving (cli #538, from 0.23.0).
- Command names. The planner and the author are told that every pack command is named in kebab-case (
list-prompts, neverlist_prompts), and a manifest gate that fails on it reportsCOMMAND-NAMEinstead ofMANIFEST-SCHEMA(cli #542, from 0.23.0). The validator also matches command names and versions in full, so a trailing newline no longer passes. - Change builds (from 0.23.1). A build the Hub starts from a published version's stored source ("Change this") restores it into the job's directory and does not scaffold over it: when the Hub's signed stage list names
scaffold, the runner leaves it out, and the dashboard step adopts the restoreddashboard/when it is a real directory holding a regularpackage.json(anything else keeps the fail-closed refusal). The Hub sends a change build only to a runner at CLI 0.23.1 or later (runner gate, cli #550). - Stand-ins (from 0.23.1). The manifest gate fails every build that returns a placeholder result as real, forces demo mode on, or has a source file the scan cannot read. It fails a mock provider (or
is_mock,is_fake,is_stub) selected outside demo mode only when the build lists setup-required outputs and the finding is tied to one of them; otherwise that is a warning.huitzo pack validatereports all of these findings as warnings. A plan lists outputs that will not work until the Huitzo team sets something up (setup_required) (cli #546). - Test context and dashboard checks (from 0.23.1). A new pack's
tests/conftest.pyprovidesharnessandctxfixtures over the SDK's own storage client, so a storage key the platform refuses (such asnote:<id>) fails the pack's own tests. Afterhuitzo dashboard validate, a static scan ofdashboard/src(contract) reports an input with no label and an unreadable source as errors, which go to the one repair pass (still red afterwards isdashboard_failed), and auseCommandwhoseerroris never read as a warning, which never fails the step or starts a repair pass (cli #552). - Planner naming. The planner is told that Studio sets the pack's name and version after the plan, so it writes "the pack" instead of inventing a name and states no version; when the request carries the name Studio will publish under, it uses exactly that name (cli #532).
- Approval. The approval request names the steps the job will really run, from the signed stage list (set up the project, write the pack, fix what failed, check it, package it, and the dashboard and evaluation steps) (cli #528).
- Declined requests. A reviewer request the planner declined travels with the plan; a list that breaks the character rule is dropped with a log line and the plan is still submitted (Runner channel, cli #523).
- Dashboard stage. If the job itself created a
dashboard/folder (the pack author can), the stage sets it aside under.huitzo/displacedand builds the dashboard fresh; nothing from it is reused. Adashboard/that existed when the job started still ends the dashboard step as a failed setup. See the dashboard stage contract. - Why a connection attempt failed. A failed dial is logged at WARNING with a short cause code (for example
InvalidStatus:502, or<ExceptionType>:errno=<n>); never the error text or URL. The codes are described in the CLI repository'sdocs/runner-channel-client.md#dial-failure-cause. - Project source on Huitzo. A runner you host yourself keeps a copy of each Studio build's source on Huitzo when the build ends (
doneorfailed), so the project can be changed later. It asks Huitzo first; the upload happens only while the workspace keeps project source. A workspace owner or admin can turn this off in Settings, section "Studio", "Keep project source on Huitzo" (setting). A build's result never depends on the upload. - Out of AI credits. An out-of-credits error from the AI provider (for managed runs, the Huitzo gateway's HTTP 402 "credits exhausted") is classified as an AI rate-limit error (
ai_rate_limit), not as an expired or rejected key (ai_key_expired). runner up --managedandrunner pool up. These run the runner inside a Huitzo pool container, for Huitzo-hosted runs; they are not for self-hosted runners, and nothing changes for those. Not yet enabled on the Hub onmain: the Hub side of managed runners has not merged, so do not use these commands against a Hub built frommain. The CLI's own description isdocs/managed-runner-pool.mdin the CLI repository.
Sandbox Commands¶
Commands for managing the local execution sandbox. The sandbox provides an isolated environment for running pack commands during development and agent-driven workflows.
huitzo sandbox start¶
Start a local sandbox environment.
huitzo sandbox start [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--background |
false |
Start in background mode (non-blocking) |
--timeout |
3600 |
Auto-stop after N seconds of inactivity |
Examples:
# pseudocode — start sandbox interactively
huitzo sandbox start
# pseudocode — start in background for agent use
huitzo sandbox start --background --output json
The sandbox's connection file (~/.huitzo/sandbox.json, or next to --pidfile) holds the sandbox auth token. On POSIX, each write goes to a new owner-only temporary file in the same directory that is renamed onto the connection file, so an older file with looser permissions, a symlink or a hard link at that path is replaced, never written through; if the rename is refused, nothing is written and the temporary file is removed (cli #531). On POSIX, starting and stopping the sandbox also removes this connection file's own leftover temporary files, but only regular files owned by you and older than 60 seconds (cli #532). On Windows the file is written in place and restricted to your user with an access-control list (best effort: if that fails, a warning is logged and the file keeps the folder's permissions).
huitzo sandbox stop¶
Stop the running sandbox and release resources.
huitzo sandbox stop [OPTIONS]
Examples:
# pseudocode — stop the sandbox
huitzo sandbox stop --output json
huitzo sandbox status¶
Check the current state of the sandbox.
huitzo sandbox status [OPTIONS]
Examples:
# pseudocode — query sandbox state
huitzo sandbox status --output json
# returns status, sandbox_id, uptime
Pack Execution Commands¶
Commands for executing pack commands and inspecting command metadata. These are typically used after starting a sandbox.
huitzo pack exec¶
Execute a specific pack command and return its result.
huitzo pack exec <NAMESPACE/COMMAND> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
NAMESPACE/COMMAND |
Yes | Fully qualified command identifier |
Options:
| Option | Default | Description |
|---|---|---|
--arg |
- | Command argument as key=value (repeatable) |
--timeout |
60 |
Execution timeout in seconds |
Examples:
# pseudocode — execute a command with arguments
huitzo pack exec mypack/analyze --arg input="some data" --output json
huitzo pack list-commands¶
List all commands exposed by the current pack.
huitzo pack list-commands [OPTIONS]
Examples:
# pseudocode — discover available commands
huitzo pack list-commands --output json
huitzo pack describe¶
Show detailed metadata for a specific command, including its argument schema, timeout, and description.
huitzo pack describe <NAMESPACE/COMMAND> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
NAMESPACE/COMMAND |
Yes | Fully qualified command identifier |
Examples:
# pseudocode — inspect command metadata
huitzo pack describe mypack/analyze --output json
Dashboard Commands¶
Commands for developing, building, and publishing Dashboards. Dashboards are micro-frontend applications that run inside Huitzo Hub and consume Intelligence Pack commands via the Dashboard SDK.
Workflow guide: See Dashboard CLI Guide for an end-to-end walkthrough with detailed template specification and troubleshooting.
huitzo dashboard new¶
Scaffold a new Dashboard project. Generates a React + TypeScript project configured as a micro-frontend with Vite library mode.
huitzo dashboard new [OPTIONS] [NAME]
Arguments:
| Argument | Required | Description |
|---|---|---|
NAME |
No | Dashboard name (prompts if not provided) |
Options:
| Option | Default | Description |
|---|---|---|
--template |
basic |
Template variant (basic, tailwind, full) |
--namespace |
(derived from name) | Dashboard namespace |
--author |
(from git config) | Author name |
Examples:
# Interactive mode
huitzo dashboard new
# Quick start
huitzo dashboard new claims-dashboard
# With Tailwind template
huitzo dashboard new analytics --template tailwind
Generated Structure:
claims-dashboard/
├── huitzo-dashboard.yaml # Dashboard manifest
├── package.json # react, @huitzo/dashboard-sdk, @huitzo/dashboard-sdk-react
├── vite.config.ts # Vite library mode — outputs dist/main.js
├── tsconfig.json
├── index.html # Dev-only — loads src/dev.tsx
├── src/
│ ├── main.tsx # Production entry — exports mount() and unmount()
│ ├── dev.tsx # Dev-only — calls mount() with mock HuitzoContext
│ ├── App.tsx # Root component
│ ├── App.module.css # CSS Modules (scoped styles)
│ └── components/
│ └── ErrorBoundary.tsx # Catches React tree errors
└── .gitignore
See Dashboard CLI Guide — Step 1 for detailed file-by-file specification of the template.
huitzo dashboard dev¶
Start a dashboard development server with hot reload and API proxy. Uses the dev harness (src/dev.tsx) to simulate Hub by calling mount() with a mock context.
huitzo dashboard dev [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--port |
3000 |
Development server port |
--api-url |
(from config) | Huitzo API URL for proxy |
--open |
true |
Open browser on start |
Examples:
# Start with defaults
huitzo dashboard dev
# Custom port
huitzo dashboard dev --port 5173
# Connect to local backend
huitzo dashboard dev --api-url http://localhost:8000
Output:
# pseudocode — example dev server output
Dashboard development server started
Local: http://localhost:3000
Network: http://192.168.1.100:3000
API Proxy: http://localhost:8080 → /api/*
Pack Dependencies:
@acme/claims-processor (v0.1.0)
@huitzo/analytics (v1.0.0)
Press Ctrl+C to stop
See Dashboard CLI Guide — Step 2 for dev mode details and how it differs from Hub mode.
huitzo dashboard validate¶
Validate dashboard manifest and build output without publishing.
huitzo dashboard validate [OPTIONS]
Examples:
# Validate current directory
huitzo dashboard validate
Output:
# pseudocode — example validation output
huitzo-dashboard.yaml found
dashboard.name: "claims-dashboard" (valid kebab-case)
dashboard.version: "1.2.0" (valid semver)
dashboard.namespace: "claims" (valid)
dashboard.min_sdk_version: "1.0.0" (valid semver)
pack_dependencies: 2 declared, all valid
dist/main.js found (entry point)
Bundle exports: mount, unmount (valid module contract)
Bundle size: 1.2 MB (under 50 MB limit)
All checks passed.
Validation checks:
| Check | Description |
|---|---|
| Required fields | name, namespace, version, description present |
| Name format | kebab-case, 3-50 characters |
| Version format | Valid semver |
| Entry point | dist/main.js exists, exports mount and unmount |
| Bundle size | Tarball ≤ 50 MB, ≤ 500 files |
| SDK version | min_sdk_version is valid semver |
See Dashboard CLI Guide — Step 4 for the full validation workflow. Canonical validation rules are in Dashboard Publishing — Validation Rules.
huitzo dashboard build¶
Build dashboard for production deployment.
huitzo dashboard build [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--output |
./dist |
Output directory |
--minify |
true |
Minify output |
--sourcemap |
false |
Generate source maps |
Examples:
# Production build
huitzo dashboard build
# With source maps (for debugging)
huitzo dashboard build --sourcemap
# Custom output directory
huitzo dashboard build --output ./build
Output:
# pseudocode — example build output
Building claims-dashboard for production...
Build complete!
Output: ./dist
Size: 245 KB (gzipped: 72 KB)
Files:
- dist/main.js (self-contained ESM — React + SDK + app + CSS)
Ready to validate with 'huitzo dashboard validate'
Note: The build output is a single self-contained ESM module (
dist/main.js). CSS is injected into the JS module — there is no separate CSS file. Noindex.htmlis produced in library mode. See Dashboard Publishing — Build Contract.
See Dashboard CLI Guide — Step 3 for details.
huitzo dashboard publish¶
Publish dashboard to Huitzo Hub.
Cloud-gated: Requires Huitzo Cloud authentication.
huitzo dashboard publish [OPTIONS]
Options:
| Option | Default | Description |
|---|---|---|
--visibility |
(from manifest) | Visibility level |
--dry-run |
false |
Simulate without publishing |
Examples:
# Publish to Huitzo Hub
huitzo dashboard publish
# Dry run
huitzo dashboard publish --dry-run
# Override visibility
huitzo dashboard publish --visibility unlisted
Output:
# pseudocode — example publish output
Publishing [email protected]...
Authenticating with Hub
Uploading dashboard (148 KB)
Published successfully!
Hub URL: https://hub.huitzo.com/d/claims-dashboard
Explore: https://hub.huitzo.com/explore/dashboards/claims-dashboard
Visibility: organization
See Dashboard CLI Guide — Step 5 for the full publish workflow. Version management details in Dashboard Publishing — Version Management.
huitzo dashboard grant¶
Grant access to specific organizations (for private/organization dashboards). Requires an owner or admin role in the dashboard's owning tenant. A member, or an API key (which always acts as member), gets Grant failed: Only a tenant owner or admin can grant access.
Cloud-gated: Requires Huitzo Cloud authentication.
huitzo dashboard grant <DASHBOARD> <ORGANIZATION>
Arguments:
| Argument | Required | Description |
|---|---|---|
DASHBOARD |
Yes | Dashboard name |
ORGANIZATION |
Yes | Organization scope (e.g., @acme) |
Examples:
# Grant access to an organization
huitzo dashboard grant claims-dashboard @partner-org
Output:
# pseudocode — example grant output
Granted @partner-org access to claims-dashboard
Current access:
- @acme (owner)
- @partner-org (granted)
See Dashboard CLI Guide — Step 6 for the access control workflow.
huitzo dashboard delete¶
Delete a dashboard from the registry. Removes the dashboard and all its versions and access grants. Requires developer mode and an owner or admin role in the owning tenant.
huitzo dashboard delete <DASHBOARD> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
DASHBOARD |
Yes | Dashboard name (slug) to delete |
Options:
| Flag | Description |
|---|---|
--force, -f |
Skip confirmation prompt |
--output json |
Machine-readable JSON output |
Examples:
# Interactive (prompts for confirmation)
huitzo dashboard delete claims-dashboard
# Non-interactive (CI/automation)
huitzo dashboard delete claims-dashboard --force --output json
Output:
# pseudocode — example delete output (interactive)
This will permanently delete claims-dashboard and all its versions.
Are you sure? [y/N]: y
Deleting claims-dashboard...
Deleted claims-dashboard
// pseudocode — example delete output (--output json)
{
"ok": true,
"data": {
"dashboard_id": "<uuid>",
"name": "claims-dashboard",
"status": "deleted"
}
}
Errors:
| Error | Cause |
|---|---|
| "Developer mode required" | User account is not in developer mode |
"Dashboard '<name>' not found" |
No dashboard with that slug accessible to the current tenant |
| "Delete failed: ..." | Backend returned an error (e.g., dashboard belongs to a different tenant) |
| "Delete failed: Only a tenant owner or admin can delete dashboards" | Your role in the owning tenant is member, or you are signed in with an API key |
| "Invalid dashboard name" | Name is not in kebab-case format |
huitzo dashboard share¶
Generate a shareable link for unlisted dashboards.
Cloud-gated: Requires Huitzo Cloud authentication.
huitzo dashboard share <DASHBOARD> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
DASHBOARD |
Yes | Dashboard name |
Options:
| Option | Default | Description |
|---|---|---|
--expires |
never |
Link expiration (1d, 7d, 30d, never) |
Examples:
# Get shareable link
huitzo dashboard share claims-dashboard
# With expiration
huitzo dashboard share claims-dashboard --expires 7d
Output:
# pseudocode — example share output
Shareable link for claims-dashboard:
https://hub.huitzo.com/d/abc123xyz
Visibility: unlisted
Expires: Never
Anyone with this link can view and install the dashboard.
Branding Commands¶
White-label branding operations (Project 4). See ADR-015 for the manifest schema.
huitzo branding validate¶
Validate a white-label branding directory (branding.yaml + assets/) offline,
before deploying. Mirrors huitzo pack validate: the backend fail-to-defaults on
a broken manifest, so this is how an operator confirms the brand will take.
huitzo branding validate [OPTIONS] DIRECTORY
Arguments:
| Argument | Required | Default | Description |
|---|---|---|---|
DIRECTORY |
Yes | — | Path to the branding/ directory (branding.yaml + assets/) |
Options:
| Option | Default | Description |
|---|---|---|
--json |
false |
Emit one machine-readable object {"ok", "errors", "warnings"} and nothing else |
It checks the ADR-015 contract: the strict schema (the 26-token allowlist — 24 color tokens + 2 font families — hex colors, CSS-safe font families, safe bare-filename assets) and the on-disk assets (existence, pinned extensions, size caps, magic-byte type, and a sanitizable SVG favicon).
Exit code: 0 when valid, 1 when not — usable directly in CI.
Examples:
# Validate before bringing up the deployment
huitzo branding validate ./branding
# Machine-readable, for CI
huitzo branding validate ./branding --json
Output:
Branding validation: PASSED
Tenant Commands¶
Tenant lifecycle and membership commands. Two commands are the end-user membership surface (ADR-028 §10/2f) — any authenticated caller can manage their own tenant memberships and acting tenant. The rest are the admin/owner platform-console surface. See ADR-028 for the full membership model.
huitzo tenant list¶
List the tenants you're a member of. Any authenticated user.
huitzo tenant list [OPTIONS]
Calls GET /api/v1/auth/me and renders the memberships[] enumeration:
slug, name, role, and whether it's your home tenant (home tenant listed
first). A display-only * marker flags whichever row matches the
tenant_id claim on your currently stored access token — decoded locally,
never authoritative. The backend is the sole authority on what tenant you
can act as; use huitzo tenant switch <slug> to actually change it.
Options:
| Option | Default | Description |
|---|---|---|
--output json |
text |
Emit the standard envelope: {"memberships": [...], "active_tenant_id": ...} |
Examples:
# List your tenant memberships
huitzo tenant list
# Machine-readable output
huitzo tenant list --output json
Output:
Your tenants
Slug Name Role Home
* solathomas Solathomas Field member yes
acme Acme Corp admin
* = your current acting tenant
Not the platform-wide listing.
huitzo tenant listshows only the CALLER's own memberships. The admin/owner platform-wide tenant listing ishuitzo tenant list-all— see the breaking-change note below.
huitzo tenant switch¶
Switch your acting tenant.
huitzo tenant switch <SLUG> [OPTIONS]
Arguments:
| Argument | Required | Description |
|---|---|---|
SLUG |
Yes | Slug of the tenant to switch into (see huitzo tenant list) |
Calls POST /api/v1/auth/switch-tenant in body mode — CLI callers have no
cookie jar, so the stored refresh token rides in the request body instead of
a cookie. On success, the rotated access and refresh tokens are persisted
exactly the way huitzo login persists them: the old refresh token is
replaced outright, not appended, matching the server's atomic in-place
session re-pin.
A non-member slug, a nonexistent slug, an inactive tenant, and a dead session all collapse into the same uniform "Tenant switch failed" error — by design, there is no tenant-existence oracle, so the CLI does not (and cannot) distinguish which cause applied. The command also fails closed if the backend response is missing either rotated credential: rather than persist a stale or partial credential pair, it persists nothing.
Options:
| Option | Default | Description |
|---|---|---|
--output json |
text |
Emit {"switched": true, "tenant_slug": ..., "role": ..., "memberships": [...]} |
Examples:
# Switch into the "acme" tenant
huitzo tenant switch acme
# Machine-readable output
huitzo tenant switch acme --output json
Output:
Switched to Acme Corp (acme)
Errors:
| Error | Cause |
|---|---|
"Please run huitzo login first." |
No stored session, or no refresh token on disk |
| "Tenant switch failed" | Not a member, no such tenant, tenant inactive, or a dead session (uniform error — no tenant-existence oracle) |
| "Backend response missing rotated credentials (accessToken/refreshToken)" | Contract violation — the CLI persists nothing rather than keep a stale refresh token |
huitzo tenant list-all¶
List ALL platform tenants (cursor-paginated). Admin + owner roles only.
huitzo tenant list-all [OPTIONS]
Breaking change — renamed from
huitzo tenant list. This command washuitzo tenant listprior to ADR-028's membership work. It is nowhuitzo tenant list-all, with no alias for the old name — ADR-028 §10 fixeshuitzo tenant listas exactly the end-user "your own memberships" command above, and the no-backwards-compatibility principle says rename cleanly rather than alias. Scripts or automation invoking the platform-wide listing ashuitzo tenant listmust update tohuitzo tenant list-all.
Options:
| Option | Default | Description |
|---|---|---|
--cursor |
— | Pagination cursor |
--limit |
50 (max 200) |
Page size |
--output json |
text |
Emit {"tenants": [...], "meta": {...}} (cursor pagination info in meta) |
Examples:
# List all platform tenants
huitzo tenant list-all
# Paginate
huitzo tenant list-all --limit 100 --cursor <cursor>
Output:
Tenants
ID Name Slug Active
<uuid> Solathomas Field solathomas yes
<uuid> Acme Corp acme yes
More results available. Re-run with --cursor <next_cursor>
Cross-Platform Usage¶
The Huitzo CLI works consistently across platforms. Here are platform-specific notes:
Command Syntax¶
# Linux/macOS
huitzo run @scope/analytics/analyze --file="/path/to/data.csv"
# Windows PowerShell
huitzo run @scope/analytics/analyze --file="C:\Users\me\data.csv"
# Windows Command Prompt
huitzo run @scope/analytics/analyze --file="C:\Users\me\data.csv"
Path Handling¶
The CLI accepts both forward slashes and backslashes on Windows:
# Both work on Windows
huitzo run @scope/pack/command --file="C:\data\file.csv"
huitzo run @scope/pack/command --file="C:/data/file.csv"
Environment Variables¶
# Linux/macOS (bash/zsh)
export HUITZO_API_URL="http://localhost:8000"
# Windows PowerShell
$env:HUITZO_API_URL = "http://localhost:8000"
# Windows Command Prompt
set HUITZO_API_URL=http://localhost:8000
Shell Completion¶
# Bash (Linux/macOS)
huitzo --install-completion bash
source ~/.bashrc
# Zsh (macOS)
huitzo --install-completion zsh
source ~/.zshrc
# PowerShell (Windows)
huitzo --install-completion powershell
# Restart PowerShell
Configuration¶
Config File Location¶
# User config (Linux/macOS; $XDG_CONFIG_HOME/huitzo/ when set)
~/.config/huitzo/config.yaml
# Windows
%APPDATA%\huitzo\config.yaml
# Project config (also the pack manifest)
./huitzo.yaml
# Auth token (written by `huitzo login`)
~/.huitzo/token
Config File Format¶
YAML, with the keys api_url, auth.token_file, dev.* (port, verbose, auto_reload, persist_sandbox) and telemetry. Precedence: environment variables, then user config, then ./huitzo.yaml, then defaults. The project file ./huitzo.yaml contributes the dev section only; api_url, auth and telemetry there are ignored with a warning (see huitzo config). Manage keys with huitzo config.
# ~/.config/huitzo/config.yaml
api_url: https://huitzo.ai
dev:
port: 8080
Environment Variables¶
Environment variables override config file:
| Variable | Description |
|---|---|
HUITZO_AUTH_TOKEN |
Authentication token (env-token mode, not persisted) |
HUITZO_API_URL |
Backend API URL |
HUITZO_DEV_PORT |
Local dev proxy port |
NO_COLOR |
Set to a non-empty value to remove all styling from output |
Exit Codes¶
| Code | Name | Meaning |
|---|---|---|
| 0 | OK | Command succeeded |
| 1 | General Error | Unclassified failure |
| 2 | Auth Error | Authentication failed or token expired |
| 3 | Validation Error | Input or manifest validation failed |
| 4 | Network Error | Could not reach the Huitzo API or registry |
| 5 | Server Error | Server returned a 5xx response |
| 10 | Command Error | Pack command execution failed |
| 130 | Interrupt | Process received SIGINT (Ctrl+C) |
See Agent Integration for how agents should use exit codes for control flow.
Troubleshooting¶
Command Not Found¶
# Check installation
which huitzo
# Reinstall
pip uninstall huitzo-cli
pip install huitzo-cli
Authentication Issues¶
# Clear credentials
huitzo logout
# Re-authenticate
huitzo login
Outdated Dependencies¶
huitzo pack dev automatically checks if huitzo and huitzo-sdk have newer versions available on PyPI. This check runs in the background during startup and will not block or slow down your workflow.
Behavior:
- Checks once per day (cached for 24 hours in the huitzo config directory, typically ~/.config/huitzo/update_check.json on Linux/macOS)
- Only warns — never blocks startup
- Silently skipped if offline or PyPI is unreachable
Disabling the check:
# CLI flag
huitzo pack dev --skip-update-check
# Environment variable (useful for CI)
# Accepted values: 1, true, yes (case-insensitive)
export HUITZO_SKIP_UPDATE_CHECK=1
Example output:
Warning: huitzo-sdk 0.0.0 installed, 0.0.2 available — run: pip install --upgrade huitzo-sdk
Dev Server Won't Start¶
# Check port availability
lsof -i :8080
# Use different port
huitzo pack dev --port 9000
Related Documentation¶
- Intelligence Projects — Optional scaffolding for fullstack Pack + Dashboard apps
- Project Authoring — Workflow after
huitzo project init - CLI Overview — Installation, design philosophy, and command groups
- Dashboard CLI Guide — End-to-end dashboard development workflow
- SDK Overview — Building Intelligence Packs
- Pack Manifest —
huitzo.yamlreference - Dashboard Framework Overview — Dashboard concepts and Hub integration
- Dashboard Loading Architecture — How Hub loads and renders dashboards
- Dashboard Publishing — Build contract, validation rules, version management
- Dashboard Manifest —
huitzo-dashboard.yamlreference - Dashboard SDK Reference —
@huitzo/dashboard-sdkAPI - Secrets Management — User secrets
- API Reference — REST API documentation
- ADR-028: Multi-Tenant Membership — Membership model backing
huitzo tenant list/switch