Export design tokens from the command line
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@latestVersion 0.2.0 introduced the current sign-in flow. If you used 0.1.0, update and sign in again.
Sign in
uirules loginThe 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.cssAdd --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.
| Format | Output |
|---|---|
css | CSS variables, theme and context blocks, and derived scales. |
tailwind-v4 | The stylesheet plus a Tailwind v4 @theme inline block. |
tailwind-v3 | The 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 logoutThis 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.
