Skip to main content

Theme Kit configuration reference

Deprecated

Theme Kit is deprecated. Theme developers should use Shopify CLI for Shopify theme development.

This reference lists the configuration variables available for Theme Kit and their accepted values.


You can configure Theme Kit using a config file, environment variables, and command line flags. Each configuration method has an order of precedence:

  • Environment variables can override config file values.
  • Command line flags can override config file and environment values.
Tip

When you're debugging your config, consider the order of precedence for the different configuration methods.


The following table lists the parameters that you can configure for all Theme Kit actions:

ParameterDescription
configA custom path to your config file. Defaults to the current path where the command is executed.
directoryThe project root directory. Allows you to run the command from another directory.
ignore_filesA list of patterns to ignore when executing commands.
ignoresA list of paths to files that contain patterns to ignore.
passwordThe Theme password used to connect Theme Kit to your store.
proxyA full URL to proxy your requests through. The URL supports only the http protocol.
readonlyMakes all actions read-only. You can download from this environment but you can't update the theme in the connected Shopify store.
storeYour store's Shopify domain with the .myshopify.com postfix.
theme_idThe ID of the theme.
timeoutAllows you to change the request timeout. If you have large files in your project that take longer than the default 30 seconds to upload, then you can increase this value. You can set this value to 60s for seconds or 1m for one minute.

The configuration file can be set up per environment.

In the following example, the config.yml file specifies configurations for three different environments: development, production, and test.

development:
password: 16ef663594568325d64408ebcdeef528
theme_id: "123"
store: can-i-buy-a-feeling.myshopify.com
proxy: http://localhost:3000
ignore_files:
- "*.gif"
- "*.jpg"
- config/settings_data.json
production:
password: 16ef663594568325d64408ebcdeef528
theme_id: "456"
store: can-i-buy-a-feeling.myshopify.com
timeout: 60s
readonly: true
test:
password: 16ef663594568325d64408ebcdeef528
theme_id: "789"
store: can-i-buy-a-feeling.myshopify.com
ignores: ignore.txt

Anchor to Environment variablesEnvironment variables

To avoid storing your private secrets in your repository, you can use environment variables. You can interpolate variables in your config.yml file or use environment variables for global parameters.

Note

Setting up environment variables differs depending on your operating system.

Anchor to Interpolate variablesInterpolate variables

You can interpolate variables into your config.yml file using the ${} notation:

development:
password: ${DEV_PASSWD}
theme_id: ${DEV_THEMEID}
store: ${DEV_SHOP}

To help you interpolate variables, there are special files that can be used to automatically load environment variables for Theme Kit. The following table lists the file paths for each operating system:

Operating systemFile path
MacOSX${HOME}/Library/Application Support/Shopify/Themekit/variables
Linux/BSDs${XDG_CONFIG_HOME}/Shopify/Themekit/variables
Windows%APPDATA%\Shopify\Themekit\variables
AnyUse the --vars flag in any command to provide a path to a file for loading variables.

The variables file has the same format as most .env type files. The following example shows what the variables file looks like for the previous config file example.

Setting up a variables file allows you to commit your config.yml to your repository, but keeps your private secrets out of the repository.

DEV_PASSWD=0bwef09hn23048sdkl2345n2k3
DEV_THEMEID=123
DEV_SHOP=can-i-buy-a-feeling.myshopify.com

Anchor to Environment variables for global parametersEnvironment variables for global parameters

Most of the global parameters have a corresponding environment variable. All of the environment variables are prefixed with THEMEKIT_.

The following table shows the environment variables associated with each parameter. THEMEKIT_IGNORE_FILES must use : as a pattern separator and THEMEKIT_IGNORES must use : as a file path separator.

ParameterEnvironment variable
directoryTHEMEKIT_DIRECTORY
ignore_filesTHEMEKIT_IGNORE_FILES
ignoresTHEMEKIT_IGNORES
passwordTHEMEKIT_PASSWORD
proxyTHEMEKIT_PROXY
storeTHEMEKIT_STORE
theme_idTHEMEKIT_THEME_ID
timeoutTHEMEKIT_TIMEOUT

You can enforce any setting manually using a command line flag. This is useful for debugging settings or scripting calls to Theme Kit from job schedulers, like cron.

The following table lists the global parameters and their associated command line flags:

ParameterFlagShort version
config--config-c
directory--dir-d
ignore_files--ignored-fileNot applicable
ignores--ignoresNot applicable
password--passwordNot applicable
proxy--proxyNot applicable
store--store-s
theme_id--themeidNot applicable
timeout--timeoutNot applicable

Theme Kit has a couple of ways to ignore files from your commands. You can provide a list of ignore patterns to your ignore_files value. You can also provide a list of file paths to your ignores value.

Anchor to Ignore pattern rulesIgnore pattern rules

The following tables shows the rules associated with specifying ignore patterns and some examples:

RuleExample
Patterns are trimmed of whitespace at the beginning and end of the pattern.
Any plain file name (without a * character in it) is matched within the project directory.The pattern no.txt will match both $PROJECT_DIR/no.txt and $PROJECT_DIR/templates/no.txt.
Any file pattern has a / at the end will be matched with a glob.The pattern config/ will match config/*.
Any pattern containing a glob * is scoped to the project directory.The pattern >*.gif will match $PROJECT_DIR/*.gif.
Any glob pattern that doesn't start with a glob is matched with a prefixed glob.The pattern build/* will match $PROJECT_DIR/build/.
Any pattern that starts with a / and ends with a / is considered a regular expression and will match the whole path.The pattern /.(txt|gif|bat)$/ will match any file with the txt, gif, or bat extensions.
On Windows, you must use a backslash () as the path separator.

Anchor to Example ignore values in ,[object Object]Example ignore values in config.yml

The following example shows a config.yml file that specifies a list of ignore patterns in the ignore_files value, and a single themekit_ignores file in the ignores value:

development:
... # Other content
ignore_files:
- config/settings_data.json
- "*.png" # Patterns that start with * need to be quoted to have vaild yaml
- /\.(txt|gif|bat)$/
ignores:
- themekit_ignores # A file to load ignore patterns. Check out the example ignore file.

Ignore files must adhere to specific formatting rules to be valid.

The following example shows a valid ignore file. One pattern is specified per line, and lines for comments are prefixed with a # value:

# $PROJECT_DIR/themekit_ignores
# plain file names
config/settings_data.json

# globs
*.png

# regex
/\.(txt|gif|bat)$/

  • Learn about the different commands that you can use in Theme Kit to execute key operations.
  • Learn how to identify and resolve common issues in Theme Kit.

Was this page helpful?