If you run Theme Check through the command line, then you can use the [Shopify CLI](/docs/storefronts/themes/tools/cli/cli-2/commands) commands and flags described in this guide to call and run Theme Check. Learn more about [the checks that Theme Check runs](/docs/storefronts/themes/tools/theme-check/checks). ## Requirements To run Theme Check commands, you need to install the [`@shopify/cli`](https://www.npmjs.com/package/@shopify/cli) and [`@shopify/theme`](https://www.npmjs.com/package/@shopify/theme) packages using Homebrew on macOS, or install the packages globally on Windows or Linux. For more information, refer to [Install Shopify CLI](/docs/api/shopify-cli). ## Usage Lints theme code. ```sh shopify theme check [flags] ``` ### Flags | Flag | Alias | Description | Environment variable | |---|---|---|---| | `--config ` | `-C ` | The path to your custom [Theme Check config](/docs/storefronts/themes/tools/theme-check/configuration). This config overrides `.theme-check.yml`, if it is present in the directory being analyzed. | `SHOPIFY_FLAG_CONFIG` | | `--fail-level `|| The [severity level](/docs/storefronts/themes/tools/theme-check/configuration#check-severity) that causes a run of theme check to fail (exit code 1). Options include `error`, `suggestion`, and `style`. | `SHOPIFY_FLAG_FAIL_LEVEL` | | `--auto-correct` | `-a` | Automatically fixes correctable offenses. | `SHOPIFY_FLAG_AUTO_CORRECT` | | `--init` || Generates a new [Theme Check config file](/docs/storefronts/themes/tools/theme-check/configuration). | `SHOPIFY_FLAG_INIT` | | `--output` | `-o` | Outputs the results of the check to a file. Options include `json` and `text` (default). | `SHOPIFY_FLAG_OUTPUT` | | `--print` || Outputs the active config to STDOUT. | `SHOPIFY_FLAG_PRINT` | | `--list` | `-l` | Lists the active checks. | `SHOPIFY_FLAG_LIST` | | `--environment ` | `-e ` | The [environment](/docs/storefronts/themes/tools/cli/environments) that you want to use. | `SHOPIFY_FLAG_ENVIRONMENT` | | `--version` | `-v` | Prints the version of Theme Check being used. | `SHOPIFY_FLAG_VERSION` | | `--path ` | | The path to your theme directory. | `SHOPIFY_FLAG_PATH` | | `--verbose` | | Provides more detailed output in the logs. | `SHOPIFY_FLAG_VERBOSE` |