@node-sitecore/cli

Installation

$ npm install @node-sitecore/cli

Usage

  Usage: nsc <command> [options]

  Options:

    -h, --help        output usage information
    -h, --configPath  Load a configuration file from specific location path

  Commands:

    init      Init a Sitecore Project
    build     Build project solution
    nuget     Nuget commands
    publish   Publish content (Foundation, Feature, Project)
    restore   Restore all NuGet Packages
    ps        Run a powershell script
    run       Run npm script located on <rootDir> configured in your .nscrc file
    unicorn   Perform a Unicorn synchronisation
    inspect   Display values from resolved configuration

  run nsc [command] --help for usage of a specific command.

Load custom configuration file

::: tip CLI command accept a --configPath option, available for all subcommand, to configure the location path of your configuration file. :::

nsc build --configPath ./my-custom.config.json

Build command options

Build your solution depending on your configuration or on the given options.

::: tip It also possible to give additional arguments to the msBuild command directly. Just use -- after the command line. :::

nsc build --targets Clean,Build -- /noautoresponse

With specific paths

From .nscrc

nsc build

::: tip buildPaths support glob pattern ! :::

Configuration example:

{
  "buildPaths": [
    "<solutionPath>",  // use default solution (Base.sln)
    "<rootDir>/**/*.sln" // build all solution
  ]
}

From args

nsc build --paths Base.sln,Other.sln,src/**/code/*.csproj

::: tip --paths option support glob pattern ! :::

Publish Foundation/Feature/Project only

nsc build Foundation

Publish command options

By default build the solution (eg. Base.sln) and publish it depending on your configuration or on the given options.

::: tip It also possible to give additional arguments to the msBuild command directly. Just use -- after the command line. :::

nsc publish --targets Clean,Build -- /noautoresponse

With specific paths

From .nscrc

nsc publish

::: tip publishPaths support glob pattern ! :::

Configuration example:

{
  "publishPaths": [
    "<solutionPath>",  // use default solution (Base.sln)
    "<rootDir>/**/*.sln" // publish all solution
  ]
}

From args

nsc publish --paths Base.sln,Other.sln,src/**/code/*.csproj

::: tip --paths option support glob pattern ! :::

Publish Foundation/Feature/Project only

nsc publish Foundation

::: tip Available options: Foundation, Feature or Project :::

Last updated