> ## Documentation Index
> Fetch the complete documentation index at: https://help.21st.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Command reference

> Every 21st CLI command and its key flags in one place.

Run `21st help` for the full inline usage; a command invoked without its required arguments prints its own usage line. Add `--json` to most read commands for machine-readable output.

## Auth & account

| Command | Description |
| - | - |
| `21st login` | Browser sign-in, saved to `~/.config/21st/auth.json` |
| `21st logout` | Clear the saved session |
| `21st whoami` | Show the signed-in account |
| `21st usage [--json]` | Account tier, AI access, and remaining free daily component-code retrieval quota |

Credential order: `--token`/`--api-key` flag → `TWENTYFIRST_TOKEN` → `API_KEY_21ST` → stored login.

CLI 1.17.1 adds `21st usage --json` for machine-readable account status. Its
`aiGenerationEnabled` field reports AI access, not the remaining credit balance.
On older versions, run `21st usage` and read the `21st AI generation` line.

## Find & install

| Command | Description |
| - | - |
| `21st search <query>` | Search components, themes, templates (free); add `--context auto` for grounded ranking |
| `21st logo <query>` | Search brand + UI SVG logos (free, no login) |
| `21st get <id>` | Fetch a component's code + demo |
| `21st theme <id>` | Fetch a theme's CSS (free) |
| `21st add <user>/<slug>` | Install via `npx shadcn@latest add` (`--print` to just print) |
| `21st add @<registry>` | Install every component in a tracked shadcn registry (free, no login) |

