Skip to main content

CLI

The CLI front end to the Baz system. It enables you to run assertions on your infrastructure and report outcomes through reports.

The CLI supports two modes of operation test & shell.

Common Options:

-h, --help Show context-sensitive help.

--loglevel=<loglevel>
The option is used to specify the logging level, when the tool is running.
When not specified, the loglevel is set to 3 (Error).
Trace Levels -1 - Trace, 0 - Debug, 1 - Info, 2 - Warn, 3 - Error (Default)

--logfile=<logfile>
This option is used to specify the logging file. When not specified,
log messages are sent to the standard error (STDERR).

Test

The test mode supports running assertions.

Usage: bazcli test [<directory> or <file.js> ...]

Arguments: The command takes a directory or a list of JavaScript(JS) test files as input.

[<directory> or <file.js> ...]

Options:

 --output=<outputfile>
This option is used to specify the output file name. The test results are written into this file in CSV format.

--actors=<actorsfile>
This option is used to specify the file defining actors. During execution, the actors are loaded and made
available to tests as JavaScript objects.

--name=<runname>
This option is used to specify the name of the test execution used in reporting.

--verbose
This option turns on verbose ouput.

--tests=<TESTS, ...>
This option is used to specify comma seperate list of test functions to run.

Example:

/opt/bazc/bazcli/bin/bazcli test /opt/bazc/bazcli/examples/bcsv.js

Output:

cli_test_ouput

Shell

The shell mode provides a playground environment(REPL) to invoke plugin APIs directly and visually inspect the results.

Usage: bazcli shell (sh) [<testfiles> ...]

Arguments: The command take a list of JavaScript(JS) test files as input.

[<testfiles> ...]

Options:

--actors=<actorsfile>
This option is used to specify the file defining actors. The REPL shell loads these actors
and makes them available as JavaScript objects. They can then be used to invoke plugin APIs.

Example:

/opt/bazc/bazcli/bin/bazcli shell --actors ./baz-test-collection/active_directory/config/win.toml

Output:

cli_REPL_ouput