askill
shopify-cli

shopify-cliSafety 90Repository

Comprehensive guide for Shopify CLI app development lifecycle. Use when working with Shopify apps - initializing projects, managing TOML configurations, running local development (shopify app dev), deploying extensions, setting up multi-environment workflows (dev/staging/prod), or automating CI/CD pipelines. Includes helper scripts for common tasks like environment setup, config validation, webhook testing, and deployment automation.

0 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Shopify CLI for App Development

Shopify CLI manages the entire app lifecycle through configuration-as-code. All settings live in TOML files under version control.

Quick Start

# Create new app
shopify app init

# Link existing app to local project
shopify app config link

# Start local development (isolated to your dev store)
shopify app dev

# Deploy configuration and extensions
shopify app deploy

Configuration as Code

shopify.app.toml Structure

name = "My App"
client_id = "abc123..."
application_url = "https://myapp.com"
embedded = true

[access_scopes]
scopes = "read_products,write_orders"

[auth]
redirect_urls = ["https://myapp.com/api/auth/callback"]

[webhooks]
api_version = "2024-01"

[[webhooks.subscriptions]]
topics = ["app/uninstalled"]
uri = "/webhooks"

Key Fields

FieldPurpose
nameDisplay name in Shopify admin
client_idApp identifier (from Partner Dashboard)
application_urlMain app URL
embeddedWhether app renders in Shopify admin
access_scopes.scopesPermissions (comma-separated)
auth.redirect_urlsOAuth callback URLs
webhooks.subscriptionsWebhook endpoints

Warning: Changing handle permanently changes your app's URL in Shopify admin, breaking existing bookmarks.

Development Workflow

Local Development with shopify app dev

The app dev command creates an isolated preview on your chosen dev store:

  • Changes visible only on YOUR dev store (safe for teams)
  • Real-time sync of config and extensions
  • App URL updated only for preview (doesn't modify TOML)
  • Preview persists after stopping until shopify app dev clean

Networking Options

OptionCommandUse Case
Cloudflare Tunnel(default)Standard development
Localhost--use-localhostSimple frontend work (no webhooks)
Custom Tunnel--tunnel-url <url>ngrok or corporate firewall

Team Workflow

  1. Share single development app (commit shopify.app.toml)
  2. Each developer creates their own dev store
  3. Run shopify app dev selecting personal dev store
  4. Changes isolated - no conflicts between team members

Multi-Environment Setup

Manage dev/staging/prod from single codebase using named config files:

shopify.app.toml              # Default (development)
shopify.app.staging.toml      # Staging
shopify.app.production.toml   # Production

Create Environment Configs

# Link to staging app (creates shopify.app.staging.toml)
shopify app config link
# Select staging app, name it "staging"

# Link to production app
shopify app config link
# Select production app, name it "production"

Switch Environments

# Set default for session
shopify app config use staging

# Override for single command
shopify app deploy --config production

See: references/multi-environment.md for detailed setup guide.

Deployment

App Versions

shopify app deploy creates an immutable app version - a snapshot of config + extensions.

# Deploy and release immediately
shopify app deploy

# Deploy without releasing (for testing)
shopify app deploy --no-release

# Release a previous version
shopify app release --version <version>

# List all versions
shopify app versions list

Important: deploy pushes config and extensions only. Deploy your web app separately to your hosting provider.

CI/CD Integration

# Non-interactive deployment (for pipelines)
shopify app deploy --config production --force

See: references/ci-cd.md for GitHub Actions examples.

Helper Scripts

This skill includes automation scripts in scripts/:

ScriptPurpose
dev-setup.shComplete dev environment setup
init-multi-env.shCreate dev/staging/prod configs
generate-toml.pyGenerate TOML templates
validate-config.pyValidate TOML files
deploy-env.shDeploy to specific environment
sync-config.shSync changes between environments
webhook-test.pyTrigger test webhooks

Script Dependencies

Python scripts require additional packages for TOML handling:

# Install Python dependencies (from skill's scripts/ directory)
pip install -r scripts/requirements.txt

# Or install manually:
pip install tomli tomli-w  # tomli only needed for Python < 3.11

Usage Examples

Copy scripts to your project or run from skill location:

# Set up dev environment from scratch
./dev-setup.sh

# Initialize multi-environment configs
./init-multi-env.sh

# Validate config before deploy
python validate-config.py shopify.app.toml

# Deploy to staging with confirmation
./deploy-env.sh staging

# Test webhook locally
python webhook-test.py --topic orders/create --address http://localhost:3000/webhooks

Common Tasks

Add New Permission Scope

  1. Edit shopify.app.toml: add scope to access_scopes.scopes
  2. Run shopify app dev - scope auto-accepted on dev store
  3. Deploy to staging: shopify app deploy --config staging
  4. Deploy to production: shopify app deploy --config production

Add Webhook Subscription

[[webhooks.subscriptions]]
topics = ["orders/create", "orders/updated"]
uri = "/webhooks/orders"

Test Webhooks Locally

# Using CLI directly
shopify app webhook trigger --topic orders/create --address http://localhost:3000/webhooks

# Using helper script (more options)
python scripts/webhook-test.py --topic orders/create

Clean Up Dev Store

# Restore dev store to released version, remove preview extensions
shopify app dev clean

Warning: dev clean deletes data tied to preview-only extensions (e.g., discounts using unreleased functions).

Troubleshooting

Tunnel Issues

If Cloudflare tunnel blocked by firewall:

shopify app dev --tunnel-url https://your-ngrok-url.ngrok.io

Permission Denied on Dev Store

Access scope changes require re-installation or shopify app dev (auto-accepts on dev stores).

Extension Not Appearing

  1. Check extension registered: shopify app info
  2. Verify extension TOML in extensions/ directory
  3. Restart shopify app dev if extension added during session

Reference Documentation

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/10/2026

An exceptionally well-structured and comprehensive guide for Shopify CLI development. It covers the entire application lifecycle, multi-environment management, and CI/CD integration, supplemented by practical automation scripts and clear safety warnings.

90
95
90
98
95

Metadata

Licenseunknown
Version-
Updated2/5/2026
Publishermajiayu000

Tags

apici-cdgithubgithub-actionssecuritytesting