Your tenant.
Terminal-ready.

The Crystallize CLI builds a Superfast Shop with your coding agent, sets up boilerplates, creates tenants and runs mass operations.

Install the CLI
curl -LSs https://crystallizeapi.github.io/cli/install.bash | bash

Pre-compiled with everything included, so you need neither Node nor Bun. The install script is open source.

Then run ~/crystallize to see every command.

Crystallize Crystallize CLI

Overview

Manage your Crystallize tenants from the terminal: install boilerplates, create tenants, upload images and run mass operations. Use it locally, or in your CI/CD pipelines to automate the work.

The CLI is written in Bun and compiled into a single binary with everything included, so you need neither Node nor Bun. The install script is open source: it detects your OS and architecture, and downloads the latest release from GitHub.

The legacy CLIs are deprecated

@crystallize/cli and @crystallize/cli-next on npm still work, but they are now mainly used to install legacy templates. Use this CLI for everything else.

What it does

  • Boilerplates. Clones the repository, creates the tenant, imports its data, writes the .env file and installs the dependencies.
  • Tenants. Creates empty tenants and generates invitations for existing ones.
  • Tokens. Fetches and generates access tokens.
  • Images and files. Uploads and registers a single file or a whole folder.
  • Mass operations. Dumps your content model as JSON, validates and runs mass operations, and executes sets of mutations.
  • Plugins. Scaffolds a plugin from a skeleton, generates its keypair and wires up its configuration in one command.
  • Superfast Shop. Builds your own shop from a Superfast Shop demo, with your coding agent.
  • Coding agents. Adds the Crystallize MCP server and AI skills to your environment.

Credentials

Most commands are interactive: when credentials are missing or input is needed, the CLI asks. In CI, pass --no-interactive where a command supports it.

When you save credentials interactively, the CLI stores them in ~/.crystallize/credentials.json. It looks for credentials in this order:

  1. Environment variables: CRYSTALLIZE_ACCESS_TOKEN_ID and CRYSTALLIZE_ACCESS_TOKEN_SECRET
  2. Options: --token_id and --token_secret
  3. Stored file: ~/.crystallize/credentials.json

Run login to set up your credentials, and whoami to check they are valid.

Commands

Run ~/crystallize on its own to see the help and install shell completion. Add --help to any command to see its arguments and options.

Command What it does
login
Checks your credentials and offers to set them up.
whoami
Checks that your credentials are valid.
update
Updates the CLI to the latest version.
changelog
Shows the changelog.
doc
Shows this documentation in the terminal.
serve
Serves a subset of the commands over HTTP.
add-mcp
Adds the Crystallize MCP server to your environment.
add-skills
Adds the Crystallize AI skills to your environment.
update-skills
Updates the Crystallize AI skills in your environment.
superfast-shop
Builds your own shop from a Superfast Shop demo, with your coding agent. Alias: sfs.
boilerplate install
Installs a boilerplate into a folder.
tenant create
Creates a tenant.
tenant enroll
Brings the shapes, items and images of a boilerplate into a tenant.
tenant invite
Generates invites for new users.
token pim
Gets the PIM auth token.
token static
Gets the static auth token.
token shop
Gets the Shop API auth token.
image upload
Uploads images to a tenant.
file upload
Uploads files to a tenant.
mass-operation run
Uploads a mass operation and starts it in your tenant.
mass-operation dump-content-model
Creates a mass operation file from your content model.
mass-operation execute-mutations
Executes sets of mutations, client-side.
mass-operation add-operation
Adds operation skeletons to a mass operation file.
mass-operation validate
Validates a mass operation file locally.
plugin create
Scaffolds a new plugin from a skeleton.
plugin keygen
Generates an RSA JWK keypair for a plugin revision.
plugin encrypt-secret
Encrypts a secret with a vendor public JWK.
plugin decrypt-payload
Decrypts and verifies a plugin JWE payload.

Superfast Shop

Builds your own shop from a Superfast Shop demo, with your coding agent. The CLI asks which demo to start from, finds the coding agents installed on your machine, and hands your terminal over to the one you pick, with the demo's prompt.

Usage
~/crystallize superfast-shop <folder> [shop-identifier]

Arguments and options

folder
Required. The folder to build the shop in, which must be empty or not exist.
shop-identifier
Optional. The demo to start from. If you leave it out, you pick one from a list.
--agent
The coding agent to hand over to: claude, codex, agy, cursor or opencode. If you leave it out and several are installed, you pick one.
  • Run it in an interactive terminal: your coding agent takes it over.
  • If no supported agent is installed, the CLI gives you the demo's prompt to paste into the agent of your choice.
  • Its alias is sfs.

Boilerplates

An interactive command that does the tedious setup of a boilerplate for you.

Usage
~/crystallize boilerplate install <folder> [tenant-identifier] [boilerplate-identifier]

