@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
Sign in
--token/--api-keyflagTWENTYFIRST_TOKENenv varAPI_KEY_21STenv var- the stored
21st loginsession
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.
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.