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.
- Make sure you have Homebrew installed
- Open your terminal app
- Run
brew tap shopify/shopify
- Run
brew install shopify-cli
- After the installation is completed, run
shopify version
, if this outputs a version number you've successfully installed the CLI.
$ brew update
$ brew upgrade shopify-cli
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
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
$ gem update shopify-cli
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
theme
. - Usually, global actions are commands that alter the state of the CLI (e.g
config
orlogin
)
Actions are commands that you can run to interact with a resource.
You can add --help
or -h
to the end of your command to get a full explanation of the available options for the command.
This quick start guide shows you how to begin local theme development when working with a new theme from scratch.
After you install Shopify CLI, you need to authenticate your CLI instance and connect to the store that you want to work on.
Run:
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.
Run:
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.
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.
Run:
shopify theme serve
To start the server. The server includes hot reload for CSS & Sections.
Shopify CLI is an open source tool and everyone is welcome to help the community by contributing to the project.
-
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 Shopify CLI development.