Shopify CLI extension commands
This page lists Shopify CLI commands for creating, registering, and pushing app extensions.
shopify extension create [options]
shopify extension 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
To create an extension, run
shopify extension create and select an extension type from the list of options in the prompt.
--type: The type of extension that you want to create.
--name: The name of the extension (50 character limit). Shopify CLI transforms the input into lowercase and snake case to name your directory.
shopify extension serve
In your extension’s directory, you can run
shopify extension serve to start a local server that can be rendered in the development store. The server will continue to run until you press Ctrl-C.
--tunnel: Creates an HTTP tunnel (this is the default behavior).
--no-tunnel: Skips creating an HTTP tunnel.
--resourceUrl: A relative link to product or variant. To test with a specific product ID, you can provide the flag as follows:
shopify extension serve --resourceUrl="products/12345", where 12345 is the product ID. To test with a specific product variant ID, you can provide the variant in this way:
shopify extension serve --resourceUrl="products/12345/variants/4567", where 12345 is the product ID and 4567 is the variant ID. If the flag is not passed, then you will be redirected to the details page of the first product in your shop.
Serving the extension requires using an internal node module called
@shopify/admin-ui-extensions-run. Updating the CLI doesn't update the node modules automatically, so you might need to update this package manually. Run the following commands to update to the latest release:
shopify extension register
Before you can push your code to Shopify, you need to create an app in your Partner Dashboard that you want to register your extension to. After you've created your app, run
shopify extension register and select it at the prompt.
Register an extension using interactive prompts
Register an extension using options
--api-key: The API key of the app that you want to register your extension to.
shopify extension push
When you're ready to publish your extension, you can upload your code to Shopify by running
shopify extension push. You need to 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 extension check
This command is only valid for theme app extensions.
||The path to your custom Theme Check config. This config overrides
||Run only the specified category of checks. You can specify multiple categories using multiple instances of this flag.|
||Run all checks other than those in the specified category. You can specify multiple categories using multiple instances of this flag.|
||Configure the severity level that causes a run of theme check to fail (exit code 1). Options include
||Automatically fix correctable offenses.|
||Generate a new Theme Check config file.|
|Output the active config to STDOUT.|
||List the active checks.|
||Print the version of Theme Check being used.|