<aside> 📢

Deprecated (April 2026). The Shopify CLI now has built-in store execution capabilities that handle content management natively. Shopify's AI Toolkit builds on top of this, giving AI tools like Claude Code direct Admin API access. It does the same thing - creates an app, installs it on your store, and gives you API access - but setup is much quicker. For content management, use the Shopify CLI and AI Toolkit instead of this template.

</aside>

Managing store content through direct GraphQL queries and AI-assisted workflows.

<aside> ℹ️

Prerequisites

<aside> ⚠️

You don't need scripts for content management. The example scripts (scripts/examples/, included in the scripts preset) are for data-heavy operations like migrations and bulk updates, not for day-to-day content work. For creating metafields and metaobjects, setting values, managing menus and pages, npm run gql and the /store-content slash command are all you need. See the Script Development Guide only if you're building custom migration or bulk update scripts.

</aside>

Using npm run gql

The gql CLI tool lets you run any Admin API query or mutation from the terminal. It reads the access token from the database, so no .env or authentication setup is needed after the initial install.

Inline queries

Pass a GraphQL query directly as a string:

npm run gql -- '{ shop { name email myshopifyDomain } }'

For mutations, the same pattern applies:

npm run gql -- 'mutation { metafieldsSet(metafields: [{ ownerId: "gid://shopify/Product/123", namespace: "custom", key: "care_instructions", type: "single_line_text_field", value: "Machine wash cold" }]) { metafields { id key value } userErrors { field message } } }'

Queries from files

For anything beyond a one-liner, save the query as a .graphql file in the queries/ directory and pass the file path:

npm run gql -- ./queries/shop.graphql

This keeps queries readable, reusable, and version-controlled.

Passing variables

Add a JSON string as the second argument to pass variables:

npm run gql -- ./queries/metafieldDefinitions.graphql '{"ownerType":"PRODUCT"}'

Inline queries with variables work the same way:

npm run gql -- 'query ($id: ID!) { product(id: $id) { title } }' '{"id":"gid://shopify/Product/123"}'