Theme Kit command reference
This reference lists the Theme Kit commands for creating, configuring, updating, deploying, downloading, and removing themes.
Get help from the command line
Anchor link to section titled "Get help from the command line"If you want information about Theme Kit commands while you are working, then you can get help by running the following commands:
Get a list of all commands and flags
Get a list of all the flags for a command
Using environments
Anchor link to section titled "Using environments"All Theme Kit commands can be run with a selected environment from the configuration. This allows multiple configurations to be held in the same config file.
To use environments, you must specify them by name with the --env
flag or -e
for short. The default environment is development
. For example, if you want to deploy to your production environment, then you can run the following command:
To deploy to multiple environments, you can pass additional --env
flags:
Sets up your theme on your local machine by creating a config file and downloading the theme that you request.
The theme get --list
command returns a list of themes and IDs that exist on the store specified:
After you've retrieved the theme ID, you can run the following command. Make sure to also replace your-password
with your Theme password and your-store
with your store's domain name:
Running the theme get
command outputs a config.yml
file in the current directory with the following contents:
Required flags
Anchor link to section titled "Required flags"Short version | Long version | Description |
---|---|---|
-p |
--password |
The Theme password used to connect Theme Kit to your store. |
-s |
--store |
The domain name of the store. |
-t |
--themeid |
The ID of the theme. |
Optional flag
Anchor link to section titled "Optional flag"Flag | Description |
---|---|
--live |
Sets the theme ID to the published theme. |
Creates a new theme on the specified Shopify store, initializes your configuration using your Theme password and new theme ID, and generates and uploads default templates to make your theme valid.
Required flags
Anchor link to section titled "Required flags"Short version | Long version | Description |
---|---|---|
-p |
--password |
The Theme password used to connect Theme Kit to your store. |
-s |
--store |
The domain name of the store. |
-n |
--name |
The name of your new theme. |
Optional flag
Anchor link to section titled "Optional flag"Flag | Description |
---|---|
--dir |
The location for the new theme files. The directory must exist before running the new command. |
Creates or updates configuration files.
Running the theme configure
command outputs a config.yml
file in the current directory with the following contents:
Required flags
Anchor link to section titled "Required flags"Short version | Long version | Description |
---|---|---|
-p |
--password |
The Theme password used to connect Theme Kit to your store. |
-s |
--store |
The domain name of the store. |
-t |
--themeid |
The ID of the theme. |
Optional flag
Anchor link to section titled "Optional flag"Flag | Description |
---|---|
--live |
Sets the theme ID to the published theme. |
Opens the preview page for your theme in your browser and prints out the URL for your reference.
Optional flags
Anchor link to section titled "Optional flags"Short version | Long version | Description |
---|---|---|
-a |
--allenvs |
Runs open for each environment in your config file. |
-b |
--browser |
Specifies the name of the browser to open the URL, matching the name of the browser on your system. |
-E |
--edit |
Opens the web editor for the theme. |
Not applicable | --hidepb |
Hides the preview bar when opening the preview page. |
Instructs Theme Kit to watch for any changes made to your local files, and automatically pushes updates to your theme in the connected Shopify store.
Both the changes and the status of the upload are logged to the terminal. To close the watch connection, type ctrl
+ c
.
Optional flags
Anchor link to section titled "Optional flags"Short version | Long version | Description |
---|---|---|
-a |
--allenvs |
Runs watch for each environment in your config file. |
-n |
--notify |
The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes. |
Not applicable | --allow-live |
Allows Theme Kit to make changes to the live theme. |
Using --notify
with a URL
Anchor link to section titled "Using --notify with a URL"Supplying the --notify
flag with a URL will send a payload. For example, if a change is made to the file assets/app.js
, then the URL will receive a POST request with the following payload:
Integration with other tools
Anchor link to section titled "Integration with other tools"To help integrate watch
with a reloading tool, you can provide the optional --notify
flag with a file path that you want to have updated when the workers have gone idle.
For example, if you have a reloading tool watching for updates made to a file at /tmp/theme.update
, then you can use the following command:
Replaces your theme in the connected Shopify store with what's in your current project directory.
If you provide file names in the command, then only the specified files are replaced. For example, if you want to deploy only the 404.liquid
and article.liquid
templates, then you can use the following command:
How it works
Anchor link to section titled "How it works"- Any files that are in the connected Shopify store, but aren't on your local disk, will be removed from Shopify.
- Any files that are on both your local disk and in the connected Shopify store will be updated.
- Any files that are on only your local disk will be uploaded to the connected Shopify store.
Theme Kit calculates a checksum for each file and only updates assets if you’ve made changes to them locally.
Optional flags
Anchor link to section titled "Optional flags"Short version | Long version | Description |
---|---|---|
Not applicable | --allow-live |
Allows Theme Kit to deploy the file changes if your theme is currently live on the connected Shopify store. |
-a |
--allenvs |
Runs deploy for each environment in your config file. |
-n |
--nodelete |
Runs deploy without removing files from Shopify. |
Downloads files from your theme.
If you use the download
command without any file names, then the entire theme is downloaded. If you provide some file names in the command, then only the specified files are downloaded.
For example, if you want to download only the 404.liquid
and article.liquid
templates, then you can use the following command:
Similar to the deploy
command, Theme Kit will skip downloading any unchanged files.
Optional flag
Anchor link to section titled "Optional flag"Flag | Description |
---|---|
--live |
Sets the theme ID to the published theme. |
Deletes theme files both locally and in the connected Shopify store.
Unlike the other file operation commands, the remove
command requires file names. This prevents you from accidentally deleting your entire theme.
For example, if you want to delete the 404.liquid
and article.liquid
templates, then you can use the following command:
- Familiarize yourself with the configuration variables available and their accepted values in Theme Kit.
- Learn how to identify and resolve common issues in Theme Kit.