---
name: 21st-cli
description: >-
  Umbrella entry for the `21st` CLI (`@21st-dev/cli`) on 21st.dev. The full
  surface is now split into three focused skills — use those instead: find &
  install (`21st-cli-use`), publish & manage (`21st-registry`), and publish a
  project's design as a theme (`21st-design-sync`). Auto-activate when a project
  has a `components.json`. Kept for backward compatibility with older installs.
---

# 21st CLI

The `21st` CLI (`npx @21st-dev/cli`, bin `21st`) drives the 21st.dev catalog
from the terminal. This skill is a thin index — the detailed guidance now lives
in three focused skills, so an agent only loads what a task needs:

- **`21st-cli-use`** — search the catalog, print code, install a component,
  generate with 21st AI. The daily driver: *find & install.*
- **`21st-registry`** — publish components / themes / templates and edit,
  unpublish or delete your own items. *Publish & manage.*
- **`21st-design-sync`** — read the current project's shadcn/Tailwind design
  tokens and publish them as a community theme. *Design → theme.*

Install all three at once with `npx @21st-dev/cli install-skill`.

## Auth (shared by all three)

- **Login session** — `npx @21st-dev/cli login` (interactive machines).
- **API key** — a `21st_sk_…` key from **https://21st.dev/mcp**, via
  `--api-key` or the `TWENTYFIRST_TOKEN` / `API_KEY_21ST` env var (CI, and
  required for all publish/edit/delete).

## Most-used commands

```bash
21st search "pricing table" --type c   # find (free)
21st get <id>                          # print a component's code (metered)
21st add <user>/<slug>                 # install into the project
21st generate "<prompt>"               # generate with 21st AI
21st publish ./Component.tsx --description "…"   # publish (needs a 21st_sk_ key)
21st publish-theme ./theme.css --name "…"        # publish a CSS theme
```

For anything beyond these, load the focused skill above.
