Web UI CLI
Initialize, generate, validate, audit, inspect, and preview a web theme through the explicit tavo-ui web command group.
Use the explicit web command group
tavo-ui is bundled with @tavojs/ui and has a different responsibility from the framework's tavo command. Web commands forward to the installed UI package and read tavo-ui.config.json unless another path is provided.
bashnpx tavo-ui web init
npx tavo-ui web check --config tavo-ui.config.json
npx tavo-ui web audit --config tavo-ui.config.json
npx tavo-ui web tokens --config tavo-ui.config.json --mode light
npx tavo-ui web preview --config tavo-ui.config.json --out theme-preview.htmlChoose commands by outcome
init writes a starter config and refuses to overwrite an existing one.
generate writes physical theme CSS when a project needs a file outside plugin injection.
check prints readable validation and contrast diagnostics.
audit emits structured results for CI and tooling.
tokens prints JSON, CSS, or Figma-style token data for one or both modes.
preview writes a standalone HTML theme review without starting the application.
Current UI CLI inventory
This snapshot comes from tavo-ui --help during documentation synchronization. Native tooling is listed by the binary but remains outside this web documentation phase.
textUsage:
tavo-ui web <command> [options]
tavo-ui generate [options]
Commands:
web generate Generate the web theme stylesheet.
web check Validate the web theme config.
web validate-css Report unknown Tavo.js UI variables in application CSS.
web tokens Print generated web theme tokens.
web init Create a default web theme config.
web preview Generate a web theme preview.
web audit Print web theme audit results.
Install:
npm install @tavojs/ui (includes tavo-ui for web)Web command reference
| API / option | Type | Default | Behavior |
|---|---|---|---|
init | writes JSON | tavo-ui.config.json | Creates a minimal schema-linked config and refuses to overwrite an existing file. |
generate | writes CSS | src/theme/generated/default-theme.css | Builds theme CSS. Generated theme files must use the .css extension. |
check | read only | — | Validates config and prints readable contrast warnings. |
validate-css | read only | src | Finds unknown --tui-* variables in CSS, SCSS, Sass, and Less files. |
audit | JSON output | — | Prints passed, warningCount, and warnings for CI or custom tooling. |
tokens | stdout | all modes, JSON | Prints resolved JSON, CSS variables, or Figma-style JSON. |
preview | writes HTML | tavo-ui-preview.html | Creates a standalone visual review of surfaces, actions, and representative tokens. |
bashnpx tavo-ui web validate-css --config tavo-ui.config.json src
npx tavo-ui web tokens --config tavo-ui.config.json --mode dark --format css
npx tavo-ui web preview --config tavo-ui.config.json --out theme-preview.htmlOptions, defaults, and errors
| API / option | Type | Default | Behavior |
|---|---|---|---|
--config, -c | path | tavo-ui.config.json | Selects the theme config for every command. |
--out, -o | path | command-specific | Selects generate or preview output. |
--mode | "light" | "dark" | "all" | "all" | Selects token output modes. |
--format | "json" | "css" | "figma" | "json" | Selects token output format. |
Unknown commands, options, modes, formats, and missing option values exit with an error.
A missing config or nonexistent validate-css input path exits with an error.
validate-css ignores comments and strings, reports source locations, suggests tokens from the same group, and exits nonzero when diagnostics exist.
The dispatcher explains which platform package to install when
@tavojs/uiis unavailable.
Use the CLI correctly in CI
json{
"scripts": {
"ui:check": "tavo-ui web check --config tavo-ui.config.json",
"ui:check-css": "tavo-ui web validate-css --config tavo-ui.config.json src",
"ui:audit": "tavo-ui web audit --config tavo-ui.config.json"
}
}