What Is Shopify CLI?

Shopify CLI is the command-line interface that turns your terminal into a Shopify development powerhouse. Rather than clicking through the admin dashboard, you're automating repetitive tasks, spinning up test stores, and deploying changes in seconds. If you're developing Shopify apps, building custom themes, or managing storefronts at scale, CLI proficiency isn't optional—it's table stakes.

According to Shopify's developer survey, teams using CLI-first workflows ship features 40% faster than teams relying on the admin UI alone. The reason is simple: CLI reduces friction between your code editor and your live store.

Installing Shopify CLI

Before you can run any commands, you need Shopify CLI on your machine. The installation depends on your operating system.

Mac users: Install via Homebrew:

brew tap shopify/shopify
brew install shopify-cli

Windows users: Use Windows Package Manager:

winget install Shopify.ShopifyCLI

Linux users: Install via npm:

npm install -g @shopify/cli @shopify/theme

After installation, verify your setup by running:

shopify version

This returns your installed version number and confirms CLI is ready to use.

Core Shopify CLI Commands — By Use Case

App Development Commands

If you're building custom Shopify apps, these commands form your core workflow.

Create a new app project:

shopify app create node

This scaffolds a new app with the Shopify CLI template. You'll be prompted to choose a name, template type (Node.js, Ruby, PHP), and authentication method. The template includes starter code for webhooks, API integrations, and the app admin dashboard.

Start your local development server:

shopify app dev

This runs your app locally and tunnels it to a temporary Shopify store URL. Shopify assigns you a test store for development—no production store required. The CLI automatically syncs webhook events to your local machine.

Create app extensions:

shopify app function create

This scaffolds a new Shopify Function (formerly Scripts API). Functions let you modify checkout behavior, product rules, and payment methods without editing core Shopify code.

Test webhook events locally:

shopify app function test

Simulate webhook events against your local function to validate logic before deployment.

Theme Development Commands

Building or modifying Shopify themes requires a different command set than app development.

Create a new theme:

shopify theme init

