Liquid Tutorial

theme dev — Local Development

Source: ShopifyDevs

Live Preview with Hot Reload

shopify theme dev is the core daily workflow command. It uploads your local theme to a temporary development theme on your store, prints a preview URL, and watches files for changes. On save, CLI syncs the changed file and triggers a browser refresh.

BASH
cd my-theme

# Start dev server
shopify theme dev --store your-store.myshopify.com

# Output example:
# Preview: https://your-store.myshopify.com/?preview_theme_id=123456789
# Shareable: https://your-store.myshopify.com/?preview_theme_id=123456789
# (Ctrl+C to stop)

Useful Flags

  • --store — target .myshopify.com domain
  • --theme THEME_ID — sync to an existing theme instead of creating a dev theme
  • --only sections — sync only the sections/ folder (faster for large themes)
  • --ignore config/settings_data.json — don't overwrite merchant editor changes
  • --host 127.0.0.1 — local proxy configuration
  • --port 9292 — custom local server port
BASH
# Fast iteration: only sync Liquid partials
shopify theme dev \
  --store your-store.myshopify.com \
  --only sections \
  --only snippets \
  --only layout
  1. Run theme dev in one terminal tab — leave it running all day
  2. Edit files in your editor — save triggers sync within 1-2 seconds
  3. Test on the preview URL — cart and checkout work with test payments
  4. Use browser DevTools for CSS/JS; use Liquid comments for template debugging
Tip: Add config/settings_data.json to .gitignore if multiple developers share a store — each dev's editor settings conflict otherwise.