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