Navigated to /docs/ui/cli

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.

BASH
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.html

Choose 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.

TEXT
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 / optionTypeDefaultBehavior
initwrites JSONtavo-ui.config.jsonCreates a minimal schema-linked config and refuses to overwrite an existing file.
generatewrites CSSsrc/theme/generated/default-theme.cssBuilds theme CSS. Generated theme files must use the .css extension.
checkread onlyValidates config and prints readable contrast warnings.
validate-cssread onlysrcFinds unknown --tui-* variables in CSS, SCSS, Sass, and Less files.
auditJSON outputPrints passed, warningCount, and warnings for CI or custom tooling.
tokensstdoutall modes, JSONPrints resolved JSON, CSS variables, or Figma-style JSON.
previewwrites HTMLtavo-ui-preview.htmlCreates a standalone visual review of surfaces, actions, and representative tokens.
BASH
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.html

Options, defaults, and errors

API / optionTypeDefaultBehavior
--config, -cpathtavo-ui.config.jsonSelects the theme config for every command.
--out, -opathcommand-specificSelects 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/ui is unavailable.

Use the CLI correctly in CI

JSON
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"
  }
}