Getting started with Shopify CLI
Shopify CLI helps you build Shopify themes and apps. It quickly generates Node.js apps, Ruby on Rails apps, app extensions, Shopify Scripts (beta), and Shopify themes. It also automates many common development tasks.
This documentation explains how to use Shopify CLI for app development. To learn how to use Shopify CLI for theme development, refer to Shopify CLI for themes.
How it works
In Shopify CLI, scaffolded directories of code are called projects.
There are two types of app projects that can be created and managed with the CLI:
Each project type creates a Shopify app with similar features. However, the development experiences are different because of their different programming languages and frameworks.
Before you start
Before you start using Shopify CLI to develop themes, do the following:
- Install Ruby or Ruby+Devkit using RubyInstaller for Windows (2.7 or higher).
- Create a Shopify partner account if you haven't already
- Create a development store to install and test apps
1. Install Shopify CLI
Install Shopify CLI on macOS or Windows. For other platforms and package managers, refer to Install Shopify CLI.
shopify login to log into your Partner account.
- In a terminal, type
- In your browser window, log into your Partner account.
3. Create a new project
shopify node create or
shopify rails create to scaffold a new Node.js app or Rails app in a subdirectory. These commands also create your app in the Partner Dashboard.
After the command finishes executing, the following instructions display in your terminal:
4. Start a local development server
After your app is created, you can work with it immediately by running
shopify node serve or
shopify rails serve to start a local development server.
Shopify CLI uses ngrok to create a tunnel. ngrok chooses a unique URL for your app.
5. Install your app on your development store
With the server running, open a new terminal window and run the following command to open your app in your browser and install it on a development store.
For a Rails app:
For a Node app:
6. Populate test data
Shopify CLI helps with the process of adding example data (such as products, customers, or draft orders) to test your app's behavior. To populate test data, run the following command:
This command asks you to confirm that you want to populate resources for the store that you're logged into.
7. Deploy your app
Using Shopify CLI, you can deploy your app to an external platform. Currently, the only available platform is Heroku. To deploy your app, run the following command. Be sure to specify the project type in the command.
To deploy a rails app:
To deploy a node app:
Read the complete reference documentation of the commands available for the different project types: