Prismic CLI
NEWLast updated
The Prismic CLI is a command-line tool for managing Prismic repositories. You can create repositories and configure their settings from your terminal.
When used in a repository that supports the Type Builder, the Prismic CLI can also pull content models from Prismic into your local codebase and push local changes back to Prismic.
Quick start
The Prismic CLI can be used via npx, no installation required.
npx prismicInstall the skill to teach AI agents how to use the CLI:
npx skills add --global --yes prismicio/skillsLearn about npx skills
Help and reference
Use --help to learn about the CLI’s capabilities.
npx prismic --helpIt works for commands and subcommands as well:
npx prismic repo --help
npx prismic webhook create --helpCLI commands
The Prismic CLI comes with the following commands, some of which have subcommands.
| Command | Description |
|---|---|
prismic docs | List and view Prismic documentation. |
prismic repo | Create and manage repositories. |
prismic locale | Manage repository locales. |
prismic preview | Manage repository previews. |
prismic token | Manage repository access and write tokens. |
prismic webhook | Manage repository webhooks. |
prismic login | Authenticate the CLI with a Prismic account. |
prismic logout | Log out of the CLI. |
prismic whoami | Determine which Prismic account is logged in. |
Type Builder projects
The Prismic CLI integrates with the Type Builder through these extra commands.
| Command | Description |
|---|---|
prismic init | Install and set up Prismic in a new website project. |
prismic pull | Pull content models from Prismic into a project. |
prismic push | Push local content models to Prismic. |
prismic gen | Generate code for a project. |
Set up a Type Builder project
Use the init command to integrate Prismic into your project. It installs Prismic’s packages and configures your project with a Prismic client and content previews.
npx prismic init --repo <your-repository-name>Pull models from Prismic
Use the pull command to pull content models from Prismic into your codebase. Prismic’s models are the source of truth, so your local files are created, updated, or deleted to match. Pulling also generates TypeScript types for your page types, custom types, and slices, and bootstraps component files for pages and slices.
npx prismic pullPush models to Prismic
Use the push command to send content models you’ve created or edited locally to Prismic. Your local files are the source of truth, so Prismic’s models are created, updated, or deleted to match.
npx prismic push