21st CLI — find, install & generate from the terminal
The
21st
CLI (
npx @21st-dev/cli
, bin
21st
) is the command-line surface for
the 21st.dev catalog. Search first, install what fits, and only hand-write UI
when nothing matches. To
publish
your own components/themes/templates, use
the
21st-registry
skill; to publish a project's design as a theme, use
21st-design-sync
.
Auth (do this once)
Two interchangeable credentials, both sent as the API key:
Login session
—
npx @21st-dev/cli login
opens the browser and saves a
token to
~/.config/21st/auth.json
. Best for interactive/dev machines.
API key
—
21st_sk_…
from
https://21st.dev/mcp
(or
https://21st.dev/settings/api-keys
). Pass via
--api-key
21st-cli-use
安装
npx skills add https://github.com/21st-dev/skill --skill 21st-cli-use