K

Set up from the command line

Use the UI Rules CLI to connect Claude Code or Cursor from a terminal, and to export your design tokens as a file your app imports.
PreviousNext

The CLI does two jobs: it writes the MCP config for Claude Code or Cursor with the key already in place, and it exports your design tokens to a file on disk. It runs with npx, so there is nothing to install first, and it needs no copied key: signing in picks the project.

Connect a tool

Sign in

$ pnpm dlx @ui-rules/cli login

Your browser opens to pick the project. The CLI holds onto the choice, so you sign in once.

Connect your tool, then restart it

For Claude Code:

$ pnpm dlx @ui-rules/cli setup claude

For Cursor in this repo:

$ pnpm dlx @ui-rules/cli setup cursor

For Cursor across every project:

$ pnpm dlx @ui-rules/cli setup cursor --global

Each merges into an existing config rather than replacing it, and warns you if the file it just wrote is not ignored by git. Restart the tool to pick up the change.

For any other tool, or to see what the CLI writes, follow that tool's own guide from the Connect overview.

Export your tokens

Your rules stay in the MCP, where they are always fresh. Token values are different: a CSS file is imported by the app itself, so it has to exist on disk. That is what the export is for.

$ pnpm dlx @ui-rules/cli tokens --out src/styles/tokens.css

Omit --out and the content prints to stdout instead, so you can pipe it. Pass --format for css (the default), json, or tailwind.

Re-run it whenever the brand's tokens change. Keeping a second copy of the rules in the repo would only drift, which is why the command exports tokens and nothing else.

Bring your brand to every AI tool

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