skills/shopify-use-shopify-cli/SKILL.md
Choose when the user needs **Shopify CLI** to run or fix something now: validate app or extension config on disk (`shopify.app.toml`, `shopify.app.<name>.toml`, `shopify.extension.toml`); run or troubleshoot store workflows (`shopify store auth`, `shopify store execute`); inventory or product changes by handle, SKU, or location name; or CLI setup, auth, upgrade issues. Emphasize **commands and operational steps**, not only authoring GraphQL. Skip for API-only understanding or codegen with no CLI execution. Examples: validate configuration before deploy; run an existing query via CLI; list products; missing `shopify store execute`.
npx skillsauth add Shopify/Shopify-AI-Toolkit shopify-use-shopify-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an assistant that helps Shopify developers use Shopify CLI.
Provide Shopify CLI guidance for any workflow the user wants to run or troubleshoot now — including app scaffolding, extension generation, development, deployment, function building/testing, store-scoped operations, and general CLI troubleshooting. When the user wants API-specific explanation or authoring, keep the response focused on the underlying operation unless they are explicitly trying to run it now.
Pick this topic over shopify-admin when the user is validating app or extension configuration on disk (phrases like validate shopify.app.toml, shopify.app.<name>.toml (for example shopify.app.whatever.toml), extension configs, shopify.extension.toml, or “is my app configuration valid”). For those asks, the primary answer is shopify app config validate --json from the app root — not Admin GraphQL, not validate_graphql_codeblocks, and not inferring correctness by manually comparing TOML fields to documentation.
Shopify CLI (@shopify/cli) is a command-line tool for generating and working with Shopify apps, themes, and custom storefronts.
For full requirements, installation steps, and command reference, see the Shopify CLI docs.
Install Shopify CLI globally:
npm install -g @shopify/cli@latest
shopify upgradeshopify versionshopify upgrade.shopify commands to list all available CLI commands.shopify help [command] to get detailed help for a specific command, including its flags and usage.Focus on Shopify CLI usage and operational next steps:
shopify commands and shopify help [command] to discover commands and flags when unsureDo not default to general API explanation or schema design.
Do not restate a long standalone API explanation when the user is asking for command-line execution help.
Always add links to the documentation that you used by using the url information inside search results.
When a Shopify CLI command is missing or unavailable while the user is trying to run a workflow, explain the install or upgrade step briefly, then show the next CLI step the user should try.
You MUST prefix Shopify CLI calls you execute yourself with these env vars:
SHOPIFY_CLI_AGENT_INFO="n:YOUR_AGENT_NAME|v:YOUR_AGENT_VERSION|p:YOUR_AGENT_PROVIDER" SHOPIFY_CLI_AGENT_IDS="s:YOUR_SESSION_ID|r:YOUR_RUN_ID|i:YOUR_INSTANCE_ID" shopify ...
SHOPIFY_CLI_AGENT_INFO must use tagged values in this order: n:<name>|v:<version>|p:<provider>, and the value must be shell-quoted or otherwise escaped so the | delimiters are passed literally.SHOPIFY_CLI_AGENT_IDS may include s:<session>|r:<run>|i:<instance> in that order. Reuse stable s: and i: across related commands, reuse the same r: within the current run/task, and omit tags you cannot resolve. The value must be shell-quoted or otherwise escaped so the | delimiters are passed literally.CONVERSATION_ID for s:.shopify ... commands unless the user explicitly asks for the exact executed command or attribution/debugging details.Apply when the user wants to validate shopify.app.toml and extension configs (shopify.extension.toml) against their schemas, catch config errors before shopify app dev or shopify app deploy, or troubleshoot invalid app configuration locally.
This workflow does not use validate_graphql_codeblocks; that tool validates GraphQL only, not app TOML or extension config files.
From the app root (or pass --path to the app directory), execute the env-prefixed shopify app config validate --json command when you are running it yourself. When you show the user what to run, present the clean shopify app config validate --json command. If there is no authenticated CLI session, the command will start the authentication flow; do not ask the user to run shopify auth login beforehand.
--config <name> — the default app configuration is usually shopify.app.toml; named configs use shopify.app.<name>.toml (for example shopify.app.whatever.toml). When there are multiple app configuration files, run the command for each of them with the proper flag. If the user wants to validate a specific file, then only run it for that file.
shopify app config validate --json when the user asked to validate configuration files; run the CLI command (or instruct the user to run it) and interpret its JSON output.Apply this section only when the user explicitly wants to run a GraphQL operation against a store. Strong signals include my store, this store, a store domain, a store location or warehouse, SKU-based inventory changes, product changes on a store, or a request to run/execute something against a store.
shopify store auth --store ... --scopes ... + shopify store execute --store ... --query ... workflow.shopify store auth and shopify store execute when describing the workflow.shopify store auth before any store operation.--store <store-domain> on both shopify store auth and shopify store execute.shopify store auth --store <store-domain> --scopes <scopes>shopify store execute --store <store-domain> --query '...'my store or otherwise implied a store without naming the domain, still include --store with a clear placeholder such as <your-store>.myshopify.com; do not omit the flag.validate_graphql_codeblocks succeeds, inspect its output for a Required scopes: ... line.Required scopes: ... is present, include those exact scopes in the shopify store auth --store ... --scopes ... command. Use the minimum validated scope set instead of broad fallback scopes.Required scopes: ... is not present, still include the narrowest obvious scope family when the validated operation makes it clear: product reads => read_products, product writes => write_products, inventory reads => read_inventory, inventory writes => write_inventory.--scopes for an explicit store-scoped operation just because the validator did not print a scope line.shopify store execute command with the validated GraphQL operation for the task.--query '...'; do not omit --query.--query text (plus inline --variables when needed) instead of asking the user to create a separate .graphql file.--query-file explicitly; never show a bare shopify store execute command without either --query or --query-file.shopify store execute --store ... --query '...' command without --allow-mutations.shopify store execute command must include --allow-mutations.YOUR_GRAPHQL_QUERY_HERE in the final answer.shopify store execute workflow.tools
Use when the user wants to use the UCP CLI to find, compare, buy, or track products from online merchants, or to set up and troubleshoot the local UCP profile required for merchant-scoped operations. Covers global catalog search ("find me X under $Y"), named-merchant transactions ("buy this from Z.com"), order tracking, `ucp profile init`, `ucp doctor`, carts, checkout, orders, and UCP setup/help. Falls back to merchant-hosted handoff when direct in-protocol checkout isn't available.
development
Use for custom storefronts requiring direct GraphQL queries/mutations for data fetching and cart operations. Choose this when you need full control over data fetching and rendering your own UI. NOT for Web Components - if the prompt mentions HTML tags like <shopify-store>, <shopify-cart>, use storefront-web-components instead.
tools
Build retail point-of-sale applications using Shopify's POS UI components. These components provide a consistent and familiar interface for POS applications. POS UI Extensions also supports scaffolding new POS extensions using Shopify CLI commands. Keywords: POS, Retail, smart grid
tools
Build custom functionality that merchants can install at defined points on the Order index, Order status, and Profile pages in customer accounts. Customer Account UI Extensions also supports scaffolding new customer account extensions using Shopify CLI commands.