CLITargets & Formats

Targets & Formats

Two independent choices on generate — which document to emit, and how colors are encoded.

generate output is controlled by two independent flags. --to is which document you want. --format is how colors inside it are encoded. They don't overlap, so you set them separately.

Target

--to chooses the output document. The default is shadcn.

TargetOutput
colorsThe raw role set, both modes. Agents read this while mapping roles to another tool's slots.
shadcnA paste-ready shadcn :root/.dark block, both modes. The default.
yamlA single-mode DESIGN.md colors: block.
jsonA Material Theme JSON export.

colors, shadcn, and json co-emit both light and dark. yaml alone reads --mode to pick which projection to emit. The default mode is light.

npx @tonex-dev/cli generate --seed "#6A9CFF" --to colors
npx @tonex-dev/cli generate --seed "#6A9CFF" --to shadcn --format hex
npx @tonex-dev/cli generate --seed "#6A9CFF" --to yaml --mode dark
npx @tonex-dev/cli generate --seed "#6A9CFF" --to json

Format

--format chooses the color encoding for colors, shadcn, and json output: oklch by default, or hex. yaml is always hex and ignores this flag.

Adding a format in the engine surfaces it here automatically — the CLI reads the format list from @tonex/core rather than re-listing it.

Recipe embedding

Delivered projections carry the command that made them:

TargetRecipe location
shadcnA leading /* tonex generate ... */ comment.
yamlA leading # tonex generate ... comment.
jsonThe command in the description field.
colorsStructured recipe metadata for transient agent reads.

The role-set targets

--to colors emits the raw Tonex role set. Use it when a tool has no native exporter: read the roles, map each role by intent, then verify the pairings with tonex check.

--to yaml emits a DESIGN.md colors: block. It is the portable semantic contract for tools that can consume DESIGN.md. Tonex exports shadcn and json natively; for other tools, the roles (primary, on-surface, and so on) mean the same thing wherever they land. See How Tonex thinks and the skill that applies a consistent mapping.