Using Shopify CLI for Bulk Operations (New Feature)
Shopify CLI 3.90.1 introduces powerful new commands that let you execute Admin API queries, mutations, and bulk operations directly from your terminal.

This is a game-changer for developers who need to script and automate data operations without building custom tooling.

New Commands
Standard API Queries
shopify app execute 'query { shop { name } }'
Run any GraphQL query or mutation against the Admin API.
Bulk Operations
# Start a bulk queryshopify app bulk execute 'query { products(first: 1000) { edges { node { id title } } } }'# Watch progress synchronouslyshopify app bulk execute 'query { ... }' --watch# Check status of running operationshopify app bulk status# Cancel an operationshopify app bulk cancel
Why This Matters
Before: Bulk operations required:
- Custom scripts with polling logic
- Error handling for long-running jobs
- Complex state management
Now:
- One CLI command
- Optional
--watchflag makes it synchronous - Perfect for automation and scripting
Practical Use Cases
1. Data Migration
Export all products to JSON in one command:
shopify app bulk execute 'query { products(first: 10000) { edges { node { id title handle } } } }' --watch > products.json
2. Bulk Updates
Update pricing across thousands of variants:
shopify app bulk execute 'mutation { productVariantsBulkUpdate(...) { ... } }'
3. AI Coding Agents
This is perfect for AI tools like Cursor, Claude, or GitHub Copilot. They can now query and manipulate dev stores without building custom integrations.
4. Scheduled Scripts
Use in cron jobs for daily operations:
# Daily inventory sync at 6 AM0 6 * * * shopify app bulk execute 'query { inventoryItems(first: 1000) { ... } }' --watch > /var/log/inventory.json
5. CI/CD Pipelines
Integrate bulk operations into your deployment workflow:
- Pre-deploy data validation
- Post-deploy data seeding
- Automated testing with real data
Pro Tips
- Use
--watchwhen you need results immediately (scripts, CI/CD) - Combine with
jqfor powerful JSON processing - Perfect for one-off fixes without building full apps
- Great for prototyping bulk operations before implementing in code
Example: Bulk Tag Sync
shopify app bulk execute 'mutation bulkOperationRunMutation($mutation: MutationQuery!$input: BulkOperationInput!) {bulkOperationRunMutation(mutation: $mutation, input: $input) {bulkOperation { id status }userErrors { field message }}}' --watch
What This Unlocks
This feature removes the friction from bulk operations:
✅ No custom polling scripts ✅ No complex state management ✅ Easy automation with cron/CI ✅ AI agents can work with store data ✅ Quick one-off data fixes
Learn More
For complete documentation, see:
Bottom Line
This is one of those quality-of-life improvements that makes development significantly easier. If you work with Shopify data at scale, add these commands to your toolkit.
Building with Hydrogen? Weaverse helps you ship faster with AI-powered theme development. Get started.



