When we started our Getting started with Sitecore JSS & Vue.js a couple of days ago, we already started making use of the Sitecore JSS CLI. In this short blog-post we’ll explore the Sitecore JSS CLI a little more, before eventually building components with Sitecore JSS.

The Sitecore JSS CLI (Command Line Interface) provides us handy scripts to get things done while doing Sitecore JSS development with Vue.js.

In order for us to see what’s available from the Sitecore JSS CLI we can type in the following in your command prompt or Powershell prompt, which will give us an overview of all the available Sitecore JSS commands:

  • jss –help

PS C:\Projects\Kayee\Sitecore\sitecore-jss-getting-started-vuejs> jss –help
jss <command>

Commands:

  • jss clean – Cleans the contents of a directory, by default the buildArtifactsPath. Which probably points to the /dist folder.
  • jss deploy – Deploys the JSS app artifacts to a Sitecore instance. Use `jss deploy –help` for subcommands.
  • jss manifest – Generates a JSS manifest file which defines app assets to import into Sitecore. Nothing is deployed or added to a deployment package; this just collects assets. See `jss package`, which takes the manifest and turns it into a deployable package. `jss manifest –help` for options.
  • jss package – Generates a JSS manifest package file that can be deployed to Sitecore. Nothing is deployed. See also jss deploy package, which takes the package and deploys it to Sitecore. `jss package –help` for options.
  • jss setup – Sets up the scjssconfig.json config file, which defines how this application connects to a Sitecore instance for content or deployment.
  • jss start – To start the app in disconnected mode which uses locally defined content
  • jss start:connected – To start the app in connected mode which uses Sitecore content
  • jss build – Builds the Sitecore JSS app and outputs it in the buildArtifactsPath directory
  • jss scaffold  – Sitecore JSS allows you to easily scaffold new JSS components
  • jss start:vue – Starts the Vue development server
  • jss start:proxy – Starts the Sitecore JSS Disconnected-mode Proxy
  • jss start:watch-components – Watching for changes to component factory sources in src/components
  • jss build:client – Builds the client output for production
  • jss build:server – Builds the node vue server
  • jss bootstrap:connected – Registers JSS components & writes the component factory in connected mode
  • jss bootstrap:disconnected – Registers JSS components & writes the component factory i disconnected mode
  • jss graphql:update – package.json script
  • jss lint – runs vue-cli-service lint, which auto fixes possible errors in your JavaScript/vVue files

PS C:\Projects\Kayee\Sitecore\sitecore-jss-getting-started-vuejs>

Subcommands

As you can see from the above we have a couple of commands that actually do have sub-commands like:

PS C:\Projects\Kayee\Sitecore\sitecore-jss-getting-started-vuejs> jss deploy –help
jss deploy

Deploys the JSS app artifacts to a Sitecore instance. Use `jss deploy –help` for subcommands.

Commands:

  • jss deploy config – Deploys the app’s Sitecore configuration file(s) to the Sitecore server. `jss deploy config –help` for options.
  • jss deploy app – Deploys files and items for the app to Sitecore. `jss deploy app –help` for options.
  • jss deploy files – Deploys the app’s build artifact files to the Sitecore server using a direct file copy (no Sitecore items will be deployed). `jss deploy files –help` for options.
  • jss deploy items – Deploys the app’s Sitecore items to Sitecore. No files are deployed. `jss deploy items –help` for options.
  • jss deploy component <name> – Deploys a new component (or updates an existing component) to the Sitecore server when using Sitecore-first development. `jss deploy component –help` for options.
  • jss deploy template <name> – Deploys a new template (or updates an existing template) to the Sitecore server when using Sitecore-first development. `jss deploy template –help` for options.

PS C:\Projects\Kayee\Sitecore\sitecore-jss-getting-started-vuejs>

This was just one of the many commands that actually have subcommands. My tip is then also, to make yourself familiar with the enormous amount of Sitecore JSS commands that are at your disposal.

Till next time… Sitecore JSS in Powerfull Ways…..