> Deprecated: > This documentation is for the previous major version of Shopify CLI. Unless specifically instructed, you should use [the new version of Shopify CLI](/docs/api/shopify-cli/theme) (version 3), which provides a more streamlined theme development experience. > > Shopify CLI 2.x is deprecated, and no longer supported by Shopify. > > [Learn how to migrate to Shopify CLI 3.x](/docs/storefronts/themes/tools/cli/migrate). Shopify CLI is a command-line interface tool that helps you build Shopify themes. It quickly generates Node.js, Ruby on Rails, and PHP apps, app extensions, and Shopify themes. You can also use it to automate 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, refer to [Shopify CLI for apps](/docs/apps/build/cli-for-apps). > Tip: > You can use Shopify CLI together with the [Shopify GitHub integration](/docs/storefronts/themes/tools/github) to add version control to themes that you're developing. ## Features Shopify CLI accelerates your theme development process with the following features: - Safely preview, test, and share changes to themes using [development themes](/docs/storefronts/themes/tools/cli#development-themes) - Hot reload CSS and section changes, or automatically refresh a page on file change, when previewing a theme - Initialize a new theme using [Dawn](https://github.com/Shopify/dawn) as a starting point - Push and publish themes from the command line - Run [Theme Check](/docs/storefronts/themes/tools/theme-check/configuration) 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`](/docs/storefronts/themes/tools/cli/cli-2/commands#serve) command. You can use development themes on a Shopify store or a [development store](/docs/storefronts/themes/tools/development-stores). Development themes don't count toward your theme limit, and are deleted from the store after seven days of inactivity. Shopify CLI deletes your development theme 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](/docs/api/shopify-cli/theme/theme-push) your development theme to an unpublished theme on your store. You can use your development theme 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](/docs/storefronts/themes/tools/online-editor) - Share a password-protected [preview](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) of the theme with other developers ## Directory structure You can run certain theme commands, such as `shopify theme serve`, only if the directory that you're using matches the default Shopify theme [directory structure](/docs/storefronts/themes/architecture#directory-structure-and-component-types). This structure represents a buildless theme, or a theme that has already gone through any necessary [file transformations](/docs/storefronts/themes/best-practices/file-transformation). If you use build tools to generate theme files, then you might need to run commands from the directory that contains the generated files. The default Shopify theme directory structure is as follows: ```text └── project ├── assets ├── config ├── layout ├── locales ├── sections ├── snippets └── templates └── customers ``` ## 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)$/` You can also exclude specific files or patterns during a `push` or `pull` using the `--ignore` flag. If files are excluded using `.shopifyignore`, then both the contents of `.shopifyignore` and the `--ignore` flag are respected. ## Command reference Refer to the [Shopify CLI theme command reference](/docs/storefronts/themes/tools/cli/cli-2/commands) to explore the commands available to build themes with Shopify CLI. ## Install, upgrade or uninstall Shopify CLI To learn how to install or upgrade Shopify CLI 2.x, migrate from a legacy version, and uninstall Shopify CLI, refer to [Upgrade or uninstall Shopify CLI](/docs/storefronts/themes/tools/cli/cli-2/upgrade-uninstall). ## Contributing to Shopify CLI Shopify CLI is open source. [Learn how to contribute](https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md) in our GitHub repository. ## More help - [Open a GitHub issue](https://github.com/Shopify/shopify-cli/issues) - To report bugs or request new features, open an issue in the Shopify CLI repository. - [Shopify Community Forums](https://community.shopify.com/) - Visit our forums to connect with the community and learn more about development using Shopify CLI.