Shopify CLI helps you build Shopify themes and apps. Use Shopify CLI to automate and enhance your local development workflow.
Shopify CLI is available as a gem and can be run and installed on Mac, Linux and Windows systems.
Installation for Mac OS Users
- Make sure you have Homebrew installed
- Open your terminal app
brew tap shopify/shopify
brew install shopify-cli
- After the installation is completed, run
shopify version, if this outputs a version number you've successfully installed the CLI.
To upgrade Shopify CLI
Homebrew (Mac OS)
$ brew update $ brew upgrade shopify-cli
apt (Debian, Ubuntu)
1.- Download the latest
.deb binary for Shopify CLI from the releases page.
2.- Install the downloaded file and make sure to replace /path/to/download/shopify-cli-x.y.z.deb with the path to your file's location:
$ sudo apt install /path/to/downloaded/shopify-cli-x.y.z.deb
yum (CentOS 8+, Fedora, Red Hat, SUSE)
1.- Download the latest .rpm file for Shopify App CLI from the releases page.
2.- Install the downloaded file and make sure to replace /path/to/downloaded/shopify-cli-x.y.x.rpm with the path to your file's location:
$ sudo yum install /path/to/downloaded/shopify-cli-x.y.x.rpm
RubyGems (macOS, Linux, Windows 10)
$ gem update shopify-cli
Command specification and semantics
Shopify CLI offers a command structure similar to other CLIs:
shopify [ GLOBAL_ACTION | RESOURCE [ ACTION ] ] [ VARIADIC_ARGS ] [ OPTIONS ]
The top level command will always be a resource or a global action:
- Resources represent Shopify concepts that you can work with in the CLI, for example
- Usually, global actions are commands that alter the state of the CLI (e.g
Actions are commands that you can run to interact with a resource.
You can add
-h to the end of your command to get a full explanation of the available options for the command.
Quick start guide for theme developers
This quick start guide shows you how to begin local theme development when working with a new theme from scratch.
1.- Authenticate the CLI
After you install Shopify CLI, you need to authenticate your CLI instance and connect to the store that you want to work on.
shopify login --store=<your-shop-url>
When prompted, open the provided accounts.shopify.com URL in a browser. In your browser window, log into the account that's attached to the store that you want to use for development.
2.- Create a new theme
shopify theme create
To initialize a theme on your current working directory. This will actually clone Shopify's starter theme which you should use as a reference when building themes for Shopify.
3.- Start the local theme server
Shopify CLI comes with a local theme server which lets you preview your changes live on your local machine.
After you create or navigate to your theme, you can run
shopify theme serve to interact with the theme in a browser. Shopify CLI uploads the theme as a development theme on the store that you're connected to, and gives you an IP address and port to preview changes in real time using the store's data.
shopify theme serve
To start the server. The server includes hot reload for CSS & Sections.
Note: Shopify CLI is the recommended and officially supported tool for developing themes and creating CI/CD workflows. Please refer to the Theme Kit Migration Guide for details.