Shopify CLI command reference (Ruby on Rails)

This reference lists the Ruby on Rails commands that you can use with Shopify CLI. Commands in this group use the syntax shopify rails [command].

To access help for any of these commands from the command line, use shopify rails [command] -h.

connect

Connects an existing Shopify CLI project to a Partner account or to a specific Shopify development store.

The connect command re-creates the project's .env and .shopify-cli.yml files if they don't exist, or updates the files if they do exist.

  • .env contains sensitive information that provides functionality to your app, such as the app key. As a result, this file shouldn't be saved to a version control system.
  • shopify-cli.yml contains insensitive information required for a project to work with Shopify CLI, such as the project type.

This command is useful if you're working on one project across multiple computers, or if you're collaborating with other developers using a version control system like Git.

create

Creates a new project of the specified type. The project is created in a subdirectory of the current directory:

Shopify CLI then prompts you to enter a name for your project:

deploy

Deploys the current Rails app to a hosting service. Currently, the only option is Heroku.

generate

Generates boilerplate code inside your app project. Rails projects support generating new webhooks.

open

Opens your local development app in your default browser.

serve

Starts a local development server for your project and a public ngrok tunnel to your localhost.

tunnel

Controls an HTTP tunnel to your local development app using ngrok. With the tunnel command, you can authenticate with ngrok and start or stop the tunnel.

To authenticate with ngrok, you need an authentication token. You can find it in your ngrok dashboard. Copy your token and use it with the tunnel [project type] auth command:

This writes your ngrok auth token to ~/.ngrok2/ngrok.yml. To learn more about ngrok configuration, refer to ngrok’s documentation.

To start an ngrok tunnel to your app in your localhost development environment:

To stop the running ngrok tunnel:

Next steps