DEV Community

Cover image for I Built a CLI So AI Agents Can Manage My Shopify Store
c99e
c99e

Posted on

I Built a CLI So AI Agents Can Manage My Shopify Store

I use AI tools for most of my software engineering work now. But every time I needed to do something in Shopify (check an order, update a product, look up a customer) I had to leave the terminal, open the admin dashboard, and click around. The AI could write code, run tests, manage deployments, but it couldn't touch my store.

So I built shopq: a zero-dependency CLI for the Shopify Admin API, designed from the ground up to work with AI agents.

The Gap

There are three ways to interact with a Shopify store, and none of them fit an AI-first workflow.

The admin dashboard is point-and-click. Sure, you could throw a computer-use agent at it, but a direct CLI will always be simpler and faster than an AI trying to navigate a web UI.

The GraphQL Admin API is powerful, and AI actually works with it pretty well. But building and maintaining a full client around it is overkill if you just want to manage your store. You shouldn't need to scaffold a whole project to list your products.

Shopify's own CLI is built for app and theme development, not store management. It doesn't help you query orders or update products.

I wanted to manage my Shopify store the same way I manage everything else in my dev workflow: from the terminal, with AI doing the heavy lifting.

Built for Agents

shopq was built with AI agents as the primary user.

That means: structured JSON output (--json), predictable exit codes, no interactive prompts, no ambiguity. Everything an agent needs to run a command, parse the result, and decide what to do next.

It also ships with a SKILL.md, so AI tools that support skills can pick it up and understand how to use it immediately. It's listed in the pi directory too, so users with compatible AI terminals can install the skill and CLI together and start working right away.

Zero dependencies. Just Bun's built-in capabilities. Install it and go.

What shopq Does

shopq wraps the Shopify Admin GraphQL API and exposes it as simple, composable commands. Products, orders, collections, pages, files, themes. The things you actually touch day-to-day.

# install globally (works with Bun v1.3+ or Node.js v22+)
bun install -g shopq

# store info
shopq shop get

# products
shopq product list
shopq product get "Summer Tee"
shopq product create --title "New Item" --vendor "My Brand"
shopq product update "Summer Tee" --status active

# pages, collections, menus
shopq page list
shopq collection get "frontpage"
shopq menu list

# structured output for piping and automation
shopq product list --json
Enter fullscreen mode Exit fullscreen mode

No GraphQL knowledge required. No browser. Structured, predictable output that both humans and AI agents can work with.

And for the cases where existing commands don't cover what you need, there's a direct GraphQL escape hatch:

shopq gql "{ shop { name email } }"
shopq gql - < query.graphql
shopq gql "mutation(...)" --variables '{"id":"..."}'
Enter fullscreen mode Exit fullscreen mode

This covers the long tail. AI is actually great at writing one-off GraphQL queries, so between the built-in commands and gql, you can do pretty much anything the Admin API supports.

Try It

# install the CLI globally
bun install -g shopq

# or install as a pi coding agent package
pi install npm:shopq
Enter fullscreen mode Exit fullscreen mode

Full source and docs: github.com/c99e/shopq

If you're building on Shopify and using AI tools in your workflow, give it a try. I'm actively developing it and want to hear what commands or workflows would be most useful.

What Shopify tasks would you want your AI agent to handle?

Top comments (0)