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.
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.
The ReqView Windows application installer stores two types of ReqView binaries in your user profile folder %LocalAppData%\reqview:
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
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/
The ReqView Linux application installer stores the executable binary in system folder /usr/bin so you can run ReqView CLI directly.
You may find it useful to run ReqView as part of your continuous integration (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 information about available commands and their parameters.
Usage:
$ reqview --help
Commands:
reqview export Export documents to DOCX, XLSX, HTML, PDF 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
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 to be able to use 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
reqview export pdf Export a PDF 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]
PDF 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]
--cert, -c Digital signature certificate (.pfx or .p12 file). [string]
--pwfile, -x File containing digital signature certificate password.
[string]
--output, -o Output PDF directory. [string]
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
Export NEEDS document using a PDF book template into export/out directory and digitally sign it using a PKCS#12 certificate with the password for it stored in a file:
$ reqview export pdf -p reqview_demo.reqw -d NEEDS -t export/templates/PDFBookTemplate.html -c path/to/cert.pfx -x path/to/cert_password.txt -o export/out
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
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
This command provides a way to agree to EULA, import a license file and add user details via CLI. This command only has to be run once.
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."