Shopify App CLI Extension commands
This page lists the Shopify App CLI commands for creating, registering, and pushing app extensions.
shopify create extension [options]
shopify create command to scaffold a new extension project in a subdirectory of your app. To specify the type and name of your extension, you can use the interactive prompts or the command options.
Create an extension using interactive prompts:
$ shopify create extension ? What type of extension are you creating? 1. Product Subscription (limit 1 per app)
Create an extension using options:
$ shopify create extension --type=PRODUCT_SUBSCRIPTION --name="My subscription extension" Cloning into my_subscription_extension...
--type The type of extension that you would want to create.
--name The name of the extension (50 character limit). The CLI transforms the input into lowercase and snake case to name your directory.
In your extension’s directory, you can run
shopify serve to start a local simulator. The simulator will continue to run until you press Ctrl-C.
$ shopify serve Project is running at http://0.0.0.0:39351/ Compiling... Compiled successfully.
Before you can push your code to Shopify, you must create an app on the Partners Dashboard that you want to register your extension to. Once you've created your app, run
shopify register and select it at the prompt.
Register an extension using interactive prompts:
$ shopify register ? Which app would you like to connect this extension to? 1. My first app
Register an extension using options:
$ shopify register --api-key=XXXXXXXXXXXXX ✓ Connected My first extension to My first app. ★ Run shopify push to push your extension to Shopify.
--api-key The API key of the app that you want to register your extension to.
When you're ready to publish your extension, you can upload your code to Shopify by running
shopify push. You must register your extension before you can push it to Shopify.
After a successful push, the CLI will generate a link to the Partner Dashboard where you can create a new version and publish your extension.
$ shopify push ✓ Pushed to a draft on May 9, 2020 14:23:56 UTC ★ Visit https://partners.shopify.com/xxxx/apps/xxxxx/extensions/xxxx to version and publish your extension