Theme Check commands
If you run Theme Check through the command line, then you can use the Shopify CLI commands and flags described in this guide to call and run Theme Check. Learn more about the checks that Theme Check runs.
Requirements
Anchor link to section titled "Requirements"To run Theme Check commands, you need to install the @shopify/cli
and @shopify/theme
packages using Homebrew on macOS, or install the packages globally on Windows or Linux. For more information, refer to Install Shopify CLI.
theme check
Anchor link to section titled "theme check"Lints theme code.
Flag | Alias | Description |
---|---|---|
--config <PATH> |
-C <PATH> |
The path to your custom Theme Check config. This config overrides .theme-check.yml , if it is present in the directory being analyzed. |
--category <CATEGORY> |
-c <CATEGORY> |
Runs only the specified category of checks. You can specify multiple categories using multiple instances of this flag. |
--exclude-category <CATEGORY> |
-x <CATEGORY> |
Runs all checks other than those in the specified category. You can specify multiple categories using multiple instances of this flag. |
--fail-level <LEVEL> |
The severity level that causes a run of theme check to fail (exit code 1). Options include error , suggestion , and style . |
|
--auto-correct |
-a |
Automatically fixes correctable offenses. |
--init |
Generates a new Theme Check config file. | |
--output |
-o |
Outputs the results of the check to a file. Options include json and text (default). |
--print |
Outputs the active config to STDOUT. | |
--list |
-l |
Lists the active checks. |
--environment <ENV_NAME> |
-e <ENV_NAME> |
The environment that you want to use. |
--version |
-v |
Prints the version of Theme Check being used. |
--help |
-h |
Shows the options for using Theme Check. |