---
title: "Prismic CLI"
description: "A command-line tool for managing Prismic repositories."
category: "concepts"
audience: developers
tags: ["new"]
lastUpdated: "2026-11-26T11:15:13.000Z"
---

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](https://prismic.io/docs/type-builder.md), the Prismic CLI can also pull [content models](https://prismic.io/docs/content-modeling.md) from Prismic into your local codebase and push local changes back to Prismic.

# Quick start

The Prismic CLI can be used via [`npx`](https://docs.npmjs.com/cli/commands/npx), no installation required.

```sh
npx prismic
```

Install the [skill](https://agentskills.io) to teach AI agents how to use the CLI:

```sh
npx skills add --global --yes prismicio/skills
```

[Learn about `npx skills`](https://skills.sh/)

# Help and reference

Use `--help` to learn about the CLI's capabilities.

```sh
npx prismic --help
```

It works for commands and subcommands as well:

```sh
npx prismic repo --help
npx prismic webhook create --help
```

# Authenticate the CLI

Log in to the CLI using `prismic login`. You will be prompted to log in to Prismic through a browser.

```sh
npx prismic login
```

The CLI prints a URL and a code:

```plain
Open this URL on any device to log in:
  https://auth0.prismic.io/activate?user_code=BCDF-GHJK
Check that the page shows the code BCDF-GHJK.
```

Open the URL on any device and approve the login. This also works on remote machines and with [AI agents](https://prismic.io/docs/ai.md).

## Start without an account

You can try Prismic before signing up. When you are logged out, `init` and `repo create` start a guest account, which works like a normal account. To use your own account instead, run `prismic login` first. Guest accounts are not available in CI.

```sh
# Create a repository before signing up
npx prismic init
```

To open the repository in your browser, logged in to the guest account, run `npx prismic repo view --web`.

After each command, the CLI prints when the account will be disabled and a link to claim it:

```plain
Guest account, disabled in 2 days (2026-11-27T02:00Z). Claim it to keep your work: <claim link>
```

Open the claim link and sign up or log in. The account's repositories move to your account. Then, log in to the CLI with that account:

```sh
npx prismic login
```

> **Important**
>
> Don't forget to claim a guest account. After 48 hours, Prismic disables it, and you can't use it in the CLI or the dashboard until you claim it. 14 days later, Prismic deletes the account and its repositories. You can't recover them.

## Authenticate in scripts and CI workflows

The Prismic CLI can be used in scripts and CI workflows. You may use a write token to authenticate non-interactive environments like GitHub Actions.

Generate a write token with the CLI:

```sh
npx prismic token create --write
```

Then, provide the token as the `PRISMIC_TOKEN` environment variable. Commands that require authentication will use the token rather than a user's login.

```sh
PRISMIC_TOKEN=<your-token> npx prismic repo view
```

> **Caution**
>
> A write token is an administrator credential. Keep it secret. Do not commit it or put it in client-side code.

Commands that modify repository settings, like `webhook create` and `preview remove`, are not allowed with a write token. Use a user login via `npx prismic login` instead.

# CLI 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](https://prismic.io/docs/type-builder.md) 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.

```sh
npx prismic init --repo <your-repository-name>
```

Omit `--repo` to create a new repository.

If the repository uses the Legacy Builder, `init` turns on the Type Builder. See [Migrate to the Type Builder](https://prismic.io/docs/legacy-builder.md#migrate-to-the-type-builder).

## 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.

```sh
npx prismic pull
```

## Push 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.

```sh
npx prismic push
```
