Command Line Interface

You can control ReqView native applications from command line to automate some repetitive tasks without user interaction.

Note: You should run the ReqView commands with the ReqView application window closed. If the ReqView native application is already running then the command just focuses the ReqView window without executing the command.

Run ReqView CLI

Please follow instructions in section Install ReqView to install ReqView native application to your system. The specific location of the executable binary depends on your operating system.

Windows

The ReqView Windows application installer stores two types of ReqView binaries in your user profile folder %LocalAppData%\reqview:

  • reqview\app-<app_version>\ReqView.exe — ReqView binary handling CLI commands
  • reqview\ReqView.exe — ReqView wrapper binary for auto-update not handling CLI commands

Because the installer does not update your Path environment variable it could be convenient to create a variable for executing ReqView to run the executable binary directly, for example:

$ set "reqview=%LocalAppData%\reqview\app-2.9.1\ReqView.exe"

Then you can simply run ReqView CLI as follows:

$ %reqview% --version

Mac

The ReqView Mac application installer stores the executable binary in folder /Applications/ReqView.app/Contents/MacOS/reqview. You can optionally create a link from /usr/local/bin system folder to run ReqView CLI directly:

$ ln -s "/Applications/ReqView.app/Contents/MacOS/reqview" /usr/local/bin/

Linux

The ReqView Linux application installer stores the executable binary in system folder /usr/bin so you can run ReqView CLI directly.

CI Systems

You may find useful to run ReqView as part of your continuous integrations (CI) system, such as Travis, Jenkins or GitLab CI. For instance, you can run export command to generate the latest version of HTML requirements documentation after each commit of a changed ReqView project to your version control system.

Because ReqView CLI needs a display driver to launch you should configure a virtual display driver to run ReqView on a CI system.

For Linux CI systems based on Debian run the following command to install the required virtual display driver packages:

$ sudo apt install libgdk-pixbuf2.0-0 libgtk-3-0 libxss1 libgbm1 xvfb

Then you can use ReqView CLI in your CI scripts as follows:

$ xvfb-run -a -s "-screen 0 1024x768x24" reqview --version

Display Help

Display information about available commands and their parameters.

Usage:

$ reqview --help

Commands:

  reqview export         Export documents to DOCX, XLSX, HTML or CSV formats.
  reqview open           Open a project file or folder.
  reqview validate       Validate a project file or project folder.
  reqview importlicense  Import a license file (and thereby agree to EULA);
                         optionally add user details.

Show help for export command:

$ reqview export --help

Show help for export docx command:

$ reqview export docx --help

Export Documents

Exporting custom reports from command line can simplify tracking of issues in your custom export templates and allow you to generate reports from the latest project version stored in a version control system.

You need to import a license before running this command.

Usage:

$ reqview export [format] <options...>

Commands:

reqview export html  Export a HTML, CSV or a text file using Handlebars
                     template                                      [default]
reqview export docx  Export a MS Word DOCX file
reqview export xlsx  Export a MS Excel XLSX file

HTML/CSV/Text Export Options:

--project, -p   Project file or project folder.          [string] [required]
--doc, -d       ID of the exported document.                        [string]
--template, -t  Export template file.                    [string] [required]
--output, -o    Output directory.                                   [string]

DOCX Export Options:

--project, -p        Project file or project folder.     [string] [required]
--doc, -d            ID of the exported document.                   [string]
--template, -t       Export template file.               [string] [required]
--docx-template, -x  Custom DOCX/DOTX document template file.       [string]
--output, -o         Output DOCX file.                   [string] [required]

XLSX Export Options:

--project, -p  Project file or project folder.           [string] [required]
--doc, -d      ID of the exported document.                         [string]
--output, -o   Output XLSX file.                         [string] [required]

Examples:

Export NEEDS document using an HTML report template into export/out directory:

$ reqview export -p reqview_demo.reqw -d NEEDS -t export/templates/HTMLReportTemplate.html -o export/out

Export a DOCX file with layout and documents specified by CustomWordTemplate.docx template, with each document rendered using WordBookExportTemplate.html template:

$ reqview export docx -p reqview_demo.reqw -t export/templates/WordBookExportTemplate.html -x export/templates/CustomWordTemplate.docx -o export/out.docx

Export an XLSX file with worksheets for all documents in a project:

$ reqview export xlsx -p reqview_demo.reqw -o export/out.xlsx

Open Project

Usage:

$ reqview open <options>

Open Options:

--project, -p        Project file or folder

Example:

$ reqview open -p path/to/project_file.reqw

or

$ reqview open -p path/to/project_folder

Validate Project

Usage:

$ reqview validate <options>

Validate Options:

--project, -p        Project file or folder

Example:

$ reqview validate -p path/to/project_file.reqw

or

$ reqview validate -p path/to/project_folder

Import License

This command provides a way to agree to EULA, import a license file and add user details via CLI.

Usage:

$ reqview importlicense <options>

Options:

--license, -l  Path to a license file.                   [string] [required]
--user, -u     User name                                            [string]
--email, -e    User email address.                                  [string]
--company, -c  User company.                                        [string]

Example:

$ reqview importlicense -l path/to/license.lic -u "John Smith" -e "john@company.com" -c "Company Inc."
Updated for version 2.12.0