Polaris CLI
Commands for building Shopify Apps with Polaris.
Installation
You can install the Polaris plugin for the Shopify CLI by running the following command:
Exampleshopify 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.
Exampleshopify polaris migrate <migration> <path>
migration
- name of migrationpath
- files or directory to perform migration
The following is a complete CLI command example using npm
:
Examplenpm 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
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 |