afui CLI reference
Create, validate, trust, inspect, and compare Provider-owned UI frontends.
afui is compiled from a closed cli-spec-v1 registry: one source for argv parsing, typed invocation values, which parameter combinations are legal, output contracts, and help. An invocation runs only when it matches exactly one registered combination.
Global arguments
AFDATA registers these itself, so the syntax in Commands leaves them out.
| Argument | Where | What it does |
|---|---|---|
--help | every command | Every legal shape of that command, complete, plus its subcommands. JSON by default; --output plain for a terminal. |
--version | afui only | Name, version, and build identity as one protocol result. |
--docs | afui only | This document, rendered from the registry. |
--output <FORMAT> | per output contract | Render as json, yaml, plain (default json). |
--output-to <DESTINATION> | per output contract | Route results and diagnostics to split, stdout, stderr (default split). |
--stdout-file <PATH>, --stderr-file <PATH> | per output contract | Append that stream to a file instead. |
Success output is protocol events, on those terms, unless a command’s own Output line says otherwise.
A shape is one legal set of arguments that may appear together, under a stable id. Where a command has more than one, each id is a heading below. --help returns them all at once, so discovering a command costs one call; there is no recursive mode across commands, and this document is that view.
Commands
afui frontend check— Validate one frontend and report its trust state.afui frontend dev— Prepare a validated frontend for Provider-owned development.afui frontend diff— Compare workspace and global frontend files.afui frontend disable— Remove explicit trust for one frontend.afui frontend enable— Explicitly trust the current contents of one frontend.afui frontend init— Create a frontend directory and manifest.afui frontend preview— Prepare a validated frontend for Provider-owned preview.afui skill install— Install the Agent-First UI skill.afui skill status— Show whether the Agent-First UI skill is installed, valid, and up to date.afui skill uninstall— Remove an afui-managed Agent-First UI skill.
afui frontend check
Validate one frontend and report its trust state.
afui frontend check <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>] [--safe-mode]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
--safe-mode | Ignore user frontend code before reading its manifest |
afui frontend dev
Prepare a validated frontend for Provider-owned development.
afui frontend dev <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>] [--safe-mode]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
--safe-mode | Ignore user frontend code before reading its manifest |
afui frontend diff
Compare workspace and global frontend files.
afui frontend diff <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
afui frontend disable
Remove explicit trust for one frontend.
afui frontend disable <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
afui frontend enable
Explicitly trust the current contents of one frontend.
afui frontend enable <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
afui frontend init
Create a frontend directory and manifest.
afui frontend init <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>] --frontend-id <FRONTEND_ID> [--ui-api-version <VERSION>]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
--frontend-id | Stable identifier for this frontend implementation |
--ui-api-version | Provider-defined typed UI API version |
afui frontend preview
Prepare a validated frontend for Provider-owned preview.
afui frontend preview <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>] [--safe-mode]
| Argument | Meaning |
|---|---|
PROVIDER_ID | Stable Provider identifier |
UI_KIND | Stable UI kind identifier |
--scope | Frontend scope |
--safe-mode | Ignore user frontend code before reading its manifest |
afui skill install
Install the Agent-First UI skill.
skill-install-every-agent — Target every agent that supports the scope
afui skill install [--agent all] [--scope <personal|workspace>] [--force]
skill-install-one-agent — Target one named agent; only this shape accepts –skills-dir
afui skill install --agent <codex|claude-code|opencode|hermes> [--scope <personal|workspace>] [--skills-dir <DIR>] [--force]
Arguments across every shape above:
| Argument | Meaning |
|---|---|
--agent | Agent to manage |
--scope | Skill scope |
--skills-dir | Directory that contains skill folders |
--force | Overwrite or remove an unmanaged Agent-First UI skill at the target path |
afui skill status
Show whether the Agent-First UI skill is installed, valid, and up to date.
skill-status-every-agent — Target every agent that supports the scope
afui skill status [--agent all] [--scope <personal|workspace>]
skill-status-one-agent — Target one named agent; only this shape accepts –skills-dir
afui skill status --agent <codex|claude-code|opencode|hermes> [--scope <personal|workspace>] [--skills-dir <DIR>]
Arguments across every shape above:
| Argument | Meaning |
|---|---|
--agent | Agent to manage |
--scope | Skill scope |
--skills-dir | Directory that contains skill folders |
afui skill uninstall
Remove an afui-managed Agent-First UI skill.
skill-uninstall-every-agent — Target every agent that supports the scope
afui skill uninstall [--agent all] [--scope <personal|workspace>] [--force]
skill-uninstall-one-agent — Target one named agent; only this shape accepts –skills-dir
afui skill uninstall --agent <codex|claude-code|opencode|hermes> [--scope <personal|workspace>] [--skills-dir <DIR>] [--force]
Arguments across every shape above:
| Argument | Meaning |
|---|---|
--agent | Agent to manage |
--scope | Skill scope |
--skills-dir | Directory that contains skill folders |
--force | Overwrite or remove an unmanaged Agent-First UI skill at the target path |
Exit codes
| Code | Meaning |
|---|---|
| 0 | The command ran and succeeded. |
| 1 | The command ran and failed. The event carries a domain error.code. |
| 2 | The invocation was rejected before anything ran. error.code is one of the cli_* codes below. |
The split is the useful one for a caller: exit 2 means the call was never made, so retrying it unchanged cannot help, while exit 1 means it was.
CLI errors
Every structural failure emits one strict JSON kind:"error" event on stderr, leaves stdout empty, and exits 2. The code names the failure — cli_unknown_argument for an unknown spelling, cli_unregistered_combination for registered arguments in a mixture that is not, and one each for cli_unknown_command, cli_missing_argument_value, cli_invalid_argument_value, cli_duplicate_argument, cli_unexpected_positional, and cli_invalid_utf8. message names the offending argument and hint gives the command to run next; neither ever quotes a raw value, including secrets. These are decided before any config, secret source, filesystem, network, or domain I/O.
Domain failures (exit 1) carry their own stable error.code instead, drawn from whatever this tool defines rather than from the cli_* set. No error message quotes a raw value it was given — an error event is routinely logged, and the input may hold secrets.