See [Find & install](https://help.21st.dev/cli/find.md) for all search flags.

## Bookmarks, lists & teams

| Command | Description |
| - | - |
| `21st bookmarks` | List your bookmarks |
| `21st bookmark <id> --type <kind>` | Bookmark / unbookmark (`--remove`) |
| `21st lists` | Your named lists |
| `21st list <listId>` | Items in a list |
| `21st list-new <name>` | Create a list |
| `21st list-add <listId> <id> --type <kind>` | Add / remove (`--remove`) an item |
| `21st teams` | Your teams |
| `21st team <teamId>` | A team's libraries |
| `21st team-lists <teamId>` | A team's shared lists |
| `21st team-components <teamId>` | Components in a team library (`--library <id>`) |

## Generate with 21st AI

`generate` and `iterate` require AI enabled on the account and available
[credits](https://help.21st.dev/ai/pricing.md). Builder and Team start with AI off. Check
`aiGenerationEnabled` with `21st usage --json` before starting.

| Command | Description |
| - | - |
| `21st generate <prompt>` | Start a generation; supports `--context auto --variants N` |
| `21st generation <projectId>` | List a generation's drafts (free) |
| `21st iterate <projectId> "<change>"` | Refine a draft, `--take N` (uses credits) |
| `21st take <projectId>` | Grab a draft's code, `--take N`, `--code` (free) |

See [Generate with 21st AI](https://help.21st.dev/cli/generate.md).

## Components & drafts

| Command | Description |
| - | - |
| `21st components [--status <status>] [--scope <scope>] [--json]` | List every accessible personal/Team component and owned draft with stable refs |
| `21st open <component:<id>\|draft:<uuid>> [--no-open]` | Resume a draft or create/resume a CLI Review revision of an existing component |
| `21st draft <draft:<uuid>> [--watch] [--json]` | Draft state, editor URL and per-demo media states without a browser; `--watch` prints transitions until published/failed/deleted |

`21st components` drains every server page by default. Filter it with
`--status all|draft|published|private` or
`--scope all|personal|team:<uuid>`; each row keeps a stable
`component:<id>` or `draft:<uuid>` reference for `21st open`.

`21st open draft:<uuid>` resumes an editable Studio draft. `21st open
component:<id>` creates or resumes a server-owned CLI Review revision from the
retained published component code and demos. The live component stays
unchanged until publish. Fresh covers are required; optional videos run
best-effort in the background. Pass `--no-open` to create or resume the
workspace and print its editor URL without launching a browser.

Only the original component author can check out code. A Team manager can
still edit or unpublish a teammate's component metadata by stable ref. Checkout
fails closed when retained source, dependencies, style, support files, or the
default demo cannot be reproduced safely. Use
`21st publish <file> --component component:<id>` with a local source file
instead.

A login session includes personal work and Teams the user can manage. A
personal key is personal-only; a Team key is restricted to that Team.

New CLI Review drafts persist their authenticated personal or Team/library
scope. Legacy proof-backed CLI drafts are recovered into the matching
authenticated scope. An older unsigned draft whose scope cannot be proven may
need to be recreated.

## Publish & manage

| Command | Description |
| - | - |
| `21st publish <file> [--component component:<id>] --description "…"` | Build a new component or an explicit owned revision, open CLI Review with Demos (N) and automatic media, then publish |
| `21st render <file> [--demo <f>] [--out <dir>] [--video] [--keep]` | Build and photograph a component without publishing it; the workspace is deleted afterwards unless `--keep` |
| `21st library [list\|show\|create\|update] <slug>` | Read and edit a library's identity (`--name`, `--description`, `--display-name`, `--logo`/`--logo-url`, `--website`, `--github`, `--x`, `--public`/`--private`) |
| `21st publish <file> --prepare --wait-video --media-dir <dir>` | Generate and download revision-bound cover/video without opening Studio or publishing |
| `21st publish <file> --draft draft:<uuid> --auto --wait-video` | Publish a prepared draft entirely through the CLI |
| `21st publish-theme <file.css> --name "…"` | Publish a theme (needs `:root` + `.dark`) |
| `21st publish-template <name> --site <url> --preview <img>` | Submit a template listing |
| `21st publish-gradient <recipe.json> --name "…" --thumbnail <img>` | Publish a Gradient Builder recipe |
| `21st publish-ascii <recipe.json> --name "…" --thumbnail <img>` | Publish an ASCII recipe (`--video`, `--mask`, `--private`) |
| `21st submit <slug>` / `withdraw` / `resubmit` | Submit a Published component for featuring, withdraw it, or resubmit after changes |
| `21st remove-from-catalog <slug>` | Return a Featured component to Published |
| `21st edit component:<id> --type component` | Update exact component metadata; login sessions and API keys are accepted |
| `21st delete component:<id> --yes` | Unpublish the exact component; login sessions and API keys are accepted (`--type` is inferred from the ref) |
| `21st delete draft:<uuid> --yes` | Permanently delete the exact owned draft and its unpublished sandbox (`--type` is inferred from the ref) |
| `21st edit/delete <id> --type <theme\|template>` | Manage a theme/template with its existing API-key-scoped id semantics |

> [!WARNING]
>
> Component publishing, metadata editing, and unpublishing accept a login
> session or secret API key. Theme/template publishing and management commands
> require a `21st_sk_…` key. See [Publish & manage](https://help.21st.dev/cli/publish.md).

## Profile

| Command | Description |
| - | - |
| `21st profile get` | Read your bento board as blocks |
| `21st profile set --file <json>` | Replace the board (`--clear` to reset) |
| `21st profile upload <image>` | Upload media, print its URL |

See [Your profile](https://help.21st.dev/cli/profile.md).

## Design Context & review

| Command | Description |
| - | - |
| `21st init --design-context` | Extract `.21st/design.json` and generated docs |
| `21st init --design-context --check` | Report project/design-context drift without writing |
| `21st init --design-context --refresh` | Refresh facts while preserving decisions |
| `21st review <path...>` | Run deterministic local UI review |
| `21st review <path...> --fix` | Apply conservative mechanical fixes |
| `21st inspiration-feedback <feedbackId> --outcome accepted\|rejected` | Record a privacy-safe inspiration decision |

See [Project-aware design](https://help.21st.dev/cli/design-runtime.md).

## Editor & MCP setup

| Command | Description |
| - | - |
| `21st init --client <name>` | Print MCP config (`--write` to save) |
| `21st skills install` | Install verified project-local skills |
| `21st skills list\|check\|update\|remove` | Manage installed skills safely |
| `21st skills catalog` | Inspect curated external compatibility |
| `21st install-skill` | Compatibility alias for global installation |
| `21st help` | Full help text |

See [Editor & MCP setup](https://help.21st.dev/cli/setup.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.