Node version of Theme Kit.
$ npm install @shopify/themekitHere are a collection of examples to run Theme Kit commands.
For a complete list of commands and args: shopify.github.io/themekit/commands.
Print Theme Kit version info.
var command = require('@shopify/themekit').command;
command({
args: ['version']
}, function(err) {
if (err) {
console.error(err);
return;
}
console.log('Theme Kit command has completed.');
});Remove specific files from development environment.
var command = require('@shopify/themekit').command;
command({
args: ['remove', '--env', 'development', 'snippets/pagination.liquid', 'snippets/date.liquid']
}, function(err) {
if (err) {
console.error(err);
return;
}
console.log('Theme Kit command has completed.');
});Upload all files to staging environment.
var command = require('@shopify/themekit').command;
command({
args: ['upload', '--env', 'staging']
}, function(err) {
if (err) {
console.error(err);
return;
}
console.log('Theme Kit command has completed.');
});Deploy theme to production via NPM scripts.
Warning: This example will overwrite the theme based on your config.yml.
"dependencies": {
"@shopify/themekit": "0.4.3"
},
"scripts": {
"deploy": "shopify-themekit replace --env production"
}Executes command with arguments using the Theme Kit binary.
-
options
<Object>{ args: <Array>, // arguments to execute | ['version'] logLevel: <String> // Set level additional output info | 'silent', 'error', 'all', 'silly' }
-
callback
<Function>function(error) { }
For a complete list of commands and args: shopify.github.io/themekit/commands/.
$ shopify-themekit <args>This CLI component of this package is intended to be used with NPM scripts. If you plan on using the command line interface heavily, please refer to: shopify.github.io/themekit.
MIT, see LICENSE.md for details.