Skip to main content

Shop Minis CLI overview

Development

dev

Run your mini in development mode. Running this will present you with a list of options for how to open your mini (Press i for iOS, a for Android etc...). Your mini continues running until you exit this command (CTRL+C). You will see console.log messages output here as well as any errors/warning generated by your mini. Commonly minis have this command aliased as npm start.

npx shop-minis dev

This command also watches and builds your graphql types. More information can be found in Starting the CLI

Options

--reset-cache

Starts the Metro Bundler with resetCache. This is useful for cases where you think Metro might have got in to an invalid state.

npx shop-minis dev --reset-cache
--host

Allows you to change the local address we use for the development server. By default we guess the best IP address based on your network interfaces but you may with to override this.

npx shop-minis dev --host 192.168.1.80

Run the command with --verbose to find which host address we guessed as a default for you.

--extension-targets

By default we run all the extensions you have defined in your mini app config. This option allows you to specify which extensions you want to run. Accepts one or many extensions.

npx shop-minis dev --extension-targets some.target other.target

Run the command with --verbose to get more information about which extensions we found in your config and which extensions we are going to run.

--build-type

By default we install a version of Shop that matches what production users are currently able to install (release). In some cases you may need to switch to nightly or snapshot if the shop minis team have advised you to do so. This would allow you run your mini with new features/bugfixes early.

npx shop-minis dev --build-type nightly

Run the command with --verbose to get more information about which Shop we are using.

--snapshot-version

Using --build-type snapshot on it's own will get you the latest snapshot but the shop minis team might advise you to use a specific snapshot version

npx shop-minis dev --build-type snapshot --snapshot-version 2.123.0+456

Run the command with --verbose to get more information about which Shop we are using.

create-extension

Generate an extension. You will be prompted for the extension location and type. This command will attempt to update your mini app config to add the extension but if that was not possible you will see an error message explaining how to add it manually.

npx shop-minis create-extension

Options

--target

Pass the target instead of being prompted

npx shop-minis create-extension --target some.target

features

List all features and see which ones are enabled/disabled for your mini.

npx shop-minis features

Changes made using this command will apply locally after you restart your development server. Changes will take effect for end users in production after you submit your Shop Mini and that submission has been released in the next version of Shop.

Options

--enable

Enable a feature

npx shop-minis features --enable <feature-name>
--disable

Disable a feature

npx shop-minis features --disable <feature-name>

upgrade

Upgrade your mini app's dependencies to the latest versions. This command will also run codemods to upgrade your code automatically if breaking changes are needed.

npx shop-minis upgrade

Options

--no-codemod

Avoid applying codemods after upgrading packages. When you use this you will be responsible for manually upgrading your code.

npx shop-minis upgrade --no-codemod
--no-runtime-upgrade

Avoid upgrading @shopify/shop-minis-runtime

npx shop-minis upgrade --no-runtime-upgrade
--target-cli-version

Specify a version of the CLI to upgrade to (default: "latest")

npx shop-minis upgrade --target-cli-version <version>
--yes

Automatically answer prompts with default options

npx shop-minis upgrade --yes

generate-graphql-types

Generate types for all of your graphql query files.

npx shop-minis generate-graphql-types

Options

--watch

Generate types automatically when changes are detected.

npx shop-minis generate-graphql-types --watch

validate-manifest

Validate your manifest file and report any errors found.

npx shop-minis validate-manifest

Options

--path

Specify a custom manifest file path

npx shop-minis validate-manifest --path path/to/manifest.json

Submission

submit

Submit your mini app for review. See the Publishing guide for more information.

npx shop-minis submit

Options

--description

Supply a description of your changes

npx shop-minis submit --description "cool changes"

check-submission

Check the status of your pending submission.

npx shop-minis check-submission

cancel-submission

Cancel your pending submission.

npx shop-minis cancel-submission

Debug

When debugging it can be helpful to use the following commands. All of our commands also support --verbose and --help.

doctor

Diagnose common Node.js, iOS, Android & React Native issues.

npx shop-minis doctor

Options

--fix

Automatically try to fix any issues found.

npx shop-minis doctor --fix

info

Get relevant version info about OS, toolchain and libraries. Very useful when reporting issues to the shop minis team.

npx shop-minis info

help

Print out docs for other commands

npx shop-minis help submit

Setup and Creation

create

Create a new Shop Mini project.

npx shop-minis create [mini name]

Arguments

mini name

The name of your mini project.

Options

--template

Specify a template to use for the new mini. Available templates:

  • getting_started
  • blank
  • shoppable_videos
  • shoppable_posts
npx shop-minis create my-mini --template getting_started
--extension-target

Specify the extension target to use. Available targets:

  • shop.product.variants.render-before
  • shop.product.policies.render-after
  • shop.product.block.render
  • shop.store.block.render
  • shop.order-confirmation-page.order-details.render-after
  • shop.order-management.order-details.render-after
  • shop.order-management.visit-shop.render-after
npx shop-minis create my-mini --extension-target shop.product.block.render
--extension-type

Specify the type of extension to create. Available types:

  • blank
  • link
  • default-card
  • product-offer-card
  • video-collection
  • image-collection
  • bundle-selector
  • bundle-collection
  • bundle-upsell
  • survey-single-response
npx shop-minis create my-mini --extension-type default-card
--output-dir

Specify a custom output directory for the mini.

npx shop-minis create my-mini --output-dir path/to/directory
--skip-create-extension

Skip the create extension step during mini creation.

npx shop-minis create my-mini --skip-create-extension
--alphaMinisRuntime

Use the alpha tag of @shopify/shop-minis-runtime instead of the latest tag.

npx shop-minis create my-mini --alphaMinisRuntime
--alphaMinisSDK

Use the alpha tag of @shopify/shop-minis-platform-sdk instead of the latest tag.

npx shop-minis create my-mini --alphaMinisSDK

setup

Set up a new Shop Mini development environment. This command helps configure your environment for Shop Mini development.

npx shop-minis setup

codemod

Automatically apply required code changes after upgrading the CLI. This is typically run as part of the upgrade process but can be run separately if needed.

npx shop-minis codemod

Options

--from-version

Specify the starting CLI version from which to apply code changes.

npx shop-minis codemod --from-version 1.2.0
--to-version

Specify the target CLI version up to which code changes should be applied.

npx shop-minis codemod --to-version 2.0.0
--yes, -y

Automatically answer prompts with default options.

npx shop-minis codemod --yes
--no-hard-reset-dependencies

By default, this command will recreate dependency lockfiles. Use this flag to avoid that behavior.

npx shop-minis codemod --no-hard-reset-dependencies

app

Manage the Shopify apps linked to your Shop Mini.

npx shop-minis app

Commands

list

List all apps currently linked to your Shop Mini.

npx shop-minis app list

Link an app to your Shop Mini.

npx shop-minis app link

Unlink a development app from your Shop Mini.

npx shop-minis app unlink