Dev

CloudCart CLI

AI-first command-line tool for managing CloudCart stores via the GraphQL Admin API.

The CloudCart CLI (cloudcart) lets you query, explore, and manage your store directly from the terminal. It is built AI-first: every command supports structured output (--json, --compact-output), and built-in commands like describe and llms-context give AI assistants everything they need to operate your store autonomously.

# Ask your store anything
cloudcart app execute --query '{ generalSettings { siteName } }' --json

What you can do

AreaCommandsWhat it does
GraphQL executionapp executeRun queries and mutations inline, from files, or piped via stdin
Schema explorationapp schemaSearch types and fields without loading the full schema
Query validationapp validateCatch typos and invalid fields before executing
Authenticationauth login / logout / statusPAT and JWT auth with secure keychain storage
Headless storefrontsnitrogen *Scaffold, develop, and deploy Nitrogen storefronts
AI integrationdescribe, llms-contextSelf-describing commands and built-in LLM context

Install

brew tap cloudcart/tap
brew install cloudcart
npm install -g @cloudcart/cli@latest
pnpm add -g @cloudcart/cli@latest
yarn global add @cloudcart/cli@latest
bun add -g @cloudcart/cli@latest

Requires Node.js 20+ for the npm-based installs. Verify the installation:

cloudcart --version

Quickstart

1. Create a Personal Access Token

In your store admin, open Settings → PAT Tokens and click Create Token. Choose Read Only to start — you can create a Full Access token later when you need mutations.

Follow the step-by-step PAT guide if this is your first time.

2. Authenticate

# Option A: environment variables (recommended for CI and AI agents)
export CLOUDCART_CLI_TOKEN=cc_pat_your_token
export CLOUDCART_CLI_STORE=mystore.cloudcart.com

# Option B: interactive login (stores the token in your OS keychain)
cloudcart auth login

3. Run your first query

cloudcart app execute --query '{ products(first: 5) { edges { node { id name pricing { from to } } } pageInfo { total } } }'

4. Explore the schema

# Find everything related to orders — without downloading the full schema
cloudcart app schema --search order --compact

5. Validate before you execute

cloudcart app validate --query '{ products(first: 5) { edges { node { id nmae } } } }'
# ✗ Cannot query field "nmae" on type "Product". Did you mean "name"?

Working with an AI assistant?

Run cloudcart llms-context and paste the output into your AI tool — or better, connect the CloudCart Dev MCP server so your assistant can search and validate against the live schema automatically. See Using the CLI with AI agents.

Next steps

On this page