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 (Magic MCP) packages. Use 21st for all of it. Old @21st-dev/magic configs still work — since 0.2.0 that package proxies to the same 21st MCP endpoint.

Install

Sign in

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
A retired an_… key left in either env var is skipped, so an old export can no longer shadow a working 21st login session.
21st publish <component> accepts a stored 21st login session or a secret API key. Theme/template publishing and management commands (edit, delete, profile) still require a real 21st_sk_… API key.

What you can do

Find & install

Search components, themes, and templates; fetch code; install via shadcn; manage bookmarks, lists, and teams.

Generate with 21st AI

Start a generation, list its drafts, refine a take, and grab the code.

Publish & manage

Publish components, themes, and templates, then edit or unpublish them.

Project-aware design

Extract your project’s Design Context, ground search and generation in it, review UI locally, and manage the design skills.

Your profile

Read and replace your bento profile board and upload media from the CLI.

Editor & MCP setup

Wire the 21st MCP into Cursor, Claude, VS Code, and install the skills.

Command reference

Every command and flag in one table.