Setup guide
How to run a query with Shopify CLI (shopify store execute)
Shopify CLI runs the same queries as the GraphiQL app, but from your computer’s terminal, and it can save every answer to a file. Install Node.js 22.12 or newer, run npm install -g @shopify/cli@latest, sign in once with shopify store auth, then run the shopify store execute command a tool gives you.
Commands and flags checked against Shopify’s CLI reference on shopify.dev on 28 November 2026.
When to use it
You never need the CLI: every tool also works with the GraphiQL app. Use the CLI when a tool says a job has many batches, because it runs them one after another and saves the answers to a file you paste back.
Install it (once)
Install Node.js. Download Node.js 22.12 or newer from nodejs.org and install it. Shopify CLI also needs Git 2.28 or newer.
Open a terminal. On a Mac, open Terminal. On Windows, open PowerShell.
Install Shopify CLI. Paste this command and press Enter.
npm install -g @shopify/cli@latestCheck it worked. Run shopify version. You should see a version number.
shopify version
Sign in to your store (once per store)
Run store auth. Replace the store address with yours and the scopes with the ones the tool lists, separated by commas. A browser window asks you to approve.
shopify store auth --store your-store.myshopify.com --scopes read_products,write_products
Run a query or a change
Save the files. Save the tool’s query as query.graphql and its variables (if any) as variables.json in the folder your terminal is in. Many tools give you a ready-made script that does this for you.
Run the command. Changes are switched off unless you add --allow-mutations, so a read can never change your store by accident.
shopify store execute --store your-store.myshopify.com \ --query-file query.graphql --variable-file variables.json \ --allow-mutations --json --output-file result.jsonPaste the answer back. Open result.json, copy everything, and paste it into the tool’s results step.
Tools that need this
- Tracking Numbers Bulk Fulfiller
Turn a supplier or 3PL tracking CSV into Shopify fulfillments with a dry-run preview first, and export tracking numbers.
- Discount Code Importer
Generate or paste thousands of unique discount codes and add them to Shopify without an app.
- Metaobject CSV Bridge
Import metaobject entries from a CSV or export them to one, with every field type checked. No app needed.
- Collections Bulk Builder
Create many automated collections at once from a list of tags or a rules CSV. No app needed.
More setup guides
- How to install Shopify’s GraphiQL app and run a query
Install Shopify’s free GraphiQL app once, then open it from Apps, paste the code and press Run.