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插件安装@shopify / polaris-cli

See theShopify CLI command syntaxsection for how to execute commands using other package managers (ex: npm, Yarn, or pnpm).

Commands

migrate

Executes thePolaris Migrator. This makes version upgrades faster and safer by performing codemod transformations to your codebase. You can apply any of theavailable Polaris migrationsusing theShopify CLImigratecommand.

           
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 usingnpm:

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

See theShopify CLI command syntaxsection for how to execute commands using other package managers.

Flags

Flag Description
--dry Do a dry-run, no code will be edited
--print Prints the changed output for comparison
--force Bypass Git safety checks and forcibly run migrations