CLI Options

The primary means to interact with _spartan is via the command line _spartan cli


There’s really only one keyword: init. This will run the configuration wizard, unless you also use the ‘y | Y’ flag to just accept the defaults and use the canned policy.


Keyword Example Usage
init _spartan init


Param Name Example Usage Description
y, Y _spartan init y Creates a new policy using default settings
L _spartan init L Launches the policy generation interview using long-form questions


Flag Name                             Example Usage Description
-D, –default _spartan --default builds a preconfigured, default security policy and security.js file
-f, –force _spartan --force forces a complete regeneration of the boilerplate code defined in security.js.
-u, –update _spartan -u updates the latest policy as defined in security.json
–no-overwrite _spartan --no-overwrite creates a new policy and security.js file without overwriting the previous files. The filename will have the policy number appended.
–del, –delete [F] _spartan --delete deletes the most recent security.json AND the security.js files. It does not remove any of the dependencies from package.json
–set-as-default _spartan --set-as-default sets the latest policy as the default. Any future policies generated with the default option will reference this policy.
-R, –reset-default _spartan --reset-default Returns the default policy to factory settings. Requires wget
-i, –integrity _spartan -i Returns the sha384 hash value of the policy (requires shasum)
–deploy _spartan --deploy (Work in progress) Deploys the app according the specification defined in security.json
-h, –help _spartan -h lists these options
-v, –version _spartan --version shows the installed spartan version

See _spartan help section for error codes & troubleshooting