Export design tokens from the command line

Install the uirules CLI, sign in with your account, and export brand or project tokens as CSS or Tailwind stylesheets.
PreviousNext

The uirules CLI signs you in and exports design tokens to files your app can import. To connect an AI tool to the MCP, use Connect in UI Rules; the CLI does not configure MCP clients.

Install or upgrade

Use Node.js 22.12 or newer:

npm i -g uirules@latest

Version 0.2.0 introduced the current sign-in flow. If you used 0.1.0, update and sign in again.

Sign in

uirules login

The CLI prints a code and opens a UI Rules page. Sign in, check that the browser shows the same code as your terminal, and approve. For a remote terminal, open the printed URL on your own computer; --no-browser skips opening it automatically.

This signs in your account with read-only permissions. You choose the brand and project when exporting, not during sign-in.

Export tokens

Replace the example slugs with your own:

uirules tokens --brand acme --project website --format tailwind-v4 --out src/styles/tokens.css

Add --org your-org if you belong to more than one organization. Omit --project to export the brand itself. In an interactive terminal, the command asks for missing choices.

FormatOutput
cssCSS variables, theme and context blocks, and derived scales.
tailwind-v4The stylesheet plus a Tailwind v4 @theme inline block.
tailwind-v3The stylesheet plus tailwind.config.uirules.cjs beside it. Merge that config into your Tailwind configuration.

Without --out, output is written to the terminal. Re-run the export when tokens change. Guidelines stay available through MCP rather than being copied into your codebase.

Sign out

uirules logout

This revokes the saved sign-in and removes it from your computer.

See the Connect overview for AI-tool setup and the MCP tools reference for what connected agents can do.

Bring your brand to every AI tool

Set your rules once and use them in every AI tool you work in.