Polaris CLI

Commands for building Shopify Apps with Polaris.

npm version

Installation

You can install the Polaris plugin for the Shopify CLI by running the following command:

Example
shopify plugins install @shopify/polaris-cli

See the Shopify CLI command syntax section for how to execute commands using other package managers (ex: npm, Yarn, or pnpm).

Commands

migrate

Executes the Polaris Migrator. This makes version upgrades faster and safer by performing codemod transformations to your codebase. You can apply any of the available Polaris migrations using the Shopify CLI migrate command.

Example
shopify polaris migrate <migration> <path>
  • migration - name of migration
  • path - files or directory to perform migration

The following is a complete CLI command example using npm:

Example
npm run shopify polaris migrate v10-react-replace-text-components 'src/components/**/*.tsx'

See the Shopify CLI command syntax section for how to execute commands using other package managers.

Flags

FlagDescription
--dryDo a dry-run, no code will be edited
--printPrints the changed output for comparison
--forceBypass Git safety checks and forcibly run migrations