CLI Reference
hya is a single command-line binary built around a consistent hya <noun> <verb> command grammar plus ergonomic root shortcuts. Running bare hya in an interactive terminal opens the terminal UI and browser WebUI (http://127.0.0.1:3250); passing a subcommand runs headless turns, attaches to existing or remote servers, manages the background daemon, configures providers/auth/models, inspects sessions, or runs bundle-contributed commands.
Quick command map
| Area | Commands |
|---|---|
| Interactive UI | hya, hya -c (--continue), hya -r [<ID>] (--resume), hya --web-port <N>, hya attach [<URL>|<LINK>|-] |
| Editor integration | hya acp |
| Headless runs | hya exec <PROMPT|->, hya -p <PROMPT> (--print), hya goal <GOAL> (hya/goal), hya loop <TARGET> (hya/loop) |
| Server & daemon | hya server run|start|status|stop|restart|logs |
| Remote relay | hya relay proxy|bridge|doctor|connect|disconnect|status|link|rotate |
| Configuration & profiles | hya config schema|validate|show|paths, hya profile list|show |
| Project trust & permissions | hya trust set|show|list, hya permissions show|list|add|revoke |
| Auth, providers & models | hya auth login|logout|status, hya provider add|list|remove, hya model list|default |
| Sessions & agents | hya session list|archive|unarchive|events, hya agent list |
| Bundles & workflows | hya bundle install|upgrade|remove|enable|disable|refresh|registry|mirror|pack|verify|list|info|search|schema, hya workflow ... (hya/workflow) |
| Diagnostics & tooling | hya doctor [--json], hya abi info [--json], hya completions <bash|zsh|fish|powershell>, hya update |
| Offline v1/v2 → v3 migration | hya-migration check|run|rollback |
Bundle CLI extensions
Enabled bundles can extend the CLI at arbitrary positions — either at the top level or nested under any pure namespace command (core or bundle-contributed) using parent: [...] in bundle.yaml cli: (see hyabundle CLI commands):
- Every bundle-contributed command is automatically prefixed with
[from: <vendor/name>]in both its parent’s subcommand listing and at the top of its own--helpoutput. - Anti-shadowing & anti-masking rules: bundles can never override or shadow a core command/alias,
"help", or another enabled bundle’s command; can never mount under a leaf action command (only pure namespace commands); can never declareargson a namespace; and can never declare reserved core flags (--help/-h,--version/-V,--model/-m,--effort,--yolo,--bare,--bundles,--pure,--db). - Isolation & replacement:
hya --baredisables built-in bundle commands (goal,loop,workflow);hya --puredisables user/project bundle commands; an enabled user-installed bundle with the same ID (oroverrides:) cleanly replaces its non-preset first-party counterpart.
Root & shared options
hya [OPTIONS] [COMMAND]Root-only options (bare hya / -p)
| Flag | Default | Description |
|---|---|---|
-p, --print <PROMPT> |
— | Shortcut for a single headless hya exec turn that prints the reply and exits. Always single-turn and never hijacked by bundles (use hya goal for iterative goal mode). |
-c, --continue |
false |
Resume the most recent session for the current directory (bare hya only; conflicts with --resume). |
-r, --resume [<ID>] |
— | Reopen a specific session ID in bare hya, or open the interactive session picker when <ID> is omitted (bare hya only). |
--web-port <PORT> |
3250 |
Browser WebUI port on 127.0.0.1 for bare hya (0 picks any free port). |
--allow-host <HOST> |
Loopback only | Extra Host header name accepted by the daemon bare hya auto-starts (repeatable, e.g. --allow-host hya.lan). |
Bare-only flags (--web-port, root --continue, root --resume, root --allow-host) are rejected before opening SQLite when combined with subcommands or -p.
Shared flags (FlagCaps)
Global configuration flags (--config, --profile) apply across commands that load configuration; the 7 runtime shared flags are defined once at the root and accepted globally, and each command enforces its exact capability mask (FlagCaps), explicitly rejecting any flag it does not honor instead of silently ignoring it:
| Flag | Default | Description |
|---|---|---|
--config <PATH> |
HYA_CONFIG or resolved config.toml |
Use this base backend configuration, including for bundle command discovery and auto-started daemons. |
--profile <NAME> |
HYA_PROFILE, configured profile, or default |
Select a standalone profile beside the active base config. |
--trust <all|limited> |
Saved Project decision, else limited for headless use |
Apply an in-process trust override for headless runs (exec, -p, goal, loop, workflow) without saving to permissions.toml. Rejected on bare hya, server, and acp. |
-m, --model <MODEL> |
Config default_model |
Override the model (provider/model or provider/model#effort). |
--effort <LEVEL> |
Model/agent default | Reasoning effort (none, minimal, low, medium, high, xhigh, max); requires --model and cannot be combined with #effort in --model. |
--yolo |
false |
Select bypass. Skip prompts and honor explicit denials unless bypass_ignores_deny is enabled. |
--bare |
false |
Run with the empty bundle set (conflicts with --bundles), skipping installed and project bundles. Exposes the 8 standard bare tools (read, write, edit, bash, grep, todo, rewrite, skill), optional native Code Mode, and the minimal hya-bare agent while keeping AGENTS.md, disk skills, MCP, and user/project plugins. |
--bundles <SPEC> |
HYA_BUILTIN_BUNDLES or config.toml |
Select installed bundles to enable for this run (conflicts with --bare). Propagates to auto-started daemons. |
--pure |
false |
Ignore external context (AGENTS.md, MCP servers, user/project bundles & plugins, disk skills, and Code Mode). Combinable with --bare or --bundles. |
--db <PATH> |
$XDG_STATE_HOME/hya/sessions.db |
SQLite database file path. Uniform default across all database-backed commands; use --ephemeral (on exec and server run) or :memory: for an in-memory store. |
Capability matrix:
| Command group | --model / --effort |
--yolo |
--bare / --bundles / --pure |
--db |
--trust |
|---|---|---|---|---|---|
exec, -p |
yes | yes | yes | yes | yes |
bare hya, server run|start|restart |
yes | yes | yes | yes | no |
goal, loop (driver commands) |
yes | yes | yes | no | yes |
acp |
yes | no | yes | yes | no |
attach |
yes | no | no | no | no |
config show |
yes | yes | --bare / --bundles |
yes | no |
auth login, provider add|list, model list, doctor, workflow list|info |
no | no | yes | yes | workflow |
agent list, bundle list|search, completions |
no | no | yes | no | no |
config validate|paths, permissions *, server stop|status|logs, relay connect|disconnect|status|link|rotate, auth logout, provider remove, session *, bundle install|upgrade|remove|enable|disable|refresh, update |
no | no | no | yes | no |
config schema, profile list|show, trust *, relay proxy|bridge|doctor, auth status, model default, abi info, bundle registry|mirror|info|schema|pack|verify |
no | no | no | no | no |
Built-in bundle selection (--bundles)
--bundles <SPEC> and HYA_BUILTIN_BUNDLES=<SPEC> compose hya-bare with any subset of installed bundles without editing config.toml.
Precedence (highest to lowest):
--bareor--bundles <SPEC>(mutually exclusive)HYA_BUILTIN_BUNDLES=<SPEC>(when set and non-empty)config.tomlbundles.builtin(defaults tofull)
Specification grammar (<SPEC>):
bare— zero bundles (profile = "bare").full— all installed bundles enabled in the registry (profile = "full").- Comma-separated bundle tokens (additive on
bareunlessfullis first):- Bundle short names or full IDs: e.g.
workfloworhya/workflow,provider-openaiorhya/provider-openai. - Presets:
static/presets(hya/core-agents,hya/core-skills,hya/core-commands),tui(hya/basic-tui-components+static),providers(provider-anthropic,provider-google,provider-openai,provider-grok). - Negation (
-<name>or-<preset>): disables a bundle or preset group (e.g.full,-network,-multi-agentorfull,-providers,provider-openai).
- Bundle short names or full IDs: e.g.
- Invalid bundle IDs and misplaced
bareorfullfail at parse time. Hya skips selected bundles with missing manifestrequires:prerequisites.
# Standalone bare core (zero bundles)hya --bundles bare --model hya/offline exec --ephemeral "hello"
# Workflow + TUI static presets + OpenAI provider onlyhya --bundles workflow,tui,provider-openai
# Full profile minus network and multi-agenthya --bundles full,-network,-multi-agent server run --bind 127.0.0.1:8080
# Inspect enabled built-in commands/bundles via environment variableHYA_BUILTIN_BUNDLES=workflow,tui hya workflow listHYA_BUILTIN_BUNDLES=workflow,tui hya bundle listRuntime environment variables
| Variable | Value | Description |
|---|---|---|
HYA_BUILTIN_BUNDLES |
<SPEC> |
Bundle selection spec (same grammar as --bundles; overridden by --bare or --bundles). |
HYA_RELAY_LINK |
hya://... |
Default secret relay link consumed once by hya attach / hya relay bridge. |
HYA_PREBUILT_BUNDLES_DIR |
<DIR>[:<DIR>...] |
Fallback search directories for prebuilt native bundle shared libraries (.so/.dylib), verified against lockstep abi_digest_v2(). |
HYA_DEV_SKIP_MISSING_BUNDLES |
1 | true |
Dev-only opt-in (ignored under <prefix>/bin/). Skips missing engine native bundles with a warning instead of failing closed. |
Interactive launch & remote attach
Bare hya
Running hya on an interactive terminal finds (or starts) the background daemon for --db (~/.local/state/hya/sessions.db), starts the WebUI on http://127.0.0.1:3250, and opens the TUI in the current directory. Passing hya --bare starts the auto-launched daemon with --bare (zero bundles, hya-bare default agent, standard bare tools, and zero TUI bundles). When stdin or stdout is not a TTY, bare hya prints a short version and usage banner and exits 0.
hya # Open TUI + WebUI (127.0.0.1:3250)hya -c # Continue the most recent session in this directoryhya -r # Open interactive session pickerhya -r hysec_01J... # Resume a specific session IDhya --web-port 8000 # Bind local WebUI to port 8000 (0 for any free port)hya attach
Connect the TUI and local WebUI to an existing HTTP/gRPC backend URL or a remote hya:// relay link (automatically starting an in-process loopback bridge for relay links):
hya attach [<URL | LINK | ->] [--web-port <PORT>] [-c | -r [<ID>]] [--transport auto|grpc|ws] [--ca <PEM>]| Flag / Arg | Description |
|---|---|
<TARGET> |
http://... / https://... backend URL, hya://... relay link, - to prompt for a relay link without echoing, or omitted to read $HYA_RELAY_LINK. |
--web-port <PORT> |
Local WebUI port (default 3250; 0 picks a free port). |
-c, --continue |
Resume the most recent session for the current project on the target server. |
-r, --resume [<ID>] |
Reopen a specific session ID or open the picker. |
--transport <MODE> |
Relay transport binding (auto, grpc, ws; relay links only). |
--ca <PEM> |
Extra trusted TLS root CA PEM file (relay links only). |
hya attach http://127.0.0.1:8080hya attach - # Prompts securely for a hya:// relay linkHYA_RELAY_LINK="hya://..." hya attach # Consumes link from environmenthya acp (Editor integration)
hya [--db <PATH>] [--model <MODEL>] acp [--temp]Runs the Agent Client Protocol (ACP v1) JSON-RPC 2.0 server on stdin/stdout for editors such as Zed, attaching to (or auto-starting) the local database’s Hya daemon. --temp opens every new session as a temp chat: the daemon deletes it once the editor closes it or exits, and it registers no Project (for an orchestrator’s title and metadata generation).
Headless commands
hya exec and hya -p / --print
Run a single prompt non-interactively and print the reply. Pass - as <PROMPT> to read from stdin.
hya exec [OPTIONS] <PROMPT | ->hya -p <PROMPT | ->| Flag | Description |
|---|---|
--json |
Stream committed Event envelopes as newline-delimited JSON (JSONL) on stdout. |
--include-subagents |
With --json (in-process mode), include events from spawned child and grandchild subagents. |
--time-budget <SECS> |
Wall-clock budget in seconds; injects progress/wrap-up notices and caps per-call bash waits. |
-c, --continue |
Continue the most recent active session on --db (conflicts with --session and --ephemeral). |
-s, --session <ID> |
Continue a specific persisted session ID on --db (conflicts with --continue and --ephemeral). |
--ephemeral |
Run on a transient in-memory SQLite store instead of persisting to --db. |
hya exec "summarize the failing unit tests"hya exec -c "now fix the first failure"hya exec --ephemeral --json "benchmark prompt"hya -p "explain crates/hya-core/src/lib.rs"hya exec --time-budget 900 'Run `cd /tmp && nohup sleep 30 >job.log 2>&1 &` using bash, then report the result.'With --time-budget, each bash call waits at most one tenth of the run
budget, subject to its own timeout and the time left in the run. The tool
returns the shell’s [exit code: N] as soon as the shell exits. Jobs
started with & can outlive the run. Redirect stdout and stderr to keep
their output in a separate log, as in the example above. A foreground
command that yields [still running: …] stays under supervision, with
paths to its output and exit code in the result. Run shutdown stops
yielded groups still under supervision. Cancellation and hard budget
stops terminate processes and threads in the original group.
The budget also limits reasoning-only model steps so the run has time to act. At the WrapUp checkpoint, the kernel can give a step up to 90 seconds of minimum reasoning time, limited by half the time before Final and by the per-step cap. Final uses the regular short grace. If text, a tool call, or the final message frame is already buffered at expiry, the guard gives it a bounded chance to arrive before interrupting. A cut gives the next step an excerpt of the reasoning so it can continue. See Kernel & Context Engine for the timer and frame handling contract.
hya goal ([from: hya/goal])
hya goal <GOAL> [--max-iterations <N>] [--evaluator-model <MODEL>]Contributed by the built-in native bundle hya/goal (routed to driver hya/goal:goal). Runs iterative worker turns in memory until an independent evaluator confirms <GOAL> is met or --max-iterations (default 6) is reached. Absent under --bare or when hya/goal is disabled.
hya loop ([from: hya/loop])
hya loop <TARGET> [--until <CMD> | --while <CMD>] [--max-iterations <N>] [--evaluator-model <MODEL>]Contributed by the official native bundle hya/loop (routed to driver hya/loop:loop). Iterates toward <TARGET> up to --max-iterations rounds (default 10, clamped to 1..=100). With --until, stops when <CMD> exits 0 (continues on exit 1); --while inverts the predicate; any exit code other than 0/1 aborts as a broken condition. Absent under --bare or when hya/loop is disabled.
Server & daemon commands (hya server)
All daemon commands operate on --db (~/.local/state/hya/sessions.db by default).
| Command | Description |
|---|---|
hya server run [--bind 127.0.0.1:8080] [--ephemeral] [--allow-host <HOST>]... [--relay <URL> ...] |
Run the foreground HTTP/JSON+SSE+WS and hya.v2 gRPC server (prints hya server listening on <url> when ready). Use --ephemeral for an in-memory store. |
hya server start [--bind ...] [--allow-host <HOST>]... [--relay <URL> ...] [--json] |
Start the detached background daemon if not already running (--relay-transport, --relay-ca, --relay-ephemeral, --relay-heartbeat). |
hya server status [--json] |
Print URL, PID, version, database path, uptime, log path, and relay status (exits 1 if stopped). |
hya server stop [--force] [--timeout <SECS>] |
Drain active turns and stop the daemon cleanly (default timeout 45s; --force sends SIGKILL after timeout). |
hya server restart [--force] [--timeout <SECS>] [--json] |
Stop the running daemon and start a fresh one, preserving relay and --allow-host settings and restoring interrupted sessions. |
hya server logs [-n, --lines <N>] [-f, --follow] |
View or stream the daemon log file (<db>.server.log, default last 100 lines). |
Configuration and profiles
| Command | Output and behavior |
|---|---|
hya config schema [config|models|profile|tui|permissions] [-o|--output PATH] |
Emit the named Draft 2020-12 JSON Schema with a trailing newline. Defaults to config and writes to stdout unless given an output path. |
hya config validate [--profile NAME] [--dir PATH] [--json] |
Check the base, profile ancestors, applicable registered Project files, active models declarations, the resolved permissions file and selected preset, and optional TUI TOML. Model checks run offline. The TUI check parses TOML and requires version 2 when declared. --dir selects the directory for Project lookup. JSON is {"ok":true} or {"ok":false,"error":"…"}. Failure exits nonzero. |
hya config show [--effective] [--profile NAME] [--json] |
Print merged configuration as pretty JSON before credential resolution. --effective adds per-key source annotations in text. JSON contains effective and a provenance array of {key: string[], sources: string[]}. Secret-bearing values are masked as <redacted>. Literal {env:VAR} references may be shown. |
hya config paths [--profile NAME] [--json] |
Print resolved paths and active profile. Unavailable values are null in JSON and omitted in text. |
hya profile list |
List standalone profiles in name order, one per line with an optional tab-separated description. |
hya profile show <name> |
Print the profile path, inheritance chain, optional description, and merged profile overrides as JSON (with secrets redacted). |
config paths --json returns hya_home, config_dir, data_dir,
state_dir, cache_dir, config_file, models_file, permissions_file,
profiles_dir, active_profile, active_profile_file, auth_file, tui_config_file,
tui_state_file, models_registry_cache, models_discovered_dir, db_file,
project_root, project_config_file, and project_local_config_file.
hya profile listhya --profile review config validate --dir "$PWD" --jsonhya config show --profile review --effectiveThe global --config and --profile flags work before or after subcommands.
See Configuration for schemas and layer precedence.
Relay commands (hya relay)
All relay infrastructure and daemon relay-control commands live under hya relay:
| Command | Description |
|---|---|
hya relay proxy [--bind 0.0.0.0:8766] [--tls-cert <PEM> --tls-key <PEM>] [--path-prefix <PATH>] [--trust-forwarded <HEADER>] [--max-rooms <N>] [--max-streams-per-room <N>] [--idle-timeout <SECS>] [--drain-timeout <SECS>] [--stream-rate <BPS>] [--json] |
Run the stateless, blind hya.relay.v1 rendezvous proxy. |
hya relay bridge [<LINK>|-] [--bind 127.0.0.1:0] [--transport auto|grpc|ws] [--ca <PEM>] [--json] [--exit-with-stdin] |
Open a local loopback HTTP bridge to a remote backend over Noise NKpsk0 (prints URL and x-hya-bridge-token). |
hya relay doctor <PROXY_URL_OR_LINK> [--ca <PEM>] [--timeout <SECS>] [--measure-idle] [--json] |
Probe TLS, gRPC, and WebSocket relay paths end to end and recommend a transport binding. |
hya relay connect <URL> [--transport ...] [--ca <PEM>] [--ephemeral] [--heartbeat <SECS>] [--json] |
Attach the running daemon of --db to a relay and print its secret hya:// link once. |
hya relay disconnect [--json] |
Disconnect the running daemon of --db from the relay. |
hya relay status [--json] |
Show the running daemon’s relay state, room ID, redacted link, and active stream count. |
hya relay link [--json] |
Print the running daemon’s full secret hya:// link ({"link": "..."} with --json). |
hya relay rotate [--json] |
Rotate the pre-shared key, revoking all previous links immediately and printing the new link. |
Auth, Provider, Model & Agent commands
hya auth
| Command | Description |
|---|---|
hya auth login <PROVIDER> [--api-key-stdin] |
Save a static API key for <PROVIDER> in data-root auth.json ($XDG_DATA_HOME/hya/auth.json, mode 0600). Prompts with hidden echo on a TTY, or reads stdin with --api-key-stdin. Never accepts raw secrets in argv. |
hya auth login <PROVIDER> --oauth <TYPE> [--browser|--no-browser] [--loopback] [--register-model <ID>] [--base-url <URL>] |
Sign in via subscription OAuth (openai-codex, grok-build, etc., from enabled provider bundles). Honors --bare, --bundles, and --pure. |
hya auth logout <PROVIDER> |
Remove saved credentials for <PROVIDER> from auth.json and sync any running daemon. |
hya auth status [<PROVIDER>] [--json] |
Show non-secret credential status (API key / OAuth expiry) across providers. |
hya provider
| Command | Description |
|---|---|
hya provider add [--name <ID>] [--base-url <URL>] [--protocol <KIND>] [--api-key <KEY> | --api-key-stdin] [-y] |
Interactive or scripted wizard to configure a provider in models.toml, verify credentials against /models, and sync a running daemon. |
hya provider list [--refresh] [--json] |
List configured providers with protocol, base URL, auth status, and discovered model count. |
hya provider remove <ID> [-y] |
Remove a provider from models.toml, delete its saved credentials, and clear its cached models. |
hya model
| Command | Description |
|---|---|
hya model list [<PROVIDER>] [--refresh] [--json] |
List effective provider/model entries from cache and config (--json emits full metadata objects; --refresh re-fetches remote model lists). |
hya model default [<MODEL>] [--json] |
Show or update default_model in config.toml (provider/model or provider/model#effort). |
hya agent
| Command | Description |
|---|---|
hya agent list [--json] |
List selectable agents and their roles from the active catalog (honors --bare, --bundles, --pure). |
Session commands (hya session)
| Command | Description |
|---|---|
hya session list [--all | --archived] [--json] |
List persisted sessions on --db newest-first (--all includes child subagents and archived roots; --archived shows archived roots only). |
hya session archive <SESSION_ID> |
Archive a root session (routes through a running daemon when active). |
hya session unarchive <SESSION_ID> |
Unarchive a root session. |
hya session events <SESSION_ID> |
Dump a session’s complete durable event log as JSONL (read-only; never takes the write lock). |
Workflow & Bundle commands
hya workflow ([from: hya/workflow])
Contributed by the installed ABI v2 native bundle hya/workflow (cli: in its bundle.yaml); each subcommand calls one of the bundle’s cli_* endpoints and prints its reply. Under --bare, or with hya/workflow disabled in config.toml, there is no workflow command: hya reports unrecognized subcommand 'workflow' and exits 2.
list and info (database: read) only read --db: they never take its lock or go through its server; an existing database is opened read-only to find the working directory’s Project, and hya invokes hya/workflow’s handler directly without starting SessionEngine, native services, provider libraries, or Code Mode, while honoring config.toml bundles.builtin. User-tier Workflows use the resolved config root, including the Workflow-only fallback described in Environment Variables & File Paths. Installed bundles that cannot be read and project bundles that fail to load are printed as warning: … lines on stderr. use, run, and state (database: true) hold the database lock or go through the server that owns --db; a routed run forwards --revision to the server and exits 75 with --pure or --yolo.
hya workflow list [--json]hya workflow info <NAME> [--json]hya [--db <DB>] workflow use <NAME> --session <SESSION_ID> [--revision <REV>]hya [--db <DB>] workflow run [<NAME>] [--session <SESSION_ID>] [--input KEY=VALUE]... [--revision <REV>] [--json]hya [--db <DB>] workflow state --session <SESSION_ID> [--json]Bundle API surface (hya/workflow):
| Method & Scope | Path | Payload / Response |
|---|---|---|
GET (global) |
/v2/bundles/hya%2Fworkflow/api/workflows?directory=<abs> |
{ "workflows": WorkflowSummary[] } |
GET (session) |
/v2/sessions/{id}/bundles/hya%2Fworkflow/state |
WorkflowProjection (extensions["hya/workflow"]) |
POST (session) |
/v2/sessions/{id}/bundles/hya%2Fworkflow/command |
Body: { list } | { state } | { info: { name } } | { select: { name, expectedRevision? } } | { run: { name?, expectedRevision?, inputs?, run?, delivery?: "started"|"finished" } } |
POST (global) |
/v2/bundles/hya%2Fworkflow/api/cli/list, …/cli/info |
hya workflow list|info: body { "args": {…}, "cwd": "<abs>" }, reply { stdout, stderr, exit_code } |
POST (session) |
/v2/sessions/{id}/bundles/hya%2Fworkflow/cli/use, …/cli/run, …/cli/state |
hya workflow use|run|state: same body and reply |
hya bundle
See the registry protocol for profiles, mirrors, and Sigstore verification.
Manage .hyabundle packages across builtin, user (~/.local/share/hya/bundles/registry.sqlite3), and project (./.hya/bundles/) scopes using the unified --scope option:
| Command | Description |
|---|---|
hya bundle install [--scope user|project] [-y] [--overwrite] <PACKAGE> |
Verify, self-check, and install a .hyabundle package (default scope user). |
hya bundle install [--scope user] [-y] [--overwrite] --sigstore <PATH> <PACKAGE> |
Verify detached official Sigstore provenance offline and install the package into the user registry. |
hya bundle install [--scope user|project] [-y] [--overwrite] --claude <SOURCE> |
Convert and install a Claude Code plugin directory or <marketplace>#<entry> (conflicts with <PACKAGE>). |
hya bundle remove [--scope user|project] [-y] <BUNDLE_ID> |
Uninstall a bundle. |
hya bundle enable <BUNDLE_ID> / disable <BUNDLE_ID> |
Enable or disable a bundle across scopes without uninstalling it. |
hya bundle refresh |
Reload edited project bundles and bundle TOML files in the running daemon. |
hya bundle pack <SOURCE_DIR> <OUTPUT.hyabundle> |
Build a deterministic public .hyabundle archive from a bundle source directory. |
hya bundle verify [--scope user|project] [--overwrite] [--strict] [--protocol-smoke] [--json] <PACKAGE_OR_DIR> |
Dry-run install and self-proof checks against a .hyabundle archive or source directory (--strict checks schema/descriptors/secret hygiene; --protocol-smoke verifies JS JSON-RPC initialize/shutdown parity). |
hya bundle list [--scope all|builtin|user|project] [--json] |
List bundles across scopes (NAME VERSION AGENT STATE KIND SCOPE, or a JSON array with --json). |
hya bundle info [--scope all|builtin|user|project] [--registry <NAME_OR_URL>] [--json] <BUNDLE_ID | PACKAGE> |
Inspect an installed bundle ID, a .hyabundle package file (auto-detected), or a remote registry manifest. |
hya bundle search [--scope all|builtin|user|project] [--remote] [--installed] [--registry <NAME_OR_URL>] [--json] <QUERY> |
Case-insensitive search across local or remote bundle, agent, skill, and tool IDs. |
hya bundle schema [--scope all|builtin|user|project] [--json] <BUNDLE_ID | PACKAGE> |
Show custom URI schemes (schemas:) declared by a bundle. |
Static registries
A static registry publishes searchable bundle manifests, pinned profiles, and
artifact download links. It lets you install through the same confirmation and
self-check flow as a local package. Registry installs resolve transitive
requires entries before installing dependents.
| Command | Contract |
|---|---|
hya bundle registry list [--json] |
List effective names and URLs. JSON output is an array of objects with string fields name and url. |
hya bundle registry add <NAME> <URL> |
Add or replace a named registry root. |
hya bundle registry remove <NAME> |
Remove a named registry. Removing official disables the implicit default. |
hya bundle registry refresh [NAME] |
Fetch or revalidate the selected index, or all configured indexes when omitted. |
hya bundle search <QUERY> [--remote] [--installed] [--registry <NAME>] |
Search local metadata by default. A remote selector searches index IDs, summaries, tags, and capabilities and prints NAME VERSION RUNTIME TRUST INSTALLED REGISTRY. Pass an empty query to list the remote catalog. --installed filters to installed user or project bundles. |
hya bundle info <TARGET> [--registry <NAME>] |
Inspect a local package or catalog entry, then look up a missing qualified ID remotely. An explicit registry selects the remote manifest and prints its v1 JSON. |
hya bundle install <publisher/name[@version]> [--registry <NAME>] [--scope user|project] [--overwrite] [--require-official] [--from-source] [--auto-toolchain] [-y] |
Resolve a bundle ID, optionally pinned to an exact SemVer, then verify and install its closure. |
hya bundle install --profile <NAME> [--registry <NAME>] [--scope user|project] [--overwrite] [--require-official] [-y] |
Resolve and install a named profile. Choose one install source from a positional target, --profile, or --claude. |
hya bundle install 'git:<url>[?subdir=<path>]#<ref>' [--registry <NAME>] [--auto-toolchain] [--scope user|project] [--overwrite] [-y] |
Build and install a native bundle from the Git commit resolved by the ref. |
hya bundle upgrade [BUNDLE_ID | --all] [--registry <NAME>] [-y] |
Check installed user bundles for newer compatible releases and install their closures. |
hya bundle mirror --profile <NAME> --target <TRIPLE> [--abi-digest <HEX>] --out <DIR> [--registry <NAME>] |
Export a profile and its dependency closure from its source registry. The ABI digest defaults to the running host’s digest. Use an absent or empty output directory. |
The default official root is
https://raw.githubusercontent.com/chrono-foundry/hya-registry/main.
HYA_REGISTRY_URL overrides this default. A saved official entry takes
precedence. Registry configuration lives at
$XDG_CONFIG_HOME/hya/bundle-registries.json (default
$HOME/.config/hya/bundle-registries.json). It accepts the optional Boolean
official_disabled and an optional registries array of
{"name":"…","url":"…"} entries. Bundle and profile lookup uses the first
matching registry, starting with official then configuration order. Profile
installation gives the selected profile’s registry first priority for its
bundle lookups. Registry roots use HTTPS, loopback HTTP, or a local file://
URL. --registry also accepts a direct file:// mirror URL.
Discovery uses /.well-known/hya-registry.json (protocol_version: 1). A
missing discovery document selects /v1/index.json,
/v1/bundles/<publisher>/<name>.json, /v1/profiles/<name>.json,
/v1/abi/<abi_digest>.json, and /v1/advisories.json. The index is cached
with its ETag under $XDG_CACHE_HOME/hya/registry/<name>/ (default
$HOME/.cache/hya). Portable archives use target: "any". Native archives
must match the Rust target triple, ABI version, and ABI digest. Downloads
must match the manifest’s byte size and SHA-256. Official releases require
detached Sigstore proof. Published proofs are verified before installation,
and verified user-scope installs persist their provenance. Signed advisory lists block yanked bundle IDs and archive digests. Official
HTTPS registries require signed advisories.json.sigstore.json; third-party
HTTPS registries and local file:///loopback registries permit unsigned
advisories.json unless --require-official or an official Sigstore artifact
is requested, and HTTPS registries cannot downgrade to non-HTTPS URLs.
hya bundle search --remote ""hya bundle search plan --remotehya bundle install --profile default -yhya bundle mirror --profile default --target x86_64-unknown-linux-gnu --out ./offlinehya bundle install --profile default --registry "file://$PWD/offline" -yBuild a native bundle from source
Use --from-source to allow a source build when a registry release has a
pinned recipe and no compatible prebuilt archive. A Git target always builds
from source. It accepts an HTTPS or local file:// URL, a Git ref after
#, and an optional ?subdir=<path> relative to the checkout. Put
bundle.yaml in that directory and specify its native library under
runtime.library. The Cargo manifest defaults to Cargo.toml alongside it,
or follows the relative runtime.crate_dir or registry recipe.
hya bundle install example/native@1.2.3 --from-source --auto-toolchainhya bundle install "git:file://$PWD/my-bundle?subdir=bundles/native#v1.2.3" -yBefore Cargo runs, Hya prints the resolved commit, target, and exact
rustc -V string and asks for confirmation. Cargo build scripts can execute
code as your user. For automation, -y (--yes) supplies consent. Use
--auto-toolchain to install and select the pinned compiler with Rustup.
Hya checks the resolved Cargo lock against Cargo.lock.abi and verifies the
compiled library’s exported ABI digest before installing it at local trust.
Hya caches extracted SDKs under $XDG_CACHE_HOME/hya/abi-sdk/<digest>/ and
Cargo artifacts under $XDG_CACHE_HOME/hya/native-build-target/<digest>/
(default $HOME/.cache/hya/). Set HYA_ABI_SDK_DIR to an extracted SDK or
HYA_ABI_SDK_ARCHIVE to a local SDK archive path or file:// URL.
The extracted directory takes precedence over the cache, which takes
precedence over the archive override and registry download.
HYA_NATIVE_BUILD_TARGET_DIR overrides the Cargo target directory.
Use a detached Sigstore bundle to install an official release that requests
tool_plane: full.
hya bundle install --sigstore plan.hyabundle.sigstore.json plan.hyabundlehya bundle info --scope user hya/plan--sigstore <PATH> takes a Sigstore bundle JSON file authenticating the
SHA-256 of the exact .hyabundle archive. It accepts user-scope package installs
and checks the official release policy from the Open Static Registry Protocol before confirmation,
package self-checks, or registry writes. An unreadable, invalid, mismatched,
or unofficial proof aborts installation. Unsigned installs and project bundles
use the local tier and the internal_public tool plane. Reinstall the same
archive with its proof to add provenance to an existing unsigned install.
User-scope bundle info and install output report trust_tier=<tier>. The
registry stores the claimed tier (local, verified, or official), archive
SHA-256, detached JSON, and the signed archive for offline re-verification.
Loading checks the signature and matches the signed prepared payload against
the installed payload. Invalid stored official provenance yields local.
Only a verified official install that declares tool_plane: full gets that
plane. Bundles loaded from the trusted in-tree or release-prefix sources retain
their existing full-plane eligibility during the distribution transition.
Publication vs. activation: Package publication validates the merged catalog after first-party shadowing, the complete installed
BundleCatalog, and reserved core Agent ids before atomic generation publication. At runtime, each JavaScript activation materializes only the selected Agent’s captured Tool/Hook/Skill capability closure and exact-path-matched JavaScript Extension entrypoints.
Diagnostics, ABI Info, Shell Completions & Self-Update
hya doctor
hya doctor [--json]Checks local environment health and exits 0 when all checks are ok/warn or 1 when any check fails:
config.tomlpresence,schema_version = 3validity,default_model, and provider count- Auth directory permissions and saved credentials (
auth.json) - Database path and running daemon status (
--db) - Enabled bundle selection and CLI contribution integrity
- Bun runtime and TUI/WebUI asset availability
JSON output shape (hya doctor --json):
{ "ok": true, "version": "0.52.0", "checks": [ { "name": "config", "status": "ok", "detail": "..." } ]}hya abi info
hya abi info [--json]Prints the running host’s Lockstep Native ABI v2 identity (hya_version, target, rustc, abi_version, abi_digest, and abi_id). Use this to verify target compatibility with prebuilt .hyabundle packages or offline mirrors (see Open Static Registry Protocol v1).
hya completions
hya completions <bash | zsh | fish | powershell>Generates a shell completion script dynamically from the live hya command tree — automatically including all currently enabled user and project bundle commands (honors --bare, --bundles, --pure).
# Basheval "$(hya completions bash)"
# Zsheval "$(hya completions zsh)"
# Fishhya completions fish | sourcehya update
hya update [--version <VERSION>] [--prefix <DIR>] [--force] [--registry <NAME_OR_URL>] [--from-source [--auto-toolchain] [-y]]Downloads, SHA-256 verifies, and atomically installs a published GitHub release archive, checking the new release’s native ABI before replacing any installed user bundle:
- If
abi_digest_v2is unchanged, the user bundle registry is left untouched. - When the ABI changes, Hya stages and verifies native bundle replacements for the new target and ABI (including published archive checksums and Sigstore proofs where provided) and commits them in one registry transaction while preserving disabled state.
- If a replacement is unavailable or fails verification, Hya reports the affected bundle IDs and rolls back the executable and runtime assets. A running daemon is restarted after a successful binary update.
--registryselects a configured registry name or a directfile://mirror.--from-sourcepermits pinned source builds for missing native archives (--auto-toolchainpermits installing the exact Rust toolchain via rustup;-ysupplies non-interactive consent).
hya update --version v0.47.0 --registry "file://$PWD/offline"Use hya --version (-V) to print the installed version.
Offline Migration (hya-migration)
The standalone hya-migration binary (shipped alongside bin/hya) performs offline v1 → v2 and Config v2 → v3 upgrades (or a single-run v1 → v2 → v3 upgrade) with automatic SHA-256 backup snapshots and byte-exact verified rollback. It covers sessions.db, config.yaml + per-bundle bundles/<percent-encoded>/config.yml → config.toml (v3) + models.toml (v1), auth/*.yaml → $XDG_DATA_HOME/hya/auth.json (0600), tui.toml/tui.json → tui.toml (v2) + $XDG_STATE_HOME/hya/tui-state.json, legacy model_cache.db retirement, .hya/bundles/, and registry.sqlite3. See Migrating from Config v2 to v3 and Migrating from Hya v1 to v2 for full mapping tables and backup manifest details.
hya-migration [--json] check [--db <PATH>] [--config <PATH>] [--auth-dir <DIR>] [--auth-json <PATH>] [--tui-toml <PATH>] [--tui-json <PATH>] [--tui-state <PATH>] [--model-cache-db <PATH>] [--registry <PATH>] [--bundles-dir <DIR>]...hya-migration [--json] run [--dry-run] [--backup-dir <DIR>] [TARGET_FLAGS...]hya-migration [--json] rollback --backup <DIR>Database lock & exit codes
Only one writer may hold a file-backed SQLite database (<db>.runtime-owner.lock) at a time:
- When a daemon holds
<db>(and published<db>.server.json), commands likehya --db <db> exec,hya workflow run, andhya session archiveautomatically route through that running server over/v2. - Commands with flags a running server cannot honor per-call (such as
exec --bare,exec --bundles,exec --pure, or a secondhya server runon the same DB) refuse cleanly with exit code75. - Read-only commands (
hya session list,hya session events, anddatabase: readbundle commands such ashya workflow list|info) never take the write lock and work anytime.
| Exit code | Meaning |
|---|---|
0 |
Success (including clean daemon SIGTERM/SIGINT drain). |
1 |
General runtime, validation, provider, or doctor failure. |
2 |
CLI argument / flag parsing error. |
75 |
Database is owned by another process (EX_TEMPFAIL), or flag cannot route through the running server. |
130 |
Interrupted by Ctrl+C (SIGINT). |
143 |
Terminated by SIGTERM. |
Project trust and saved permission rules
Use hya trust to decide whether a checkout may contribute its local configuration,
extensions, and skills. The decision is stored by canonical directory in the active
profile’s permissions.toml. Use hya config paths to find that file and
hya config validate to check its rules and presets.
hya trust set <none|limited|all> [PATH]hya trust <none|limited|all> [PATH]hya trust <PATH> <none|limited|all>hya trust show [PATH]hya trust list [--json]hya permissions show [--dir PATH] [--profile NAME] [--json]hya permissions list [--json]hya permissions add <allow|ask|deny> RULE [--project PATH]hya permissions revoke ID_OR_RULE [--project PATH]Paths default to the working directory for trust set, trust show, and
permissions show. Use none to block the Project, limited to open with
user-local resources, or all to also load repository resources. Headless
commands open undecided directories with limited trust. For an in-process run,
hya --trust all exec "summarize this project" applies that level for the
invocation. An explicit block takes precedence. ACP and commands routed to an
existing server use that server’s trust policy and reject a client-side
--trust override. hya trust show prints the canonical path and saved
level (or undecided), followed by the detected repository artifacts.
For example, hya permissions add allow 'Bash(git status)' --project . saves a
Project rule. Rules added without --project are global. To revoke by text,
supply the original Project scope. A rule ID from permissions list identifies
its scope and bucket.
| Command | JSON output |
|---|---|
hya trust list --json |
Array of {path: string, trust: "none" | "limited" | "all"} entries for saved decisions. |
hya permissions list --json |
Array of {id: string, scope: string, bucket: "allow" | "ask" | "deny", rule: string} entries for global and Project rules. scope is global or a canonical root path. |
hya permissions show --json |
Object with default_mode (string), bypass_ignores_deny (boolean), allow, ask, deny, and additional_directories (string arrays), and effective trust (none, limited, or all). |
See the v2 API reference for the
Project.GetProjectTrust, Project.SetProjectTrust, and
Interactions.ListSavedRules and Interactions.DeleteSavedRule contracts.