Command line tools for Shopify
npm install shopify-cli 
Shopify CLI is a command line utility used to perform operations on Shopify stores. It makes doing some typical operations in a store much easier, especially if you're doing dev work.
A better way to do this work needed to exist. Maybe it does already, maybe it doesn't. But anyway, here's one now.
npm install -g shopify-cli to install globally.git clone https://github.com/nicolasalliaume/shopify-cli and run $ ./cli.jsFinally, enable the following permissions:
- Products, variants and collections: 'Read and write'
- Theme templates and theme assets: 'Read and write'
- Orders, transactions and fulfillments: 'Read and write'
Save the app and copy the _'API key'_ and _'Password'_. Then, open the terminal and...
$ shopify-cli config -d -k -p , where domain is the shop's Shopify domain (for example, '_mystore.myshopify.com_'). #### List themes $ shopify-cli themes list
This command returns a list of all the themes, indicating the active one. It also includes created time, updated time and ID.
Example: $ shopify-cli themes list
#### Remove themes $ shopify-cli themes remove (
This command will remove the indicated theme (or themes if more than one is indicated).
It also accepts a --all flag that will remove all themes (except for the active one). The --all flag will ask for user confirmation before deleting. To bypass user confirmation use the -y flag.
Example: $ shopify-cli themes remove 231761231 Removes theme with ID 231761231.
Example: $ shopify-cli themes remove --all Removes all themes, except active one. Asks for confirmation.
Example: $ shopify-cli themes remove --all -y Removes all themes, except active one, no confirmation needed.
#### Activate theme $ shopify-cli themes activate
This command activates the theme with the given ID.
Example: $ shopify-cli themes activate 231761231
#### Rename theme $ shopify-cli themes rename
Renames the theme with the given ID, setting the given name. The new name accepts variables. The available variables are:
- %name%: The old name of the theme
- %id%: The id of the theme
Example: $ shopify-cli themes rename 231761231 "Former %name%" will rename a theme called "Debut" into "Former Debut".
#### Duplicate theme $ shopify-cli themes duplicate
This command creates a copy of the theme with the given ID. Escentially, it creates a new theme (with provided name, if any), and copies every asset from the source theme into the new theme.
Example: $ shopify-cli themes duplicate 231761231 --name "Duplicate of Debut"
#### Sync themes $ shopify-cli themes sync
Copies assets from the source theme into the target theme. All assets will be copied, unless a list of files is provided.
Example: $ shopify-cli themes sync 231761231 1127862138 templates/cart.liquid templates/404.liquid assets/main.js
#### Bootstrap themes $ shopify-cli themes bootstrap
This command will install one or more of the free themes provided by Shopify. These are:
- brooklyn
- boundless
- debut
- jumpstart
- minimal
- narrative
- pop
- simple
- supply
- venture.
It also accepts a --all flag that will install all themes.
Example: $ shopify-cli themes bootstrap minimal
Example: $ shopify-cli themes bootstrap --all
#### Install Theme Kit $ shopify-cli kit install
Installes Shopify Theme Kit in your system. No need to use this if you won't be using Theme Kit or you already have it installed.
#### Create config $ shopify-cli kit config [ -t
Creates a config file for Theme Kit, and adds the indicated themes to it. If no themes are specified, all themes will be included. This is great when you'll start to work on a new shop. Just run this command and get Theme Kit up and running for all your themes in a second.
--------
