@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
--token/--api-keyflagTWENTYFIRST_TOKENenv varAPI_KEY_21STenv var- the stored
21st loginsession
an_… key left in either env var is skipped, so an old export can no
longer shadow a working 21st login session.
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.