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.

ArgumentWhereWhat it does
--helpevery commandEvery legal shape of that command, complete, plus its subcommands. JSON by default; --output plain for a terminal.
--versionafui onlyName, version, and build identity as one protocol result.
--docsafui onlyThis document, rendered from the registry.
--output <FORMAT>per output contractRender as json, yaml, plain (default json).
--output-to <DESTINATION>per output contractRoute results and diagnostics to split, stdout, stderr (default split).
--stdout-file <PATH>, --stderr-file <PATH>per output contractAppend 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 check <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>] [--safe-mode]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend scope
--safe-modeIgnore 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]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend scope
--safe-modeIgnore 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>]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend scope

afui frontend disable

Remove explicit trust for one frontend.

afui frontend disable <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend scope

afui frontend enable

Explicitly trust the current contents of one frontend.

afui frontend enable <PROVIDER_ID> <UI_KIND> [--scope <workspace|global>]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend 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>]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend scope
--frontend-idStable identifier for this frontend implementation
--ui-api-versionProvider-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]
ArgumentMeaning
PROVIDER_IDStable Provider identifier
UI_KINDStable UI kind identifier
--scopeFrontend scope
--safe-modeIgnore 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:

ArgumentMeaning
--agentAgent to manage
--scopeSkill scope
--skills-dirDirectory that contains skill folders
--forceOverwrite 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:

ArgumentMeaning
--agentAgent to manage
--scopeSkill scope
--skills-dirDirectory 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:

ArgumentMeaning
--agentAgent to manage
--scopeSkill scope
--skills-dirDirectory that contains skill folders
--forceOverwrite or remove an unmanaged Agent-First UI skill at the target path

Exit codes

CodeMeaning
0The command ran and succeeded.
1The command ran and failed. The event carries a domain error.code.
2The 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.