Shopify CLI for themes

Shopify CLI helps you build Shopify themes and apps. It quickly generates Node.js apps, Ruby on Rails apps, app extensions, and Shopify themes. It also automates many common development tasks.

This documentation explains how to use Shopify CLI for theme development. To learn how to use Shopify CLI for app development, see Shopify CLI for apps.

Choosing between Shopify CLI and Theme Kit

Shopify CLI replaces Theme Kit for most Shopify theme development tasks. You should use Shopify CLI if you're working on Online Store 2.0 themes. You should use Theme Kit instead of Shopify CLI only if you're working on older themes or you have Theme Kit integrated into your existing theme development workflows.

Features

Shopify CLI accelerates your theme development process with the following features:

  • Safely preview, test, and share changes to themes using development themes
  • Hot reload CSS and section changes when previewing a theme
  • Initialize a new theme using Dawn as a starting point
  • Push and publish themes from the command line
  • Run Theme Check on your theme
  • Populate test data for your theme, including products, customers, and draft orders

Development themes

Development themes are temporary, hidden themes that are connected to the Shopify store that you're using for development. When you connect your theme to a store as a development theme, you can use that store's data for local testing.

You can create a development theme using the shopify theme serve command.

You can use development themes on a Shopify store or a development store. Development themes don't count toward your theme limit, and are deleted from the store after seven days of inactivity.

Your development theme is deleted when you run shopify logout. If you want a preview link for the theme that can be accessed after you log out, then you should push your development theme to an unpublished theme on your store.

Your development theme can be used to perform the following tasks:

  • View changes in real time to a theme that you're developing locally
  • Customize and interact with the theme using the Shopify admin theme editor
  • Share a password-protected preview of the theme with other developers

Installation

To learn how to install Shopify CLI on Windows, macOS, or Linux, refer to Install Shopify CLI.

Getting started

Review the getting started with Shopify CLI guide to learn about topics including:

  • Requirements for using Shopify CLI
  • Connecting to a store
  • Creating a new theme
  • Previewing a theme
  • Checking a theme for errors

Excluding files from Shopify CLI

If you have files in the same repository as your theme that you don't want to interact with using Shopify CLI, then you can add them to a .shopifyignore at the root of the theme.

.shopifyignore accepts references to files in the following formats:

  • Simple file names: templates/product.temp.json
  • Wildcards: config/*_secret.json, *.jpg
  • Regular expressions: /\.(txt|gif|bat)$/

Command references

Shopify CLI offers basic commands for authenticating and communicating with Shopify, and specific commands for theme development.

Troubleshooting

To learn how to upgrade Shopify CLI, migrate from a legacy version, and uninstall Shopify CLI, refer to Troubleshooting Shopify CLI.

Contributing to Shopify CLI

Shopify CLI is open source. Learn how to contribute in our GitHub repository.

More help

  • Open a GitHub issue - To report bugs or request new features, open an issue in the Shopify CLI repository.
  • Shopify Community Forums - Visit our forums to connect with the community and learn more about development using Shopify CLI.