Build apps with Shopify CLI
Shopify CLI helps you build Shopify apps. It quickly generates Node.js, Ruby on Rails, and PHP apps, app extensions, Shopify Scripts (beta), and Shopify themes. You can also use it for Shopify themes and when automating 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 three types of app projects that can be created and managed with the CLI:
- Node.js apps
- Ruby on Rails apps
- PHP apps
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, do the following:
- install Ruby or Ruby+Devkit using RubyInstaller for Windows (2.7 or higher)
- install Git
- create a Shopify Partner account if you haven't already
- create a development store to install and test apps
install any project-specific requirements:
Project type Requirements Ruby on Rails Node.js PHP
1. Install Shopify CLI
Install Shopify CLI on macOS or Windows. For other platforms and package managers, refer to Install Shopify CLI.
macOS installation with Homebrew
Windows installation with RubyGems
shopify login in a terminal 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 app create [ node | rails | php ] to scaffold a new app in a new subdirectory. These commands also create your app in the Partner Dashboard.
4. Start a local development server
After your app is created, start a local development server.
When you start the server, Shopify CLI uses ngrok to create a secure tunnel. ngrok gives your app a unique URL. You need to authenticate with ngrok before starting the server.
To start a local development server, run the following commands:
Authenticate with ngrok:
Start the server:
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.
Run the following command:
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 the 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 your app, run the following command:
Read the complete reference documentation of the commands available for the different project types: