Skip to main content

Theme Kit command reference

Deprecated

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

This reference lists the Theme Kit commands for creating, configuring, updating, deploying, downloading, and removing themes.

Note

If you're using PowerShell, then you need to include quotations around the URL if it follows a single dash. This is especially important if you're using the short form in the command. For example, theme get --list -p=[password] -s="my-store.myshopify.com" will work but theme get --list -p=[password] -s=my-store.myshopify.com won't.


Anchor to Get help from the command lineGet 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

theme help

Get a list of all the flags for a command

theme [command] --help

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:

theme deploy --env=production

To deploy to multiple environments, you can pass additional --env flags:

theme deploy --env=staging --env=production

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:

theme get --list --password=[your-theme-kit-password] --store="[your-store.myshopify.com]"

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:

theme get --password=[your-theme-kit-password] --store="[your-store.myshopify.com]" --themeid=[your-theme-id]

Running the theme get command outputs a config.yml file in the current directory with the following contents:

development:
password: [your-theme-kit-password]
theme_id: "[your-theme-id]"
store: [your-store].myshopify.com

Short versionLong versionDescription
-p--passwordThe Theme password used to connect Theme Kit to your store.
-s--storeThe domain name of the store.
-t--themeidThe ID of the theme.

FlagDescription
--liveSets 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.

theme new --password=[your-theme-kit-password] --store="[your-store.myshopify.com]" --name="Dramatic Theme"

Short versionLong versionDescription
-p--passwordThe Theme password used to connect Theme Kit to your store.
-s--storeThe domain name of the store.
-n--nameThe name of your new theme.

FlagDescription
--dirThe location for the new theme files. The directory must exist before running the new command.

Creates or updates configuration files.

theme configure --password=[your-theme-kit-password] --store="[your-store.myshopify.com]" --themeid=[your-theme-id]

Running the theme configure command outputs a config.yml file in the current directory with the following contents:

development:
password: [your-theme-kit-password]
theme_id: "[your-theme-id]"
store: [your-store].myshopify.com

Short versionLong versionDescription
-p--passwordThe Theme password used to connect Theme Kit to your store.
-s--storeThe domain name of the store.
-t--themeidThe ID of the theme.

FlagDescription
--liveSets 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.

theme open --env=production # opens http://your-store.myshopify.com?preview_theme_id=[your-theme-id]

Short versionLong versionDescription
-a--allenvsRuns open for each environment in your config file.
-b--browserSpecifies the name of the browser to open the URL, matching the name of the browser on your system.
-E--editOpens the web editor for the theme.
Not applicable--hidepbHides 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 Control+C.

Short versionLong versionDescription
-a--allenvsRuns watch for each environment in your config file.
-n--notifyThe 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-liveAllows Theme Kit to make changes to the live theme.

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:

{
"files": ["assets/app.js"]
}

Anchor to Integration with other toolsIntegration 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:

theme watch --notify=/tmp/theme.updatetheme watch --notify=/tmp/theme.update

Replaces your theme in the connected Shopify store with what's in your current project directory.

theme deploy

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:

theme deploy templates/404.liquid templates/article.liquid

  • 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.

Short versionLong versionDescription
Not applicable--allow-liveAllows Theme Kit to deploy the file changes if your theme is currently live on the connected Shopify store.
-a--allenvsRuns deploy for each environment in your config file.
-n--nodeleteRuns 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:

theme download templates/404.liquid templates/article.liquid

Similar to the deploy command, Theme Kit will skip downloading any unchanged files.

FlagDescription
--liveSets 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:

theme remove templates/404.liquid templates/article.liquid
Note

You might not be able to remove some files from the connected Shopify store because they're required to serve a valid theme.



Was this page helpful?