This downloads a copy of the Merchants theme (Shopify's official starter theme) to your local machine. You can then customize it as needed.

Start theme development server:

shopify theme dev --store my-store.myshopify.com

This uploads your local theme files to your Shopify store and watches for changes. Every time you save a file in your editor, the theme on your store updates automatically. No manual uploads needed.

Pull an existing theme from your store:

shopify theme pull --development

This downloads the current theme from your store to your local machine. Useful when joining a team project or switching machines.

Push local theme changes to your store:

shopify theme push --unpublished

This uploads your local theme to your store as an unpublished theme. Your current live theme stays active until you publish this one.

Publish your theme (make it live):

shopify theme publish

Your theme becomes the active storefront theme immediately. The previous theme becomes your backup.

Sandbox Store Commands

Sandbox stores are temporary test environments. They're free, reset daily, and ideal for testing new features.

Create a sandbox store:

shopify sandbox create --shop-name "my-test-store"

Shopify creates a test store with sample products and customers. You get full admin access to develop and test without affecting a production store.

Delete a sandbox store:

shopify sandbox delete

This removes your test store and resets your environment.

Deployment and Release Commands

Once your app or theme is ready for production, these commands handle deployment.

Deploy your app to production:

shopify app deploy

This publishes your app to the Shopify App Store (if approved) or to your private app store for internal distribution.

Generate an API access token for CI/CD:

shopify auth token create --store my-store.myshopify.com --scopes write_products,read_customers

Creates a secure API token with specific permission scopes. Use this token in your CI/CD pipeline (GitHub Actions, CircleCI, etc.) to automate deployments without manual authentication.

Advanced CLI Features

Preview Your Theme on Desktop and Mobile

shopify theme dev --port 9999

This runs your theme on a custom port. You can then use Shopify's mobile preview tool or third-party tools like BrowserStack to test responsiveness without deploying to production.

Disable Auto-Upload During Development

shopify theme dev --no-update

If you're working with a large theme and auto-sync is slowing your machine, disable automatic file uploads. You can then push changes manually when ready.

Monitor Webhook Activity

shopify app function logs

This streams live logs from your deployed Shopify Functions. Use it to debug webhook failures and monitor function performance in production.

Collaborate With Your Team

Create a shared .env.example file (without secrets) and commit it to your repo:

SHOPIFY_API_KEY=your-key-here
SHOPIFY_API_SECRET=your-secret-here
SHOPIFY_SHOP=your-store.myshopify.com

Team members copy it to .env and fill in their own credentials. Shopify CLI reads from the .env file automatically.

Common Pitfalls and Solutions

Problem: CLI says "unauthorized" even with correct credentials.

Solution: Your API token may have expired. Run shopify auth logout and then shopify auth to re-authenticate. Shopify tokens from some auth flows last only 24 hours.

Problem: Your local dev server shows "tunnel not found."

Solution: Shopify's tunnel service is geographic. If you're behind a VPN or corporate firewall, the tunnel may drop. Try shopify app dev --tunnel=cloudflare to use Cloudflare Tunnel instead of Shopify's default.

Problem: Theme file changes aren't syncing.

Solution: Check if your store is in a region with read-only restrictions. Some Shopify stores lock theme changes during sales events. Wait for the lock period to end, or test on a sandbox store instead.

Shopify CLI in Production Workflows

Large-scale teams use Shopify CLI in automated CI/CD pipelines. For example:

GitHub Actions workflow for automated theme deployment:

name: Deploy Theme
on:
  push:
    branches: [ main ]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: npm install -g @shopify/theme
      - run: shopify theme push --no-confirm
        env:
          SHOPIFY_SHOP: ${{ secrets.SHOPIFY_SHOP }}
          SHOPIFY_APP_API_KEY: ${{ secrets.API_KEY }}
          SHOPIFY_APP_API_SECRET: ${{ secrets.API_SECRET }}

This automatically deploys your theme every time you merge to main. No manual work. No human error. Your store always reflects your repo.

When to Use CLI vs Admin Dashboard

Task Best Tool Why
One-time store configuration Admin Dashboard GUI is faster for single clicks
Bulk product uploads CLI (bulk operations) Scripting beats manual data entry
Theme customization (iterative) CLI with hot reload Edit-save-preview cycle is instant
App deployments to store CLI Automates versioning and rollback
Creating webhooks Either (CLI for automation) CLI wins for teams with multiple stores
Seasonal content push (Black Friday) CLI in CI/CD Scheduled automated deployments

Next Steps for CLI Mastery

Master these foundational commands first: shopify app dev, shopify theme dev, and shopify auth. Once comfortable, explore:

  • Shopify Scripts API for advanced checkout customization
  • Shopify Admin API for programmatic store management
  • GraphQL queries directly from your CLI environment
  • Webhook debugging to validate integrations

The Shopify CLI documentation at developers.shopify.com/docs/apps/cli is your reference, but these commands cover 90% of typical workflows.


Ready to Scale Your Shopify Development?

Whether you're a solo developer or managing an agency team, mastering Shopify CLI is the foundation of modern e-commerce development. Automation reduces bugs, speeds deployment, and lets your team focus on strategy instead of admin grunt work.

Tenten's Shopify Plus teams use CLI-first workflows to ship custom solutions 3x faster than traditional approaches. If you're building high-velocity e-commerce infrastructure, let's talk about how custom Shopify apps and headless architecture can accelerate your growth.

Let's build something faster—contact Tenten today to explore CLI automation for your Shopify store.


Editorial Note Shopify CLI transformed how we approach development at Tenten. The tunnel feature alone cuts deployment friction from hours to seconds. Master these commands and you'll outpace competitors still clicking through admin dashboards.

Frequently Asked Questions

What's the difference between Shopify CLI and Shopify Admin API?

Shopify CLI is a local development tool that manages your machine-to-store connection. The Admin API is Shopify's programmatic interface for reading and writing store data. You use CLI to set up your dev environment; you use the Admin API within your code to interact with store data.

Do I need Shopify CLI if I only modify themes?

No. If you're only customizing a pre-built theme's CSS and liquid, the admin dashboard theme editor is sufficient. But CLI becomes essential when you're building custom themes or managing multiple stores simultaneously.

Can I use Shopify CLI without Node.js?

CLI works independently, but most Shopify app development uses Node.js, Ruby, or PHP. You can build apps in other languages, but you'll lose CLI's automatic scaffolding and dev server.

How do I keep my API credentials secure in CI/CD?

Never commit your .env file to Git. Use GitHub Secrets (or your CI platform's equivalent) to store tokens. Reference secrets as environment variables in your deployment script. Shopify CLI reads from environment variables automatically.

What happens if I run `shopify app deploy` on an app that's already live?

It creates a new version and marks it as "pending review" if you're using Shopify's marketplace. For custom apps, it updates immediately. You can always roll back to a previous version from the Shopify CLI or admin dashboard.