Shopify CLI
$ shopify Official Med RiskShopify CLI automates app scaffolding, Hydrogen storefronts, Shopify Functions, and Liquid theme synchronization against development or live stores. Store selection via --store and browser OAuth keeps agent workflows scoped, though dev servers and theme watch commands are interactive/long-running.
brew install shopify-cli Use shopify CLI for theme push/pull, app builds, and extension deployment; pair with Shopify Dev MCP when agents only need GraphQL Admin API schema or docs lookup.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json on inspection commands like theme list and app info, though dev commands open browsers and block.
--jsonflag available on read and theme list commandsshopify app devandshopify theme devrun interactive watchers
Requires explicit --store targeting and supports --unpublished theme isolation plus --password theme access tokens.
- Theme Access App tokens scope permissions away from full admin OAuth
--unpublishedprevents overwriting the live theme
Cross-platform via npm or Homebrew, requiring Node.js and occasionally Ruby for older theme tooling.
- Published on npm as
@shopify/cliand Homebrew
Essential for Shopify theme validation (theme check), bundling, and extension deployment.
- Bundles Theme Check static analysis directly inside the CLI
Official Shopify repository (Shopify/cli) with frequent releases under MIT.
- Actively maintained by Shopify engineering
Comprehensive Shopify Dev CLI command reference with clear flag tables.
- Official docs at shopify.dev/docs/api/shopify-cli
Security, Auth & Guardrails
Stores OAuth session tokens locally under OS config directories or reads SHOPIFY_CLI_PARTNERS_TOKEN / theme access passwords via --password.
CLI is free (MIT); Shopify Partner development stores are free, while production stores require a Shopify plan.
# Shopify CLI Agent Rules - Always target a development store or `--unpublished` theme; NEVER pass `--live` on `shopify theme push` without human approval. - Run `shopify theme check` before pushing any Liquid or JSON template edits. - Do not invoke `shopify app dev` or `shopify theme dev` synchronously without a background timeout.
Agent-Ready Command Recipes
Safe Read-Only Queries
shopify theme list --store example.myshopify.com --json
Reads installed themes and roles from the target store in structured JSON.
shopify theme check --fail-level error
Runs Shopify Theme Check statically on local Liquid templates without touching remote store state.
Controlled Writes & Previews
shopify theme push --store example.myshopify.com --unpublished --theme agent-preview --json
Uploads local theme changes to a non-live unpublished theme so the live storefront stays untouched.
Strengths for Agents
- + Built-in
shopify theme checkcatches Liquid and schema bugs locally before remote uploads. - + Supports
--unpublisheddraft themes and--jsonoutput for structured store inspection. - + Theme Access tokens limit blast radius compared to broad Partner OAuth sessions.
Caveats & Pitfalls
- !
shopify app devandshopify theme devspawn long-lived processes and interactive prompts. - ! Initial OAuth login typically expects a local browser unless
SHOPIFY_CLI_PARTNERS_TOKENor a Theme Access password is set.