Skip to main content
The Frontic CLI is a command-line interface for interacting with your Frontic Account and generating project-specific files such as the Client SDK.
Frontic CLI Hero

Setup

You can use the Frontic CLI in two ways:
  1. Install the CLI globally (enables the frontic command).
  2. Run it ad-hoc through your package manager’s runner (pnpm dlx, npx, yarn dlx, bunx).
  • Global install - pin to a specific version, run frequently. You manage upgrades manually.
  • One-off runner (pnpm dlx, npx, etc.) - always uses the latest version (or your package manager’s cache). No global state.

Commands

Global options

These go before or after any command, for example frontic generate --non-interactive. --non-interactive is for scripts, CI, and any machine without a person at the keyboard. The CLI then never opens a browser or a picker. Where it would have asked, it stops with an [ERROR] line and a non-zero exit code instead:
  • frontic login without --token fails with “Browser login needs a terminal”. Log in with frontic login --token <token> instead.
  • frontic project with more than one project to pick from fails and asks for -p <project-id>. With exactly one project, it selects that one.
  • frontic generate fails when no project is selected, or when the existing client was generated for a different project, instead of asking whether to switch or overwrite. Without a version, it generates against the public version, or the develop version before anything is published, instead of asking which API version. frontic generate draft without a name fails and lists the drafts.
The --json option of the release and draft commands turns on the same behaviour for that command. Whether or not the flag is set, a Frontic backend the CLI can’t reach ends the command with Cannot reach <url>, or <url> answered <status>, and exit code 1. Logging in again can’t fix that, so the CLI doesn’t offer it.

frontic context

Sync your project’s Context Base (Skills and Rules) into your repository so your editor’s AI agent reads them on every session. Two subcommands.

frontic context init

Sync Skills, Context Rules and brand tokens in one shot. Skills go to .claude/skills/ (.cursor/skills/ with --agent cursor), Context Rules to .claude/rules/. Project Rules go to .claude/CLAUDE.md only with --profile studio or --profile designer; the default profile, custom, has none. See Choosing a profile. Re-running without --force leaves rule files alone when nothing changed in Frontic - safe to run repeatedly.

Usage

frontic context skills

Sync only Skills.

Usage

frontic credentials

Manage project credentials

frontic credentials load

Pull the project’s Studio credentials into a local .env file so the same secrets your Studio workspace uses are available when you run the code on your own machine. The command merges credentials into the file under a delimited block so re-running the command updates only that block - anything else in the file stays put. If a .gitignore exists, the env file is added to it automatically. For Studio workspaces, credentials are injected automatically - frontic credentials load is for local development. The default is .env.studio rather than .env so the command never overwrites an existing .env or .env.local. Pass --env-file to write to a different filename instead. Pass --export to print export VAR=value statements to stdout instead of writing a file, which is useful for sourcing into the current shell:

Usage

frontic draft

Preview - drafts are in active development. Specifics may change before general availability. Unlike the rest of Release Control, drafts are currently planned to be exclusive to the Scale plan.
Split a short-lived snapshot off the workspace, prepare work in it, and merge it back, choosing a side for each conflict. Each draft has its own version key and a random sample of up to 100 records from each feed, so you can iterate end to end without changing the workspace for the rest of the team. Multiple drafts can exist in parallel, and a draft is removed only when it merges. Use frontic generate draft <name> to generate an SDK against one without changing your active project.

frontic draft create

Split a new draft from develop (prompts for name if omitted)

Usage

string
name

frontic draft list

List drafts of the current develop project

Usage

frontic draft diff

Show what the draft has changed vs develop (interactive picker if no name given)

Usage

string
name

frontic draft check

Check whether a draft will merge cleanly into develop (interactive picker if no name given)

Usage

string
name

frontic draft merge

Merge a draft back into develop (interactive picker if no name given). The draft is removed after merge.

Usage

string
name

frontic generate

Generate the typed Client SDK for the current project. Pass the API version to generate against: develop, preview or public. Without one, the CLI uses the public version, or the develop version before anything is published, and prints which. In an interactive terminal it also opens a picker with that version preselected.
To generate against a draft, run frontic generate draft <name>. Without a name, the CLI opens a picker; in CI it fails and lists the drafts. Rerun frontic generate after upgrading the CLI or the Nuxt module. The module reads a newer layout of the generated types and warns at build time when your .frontic/ folder was generated by an older CLI. If generation fails with Invalid API specification. The API specification must be a valid YAML file., rerun with --debug - it writes the raw spec response to fetch-api.debug.yaml so you can inspect exactly what the backend returned.

Usage

string
API version to generate against: develop, preview or public (default: public when it exists, else develop); or draft <name> for a draft
string
With draft: the draft to generate against

frontic info

Display the current team (printed as Organization), project, and authenticated user.

Usage

frontic library

Sync the brand tokens Context Setup wrote into your repository, so the colors, fonts, and radii your agent uses come from the project rather than from memory.

frontic library tokens

Sync the brand tokens Context Setup wrote, and any you’ve published since in the Design Library.

Usage

frontic login

Login to your Frontic account. In most cases, run this from your project directory (where your package.json lives) so the CLI can place generated files correctly.
Opens a browser window to complete the login flow. Creates a token in .frontic-local/. Add this directory to .gitignore to keep credentials out of the repo.

Usage

frontic logout

Log out of your Frontic account.

Usage

frontic mcp

Configure Frontic MCP servers for your AI coding client

frontic mcp init

Initialize Frontic MCP configuration for an AI coding client (claude resolves to Claude Code). Writes the Frontic MCP server entries directly into your client’s MCP config file. The command merges with any existing MCP config rather than overwriting it. When run, the CLI prompts you to choose what to install:
  • Tools & Docs - both project tools and documentation MCP servers (default).
  • Tools only - frontic-tools (authenticated project access).
  • Docs only - frontic-docs (read-only documentation).

Config file paths

See MCP Tools for a guided walkthrough of the editor setup flow.

Usage

frontic project

Select the active project for SDK generation and Context Base sync. The selection is stored in .frontic-local/. If you omit --project, the CLI prompts you to pick.

Usage

frontic release

Preview and publish versions of a project: the develop, preview and public versions

frontic release status

Show develop, preview, public, and any in-flight drafts

Usage

frontic release preview

Preview a version: generate a fresh preview version from the current workspace configuration and your data, replacing the old one

Usage

frontic release publish

Publish the preview version as the public version (irreversible)

Usage

frontic release diff

Show what publishing will change (develop → public by default)

Usage

Getting help

Pass --help to any command to see its options: