| name | cli-tools |
| description | Master Shopify CLI and developer tools. Use this skill for using Shopify CLI commands, theme development workflow, app development workflow, debugging with Theme Check, using the Liquid language server, and configuring development environments. Covers VS Code extension and development best practices. |
Shopify CLI & Developer Tools
When to use this skill
Use this skill when:
- Installing and configuring Shopify CLI
- Running theme development commands
- Running app development commands
- Using Theme Check for linting
- Configuring VS Code for Shopify development
- Debugging Liquid code
- Setting up development workflows
Installing Shopify CLI
Prerequisites
- Node.js 18+ - Required for all Shopify development
- Git - For version control
- Package manager - npm or pnpm
Installation
npm install -g @shopify/cli @shopify/theme
brew tap shopify/shopify
brew install shopify-cli
shopify version
Authentication
shopify auth login
shopify auth logout
shopify auth info
Theme CLI Commands
Initialize Theme
shopify theme init my-theme
shopify theme init my-theme --clone-url git@github.com:org/repo.git
Development Server
shopify theme dev
shopify theme dev --store my-store.myshopify.com
shopify theme dev --theme THEME_ID
shopify theme dev --port 9292
shopify theme dev --open
shopify theme dev --live-reload hot-reload
shopify theme dev --live-reload full-page
shopify theme dev --live-reload off
Push & Pull
shopify theme push
shopify theme push --unpublished
shopify theme push --theme THEME_ID
shopify theme push --only templates/*.json
shopify theme push --ignore config/settings_data.json
shopify theme pull
shopify theme pull --theme THEME_ID
shopify theme pull --only sections/*.liquid
Theme Management
shopify theme list
shopify theme publish --theme THEME_ID
shopify theme rename --theme THEME_ID --name "New Name"
shopify theme delete --theme THEME_ID
shopify theme package
shopify theme open --theme THEME_ID
Theme Check (Linting)
shopify theme check
shopify theme check --path ./sections
shopify theme check --auto-correct
shopify theme check --output json
shopify theme check --fail-level warning
shopify theme check --print-offenses
Theme Info & Console
shopify theme info
shopify theme console
shopify theme metafields pull
App CLI Commands
Create App
shopify app init
Development
shopify app dev
shopify app dev --reset
shopify app dev --no-tunnel
shopify app dev --port 3000
Generate Extensions
shopify app generate extension
Deployment
shopify app deploy
shopify app versions list
shopify app release --version VERSION_ID
App Info
shopify app info
shopify app env show
shopify app env pull
Functions
shopify app function run --path extensions/my-function
shopify app function typegen --path extensions/my-function
VS Code Extension
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search "Shopify Liquid"
- Install the official extension
Or install from CLI:
code --install-extension Shopify.theme-check-vscode
Features
| Feature | Description |
|---|
| Syntax Highlighting | Liquid, HTML, CSS, JS highlighting |
| Code Completion | Objects, filters, tags, schema |
| Documentation on Hover | Inline docs for Liquid code |
| Theme Check Integration | Real-time linting |
| Schema Completion | JSON schema in sections |
| Go to Definition | Navigate to snippets/sections |
| Auto-closing Pairs | Liquid tags and braces |
| Code Formatting | Format Liquid code |
Configuration
{
"shopifyLiquid.formatterDevPreview": true,
"shopifyLiquid.themeCheckNextDevPreview": true,
"editor.formatOnSave": true,
"[liquid]": {
"editor.defaultFormatter": "Shopify.theme-check-vscode"
},
"files.associations": {
"*.liquid": "liquid"
}
}
Theme Check Configuration
.theme-check.yml
extends: :default
SyntaxError:
enabled: true
severity: error
DeprecatedFilter:
enabled: true
severity: warning
MissingTemplate:
enabled: true
UnusedAssign:
enabled: true
UnusedSnippet:
enabled: false
ImgWidthAndHeight:
enabled: true
AssetSizeCSS:
enabled: true
threshold_in_bytes: 100000
AssetSizeJavaScript:
enabled: true
threshold_in_bytes: 50000
ignore:
- vendor/**/*
- assets/vendor.js
Common Theme Check Errors
| Error | Solution |
|---|
MissingTemplate | Create missing template file |
DeprecatedFilter | Update to new filter syntax |
UnusedAssign | Remove or use the variable |
SyntaxError | Fix Liquid syntax |
AssetSizeCSS | Reduce CSS file size |
ImgWidthAndHeight | Add width/height to images |
Development Workflow
Theme Development
shopify theme init my-theme
cd my-theme
shopify theme dev --store my-store.myshopify.com
shopify theme check
shopify theme push --theme THEME_ID
shopify theme publish --theme THEME_ID
App Development
shopify app init
shopify app generate extension
shopify app dev
shopify app deploy
Environment Configuration
.shopify-cli.yml (Theme)
shop: my-store.myshopify.com
theme: THEME_ID
path: .
ignore:
- config/settings_data.json
- .git/*
.env (App)
SHOPIFY_API_KEY=your-api-key
SHOPIFY_API_SECRET=your-api-secret
SHOPIFY_APP_URL=https://your-app.com
SCOPES=read_products,write_products
HOST=https://tunnel.ngrok.io
CI/CD Integration
GitHub Actions (Theme Check)
name: Theme Check
on: [push, pull_request]
jobs:
theme-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Shopify CLI
run: npm install -g @shopify/cli @shopify/theme
- name: Run Theme Check
run: shopify theme check --fail-level error
GitHub Actions (App Deploy)
name: Deploy App
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: npm ci
- name: Deploy
env:
SHOPIFY_CLI_PARTNERS_TOKEN: ${{ secrets.SHOPIFY_CLI_PARTNERS_TOKEN }}
run: npm run deploy
Troubleshooting
Common Issues
CLI not found after install:
which node
npm install -g @shopify/cli
Authentication issues:
shopify auth logout
shopify auth login --reset
Theme dev not syncing:
Port already in use:
shopify theme dev --port 9293
shopify app dev --port 3001
Quick Reference
Theme Commands
| Command | Description |
|---|
theme init | Initialize theme |
theme dev | Start dev server |
theme push | Upload to store |
theme pull | Download from store |
theme check | Run linter |
theme list | List themes |
theme publish | Publish theme |
App Commands
| Command | Description |
|---|
app init | Create app |
app dev | Start dev server |
app deploy | Deploy app |
app generate extension | Add extension |
app info | Show app info |
app function run | Test function |
Resources
For theme development, see the theme-development skill.
For app development, see the app-development skill.