Skip to main content
@21st-dev/cli (binary 21st) is the single command-line tool for everything 21st: search and install marketplace items, generate UI with 21st AI, publish your own components, manage your profile, and wire the 21st 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.
@21st-dev/cli supersedes the older @21st-dev/registry (publish/install) and @21st-dev/magic (MCP setup) packages. Use 21st for all of it.

Install

npm i -g @21st-dev/cli
# or run without installing:
npx @21st-dev/cli search "pricing table"

Sign in

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

What you can do

https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/grid.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=0d9b34d772968170c2388d8f2ce115be

Find & install

Search components, themes, and templates; fetch code; install via shadcn; manage bookmarks, lists, and teams.
https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/magic-chat.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=ef0988102f9e88724e737954f7bb1cab

Generate with 21st AI

Start a generation, list its drafts, refine a take, and grab the code.
https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/publish.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=00cece9a08f85007ae4acc6b78d59baa

Publish & manage

Publish components, themes, and templates, then edit or unpublish them.
https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/boxes.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=91fd321e47c5361b702995034f85827c

Your profile

Read and replace your bento profile board and upload media from the CLI.
https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/cable.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=f782045c79c2ffa04e192209e563f025

Editor & MCP setup

Wire the 21st MCP into Cursor, Claude, VS Code, and install the skills.
https://mintcdn.com/21st/uLCB5kikM-FHl_zp/icons/nav/terminal.svg?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=13207e3f98dae6e6cb5a5d8c5c81b297

Command reference

Every command and flag in one table.