> ## 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.

# Overview

> One terminal tool for the whole of 21st — search, install, generate, publish, and manage.

`@21st-dev/cli` (binary `21st`) is the single command-line tool for everything 21st: search and install marketplace items, generate UI with [21st AI](/ai), publish your own components, manage your profile, and wire the [21st MCP](/ai/mcp) into your editor. The CLI and the MCP share one endpoint and one login, so a command returns exactly what an MCP client sees.

<Note>
  `@21st-dev/cli` supersedes the older `@21st-dev/registry` (publish/install) and
  `@21st-dev/magic` (MCP setup) packages. Use `21st` for all of it.
</Note>

## Install

```bash theme={null}
npm i -g @21st-dev/cli
# or run without installing:
npx @21st-dev/cli search "pricing table"
```

## Sign in

```bash theme={null}
21st login     # sign in via the browser, saved locally to ~/.config/21st/auth.json
21st whoami    # show the signed-in account
21st usage     # tier + remaining free quota
21st logout    # clear the saved session
```

You can also authenticate with an [API key](https://21st.dev/settings/api-keys) instead of a browser session. The CLI resolves credentials in this order:

1. `--token` / `--api-key` flag
2. `TWENTYFIRST_TOKEN` env var
3. `API_KEY_21ST` env var
4. the stored `21st login` session

<Warning>
  Publishing and management commands (`publish*`, `edit`, `delete`, `profile`)
  require a real secret API key (`21st_sk_…`). A `21st login` session token works
  for search / get / install / generation / MCP, but **not** for those commands.
</Warning>

## What you can do

<CardGroup cols={2}>
  <Card title="Find & install" icon="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/grid.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=0d9b34d772968170c2388d8f2ce115be" href="/cli/find" width="24" height="24" data-path="icons/nav/grid.svg">
    Search components, themes, and templates; fetch code; install via shadcn;
    manage bookmarks, lists, and teams.
  </Card>

  <Card title="Generate with 21st AI" icon="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/magic-chat.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=ef0988102f9e88724e737954f7bb1cab" href="/cli/generate" width="24" height="24" data-path="icons/nav/magic-chat.svg">
    Start a generation, list its drafts, refine a take, and grab the code.
  </Card>

  <Card title="Publish & manage" icon="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/publish.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=00cece9a08f85007ae4acc6b78d59baa" href="/cli/publish" width="24" height="24" data-path="icons/nav/publish.svg">
    Publish components, themes, and templates, then edit or unpublish them.
  </Card>

  <Card title="Your profile" icon="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/boxes.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=91fd321e47c5361b702995034f85827c" href="/cli/profile" width="24" height="24" data-path="icons/nav/boxes.svg">
    Read and replace your bento profile board and upload media from the CLI.
  </Card>

  <Card title="Editor & MCP setup" icon="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/cable.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=f782045c79c2ffa04e192209e563f025" href="/cli/setup" width="24" height="24" data-path="icons/nav/cable.svg">
    Wire the 21st MCP into Cursor, Claude, VS Code, and install the skills.
  </Card>

  <Card title="Command reference" icon="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/terminal.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=13207e3f98dae6e6cb5a5d8c5c81b297" href="/cli/reference" width="24" height="24" data-path="icons/nav/terminal.svg">
    Every command and flag in one table.
  </Card>
</CardGroup>
