Skip to main content
The CLI drives 21st AI end to end: kick off a generation, watch it build, refine the draft you like, and pull its code. It’s the same engine as the web app and MCP.

Start a generation

Starts a 21st AI sketch generation and opens a browser preview so you can watch the drafts build. Returns a projectId you use with the commands below.

List the drafts

Lists the “takes” (drafts) of a generation with their take numbers and ready state. Free.

Refine a take

Edits one take in natural language. Without --take it refines the default take; pass --take N to target a specific one.

Grab the code

By default take prints a paste-ready copy-prompt you can drop into your editor or agent to recreate the UI in your own stack. Use --code to print the raw HTML. Free.
generate and iterate consume credits. Listing drafts (generation) and taking code (take) are free.

Typical flow