Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fix ® marks

Welcome the CodeMRI(R) ® CLI Reference. The CodeMRI(R) ® Command-line Interface (CLI) provides an easy to use interface for administering and using your CodeMRI(R) ® product. To get started, see General Invocation.

General Invocation

The CodeMRI(R) ® CLI consists of a tree of commands and sub-commands, grouped by the concept or element that the command interacts with. For example, all commands that deal with logging in and logging out are nested under account as they relate to account management.

...

Code Block
languagepython
linenumbersfalse
cmri job list

See the Command Listing section at the bottom of this document for a full listing of commands within the CodeMRI(R) ® CLI.

Common Options

In addition to command-specific options, all commands within the CodeMRI(R) ® CLI support the following common options:

--vault

The path to the vault to connect to (run cmri vault --help for more information about vaults). In the case of vault create, this specifies the path to the vault to create. If not provided, the CodeMRI

(R)

® CLI will fall back to the value of the CMRI_VAULT environment variable, and finally, the current directory. Please note that folders or sub-folders within the installation path may not be used as vaults.

-s, --selection

One or more expressions that match elements within the vault to work with. If not provided, the CodeMRI

(R)

® CLI use the value of the CMRI_SELECTION environment variable. See cmri select or run cmri select --help for more information about selection.

--output-format

Specifies the desired format of command output, where possible. Commands that do not output any data, or certain special cases (e.g. help commands) will simply ignore the argument to --output-format. See Output Formats for information about output formats.

--out

Specifies the path to an output file to write command output to. Commands that do not support output, or certain special cases (e.g. help commands) will simply ignore the argument to --out. Output files will be overwritten.

--no-color

Removes colored text from console output. Useful for screens where colored text is difficult to see (such as on old projectors).

Environment Variables

CMRI_VAULT

The vault path, if the --vault option is not provided. See vault or run cmri vault --help for more information about vaults.

CMRI_SELECTION

The selection set, if the --selection option is not provided. See cmri select or run cmri select --help for more information about selection.

Output Formats

The CodeMRI(R) ® CLI supports the following output formats:

human

Human readable tabular or textual format. This is the default output format.

csv

A series of newline-delimited rows with columns delimited by commas (,). The first row will be a header containing column names. Values with commas in them will be be quoted with double quotes.

csv:noheader

csv format without the header. Useful for appending to an existing CSV.

tsv

A series of newline-delimited rows with columns delimited by tabs. The first row will be a header containing column names.

tsv:noheader

tsv format without the header. Useful for appending item to an existing TSV.

json

Either a single object or an array of JSON objects.

Interactive Shell

The CodeMRI(R) ® CLI supports an interactive shell for running multiple commands in a single session. This is useful for situations where users need to perform a number of small operations without incurring the cost of starting up the CLI multiple times, or for working with complex selection sets not conducive to the single-line selection expressions afforded by --select and CMRI_SELECT.

To launch the CodeMRI® shell, run:

Code Block
languagepython
linenumbersfalse
cmri shell

...

For running a script containing multiple commands within a single session, the CodeMRI(R) ® CLI supports batch scripting. To run a batch script, use:

Code Block
languagepython
linenumbersfalse
cmri batch run <script path>

CodeMRI(R) ® can accept batch scripts through standard input on Linux platforms. Replace <script path> with /dev/stdin to process a script on standard input.

...

Batch scripts consist of a sequence of CodeMRI® commands, sans the cmri prefix. Empty lines or lines whose first non-whitespace character is # will be skipped.

...

If an error occurs during a batch script, whether due to an invalid command, invalid options, or a problem executing the command, CodeMRI(R) ® will print the error to standard error and stop processing the script.

...

By issuing the shell command within a script, users can create scripts that execute a sequence of commands, and then enter an interactive shell in the same session. This can be useful for setting up a complex selection set on which to run a set of interactive commands.

...