Arguments

folder
Required. The folder to install into.
tenant-identifier
Optional. A wizard asks for it if you leave it out.
boilerplate-identifier
Optional. A wizard asks for it if you leave it out.

Plugins

Scaffolds a new Crystallize plugin from a git skeleton you pick.

Usage
~/crystallize plugin create <folder> [skeleton-identifier]

Arguments

folder
Required. The target folder, which must be empty or not exist.
skeleton-identifier
Optional. A wizard lets you pick one if you leave it out.

The command downloads the skeleton (a git repository, or a subfolder of a monorepo), generates an RSA JWK keypair (public.jwk.json and private.jwk.json, with the private key added to .gitignore), replaces the mustache tokens and installs the dependencies.

Tokens are replaced in file contents and in file and folder names: {{plugin_name}}, {{plugin_identifier}}, {{author_name}}, {{vendor_url}}, {{public_jwk}}, {{private_jwk}} and {{kid}}. Any *.dist template is first copied to its final name (.env.dist becomes .env), without overwriting an existing file.

In CI and scripts

Pass every input as an option and run without prompts:

Example
~/crystallize plugin create ./my-plugin hono-plugin-skeleton --no-interactive --name "My Plugin" --author "Acme" --plugin-url https://acme.example --no-install

The other plugin commands, keygen, encrypt-secret and decrypt-payload, generate keys and let you test the plugin payload protocol locally.

Tenants

Create a tenant

Creates a new tenant and removes the default shapes, so you start clean.

Usage
~/crystallize tenant create <tenant-identifier>
  • Runs without prompts with --no-interactive when credentials are available.
  • If the identifier is taken, the CLI tells you and suggests another one.

Invite users

Generates invitation links for new users.

Usage
~/crystallize tenant invite <tenant-identifier>

Options

--role
The role of the new users. Defaults to tenantAdmin.
--expiry
How many hours the invites stay valid. Defaults to 6.
--number
How many invites to generate. Defaults to 1.

Images

Uploads images and registers them in the Asset Organizer.

Usage
~/crystallize image upload <tenant-identifier> <file> [output-file]

Arguments and options

file
A single image, or a folder to upload every image in it.
output-file
Optional. A file that maps each upload to its key, for automation.
--force
Overwrites an existing output file.
Output file
{
  "clean-name-png": "crystallize-key",
  "images-crystallize-png": "my-tenant/25/1/12/3435d2d0/images/crystallize.png"
}

Mass operations Experimental

Create, update and publish data in bulk. These commands dump, validate and run mass operation files, and execute sets of mutations from your machine.

Dump the content model

Creates a mass operation file that holds your content model: shapes and pieces.

Usage
~/crystallize mass-operation dump-content-model <tenant-identifier> <file>

Use --force to overwrite an existing file.

Validate a mass operation file

Checks a mass operation file against the schema, locally. It needs no credentials and no network, so it fits CI and pre-commit checks.

Usage
~/crystallize mass-operation validate <file>
  • Exits with a non-zero status code when the file is invalid.
  • Groups issues by operation index, with the field path, the message and the Zod error code.

Run a mass operation

Uploads the file, registers the operation and waits for it to finish.

Usage
~/crystallize mass-operation run <tenant-identifier> <file>

Use --legacy-spec to convert an old spec file into a mass operation file.

Execute mutations

A client-side tool to automate mutations.

Usage
~/crystallize mass-operation execute-mutations <tenant-identifier> <file> [image-mapping-file]

Arguments

file
The mutations, in the format below.
image-mapping-file
Optional. Injects image paths into the variables.

Mutation format

Mutations file
{
  "create-products": {
    "target": "pim",
    "mutation": "mutation CreateProduct($input: CreateProductInput!) { product { create(language: \"en\", input: $input) { id } } }",
    "sets": []
  },
  "publish-items": {
    "mutation": "mutation PublishItems($ids: [ID!]!) { publishItems(language: \"en\", ids: $ids) { success { itemId } } }",
    "target": "core",
    "sets": [
      {
        "ids": [
          "$create-products[0].product.create.id"
        ]
      }
    ]
  }
}

Dependencies

Reference the result of an earlier operation to pass its IDs along, such as $create-products[0].product.create.id.

Injected variables

  • $root.TENANT_ID
  • $root.TENANT_DEFAULT_VATTYPE_ID
  • $root.TENANT_ROOT_ID

Image mapping

Image mapping file
{
  "images": [
    {
      "key": "$images.crystallize-key"
    },
    {
      "key": "$images.my-tenant/25/1/12/3435d2d0/images/crystallize.png"
    }
  ]
}

Contributing

The CLI lives in the CrystallizeAPI/tools monorepo. This repository is a read-only split of it, so open issues and pull requests on CrystallizeAPI/tools.