Sonatype IQ CLI

Sonatype IQ CLI

The Sonatype IQ Command Line Interface (CLI) is the multi-tool for performing a Lifecycle Analysis. Evaluations of your applications are either run manually or automatically using the CLI in many environments.

Release Notes

Version 2.13.1 (July 22, 2026)

Version 2.13.0 (July 08, 2026)

Version 2.12.1 (June 04, 2026)

Version 2.12.0 (June 03, 2026)

Version 2.11.1 (May 14, 2026)

Version 2.11.0 (May 06, 2026)

Version 2.10.0 (April 08, 2026)

Version 2.9.0 (March 06, 2026)

Version 2.8.5 (February 06, 2026)

Version 2.8.4 (January 06, 2026)

Version 2.8.3 (December 17, 2025)

Version 2.8.2 (December 05, 2025)

Version 2.8.1 (December 04, 2025)

Version 2.8.0 (November 21, 2025)

Version 2.7.0 (November 07, 2025)

Version 2.6.0 (October 09, 2025)

Version 2.5.1 (September 11, 2025)

Version 2.5.0 (August 15, 2025)

Version 2.4.6 (August 06, 2025)

Version 2.4.5 (July 30, 2025)

Version 2.4.4 (July 10, 2025)

Version 2.4.3 (June 12, 2025)

Version 2.4.2 (May 09, 2025)

Version 2.4.1 (April 29, 2025)

Version 2.4.0 (April 22, 2025)

Version 2.3.0 (April 02, 2025)

Version 2.2.0 (March 05, 2025)

Version 2.1.1 (February 14, 2025)

Version 2.1.0 (February 05, 2025)

Version 2.0.0 (January 09, 2025)

Version 1.185.0 (December 11, 2024)

Version 1.184.0 (November 08, 2024)

Version 1.183.0 (October 10, 2024)

Version 1.182.0 (September 04, 2024)

Version 1.181.0 (August 20, 2024)

Version 1.180.0 (August 8, 2024)

Version 1.162.0 (June 2023)

Version 1.158.0 (March 2023)

Version 1.152.0 (January 2023)

Version 1.150.0 (November 2022)

Version 1.145.0 (October 2022)

Version 1.143.0 (September 2022)

Version 1.133.0 (March 2022)

Version 1.132.0 (January 2022)

Version 1.130.0 (December 2021)

Version 1.125.0 (October 2021)

Version 1.123.0 (September 2021)

Version 1.122.0 (September 2021)

Version 1.120.0 (July 2021)

Version 1.119.0 (July 2021)

Version 1.118.0 (June 2021)

Version 1.117.0 (June 2021)

Version 1.116.0 (June 2021)

Version 1.114.0 (May 2021)

Version 1.107.0 (March 2021)

Version 1.106.0 (March 2021)

Version 1.105.0 (Feb 2021)

Version 1.104.0 (Jan 2021)

Version 1.103.0 (Dec 2020)

Version 1.101.0 (Nov 2020)

Version 1.98.0 (Sep 2020)

Version 1.97.0 (Aug 2020)

Version 1.94.0 (Jun 2020)

Version 1.88.0 (Mar 2020)

Version 1.87.0 (Mar 2020)

Compatibility

CLI Version IQ Server Version Java Runtime
1.180.0 to latest 87 to latest JDK 17 to latest
1.87.0 to 1.179.0 87 to latest JDK 8 to JDK 11

Note

For detailed information on feature availability in each CLI version, please review the IQ CLI Release Notes.

Getting started with the Sonatype IQ CLI

You will need to perform a few tasks to run a Lifecycle analysis using the CLI.

  1. Set up an environment to analyze.
  2. Set credentials to use with the CLI.
  3. Prepare an application in Lifecycle.

Set up an environment to analyze

IQ CLI for Java

Download latest version for Java:

nexus-iq-cli-latest.jar ( ASCSHA1)

The CLI JAR is a Java application that requires a Java Virtual Machine (JVM) in the environment you want to perform the analysis.

IQ CLI for Docker

The Sonatype IQ CLI and related documentation is also available as a Docker image on DockerHub. The PKI option is not supported by the Docker image.

Supported Docker image platforms

The sonatype/nexus-iq-cli Docker image is published as a multi-platform Linux image. Current Sonatype-published latest, latest-alpine, current versioned, and current versioned -alpine tags support the following platforms:

Platform Description
linux/amd64 Linux on x86-64 / Intel / AMD 64-bit systems
linux/arm64 Linux on ARM64 / AArch64 systems
docker pull sonatype/nexus-iq-cli:latest
docker pull --platform linux/arm64 sonatype/nexus-iq-cli:latest
docker pull --platform linux/amd64 sonatype/nexus-iq-cli:latest

CLI Authentication

For automated systems, we recommend passing a user token instead of a username and password. You may consider configuring a dedicated service account with the minimum access privileges.

The authentication credentials require the Evaluate applications permissions for the specific application or organization to perform an analysis. We recommend using the default Application Evaluator role for simplicity.

See Passing CLI parameters from a file for details.

Evaluating an Application

The CLI will need an application configured in the Lifecycle server to determine which policy to use and to associate the finished scan report. Applications may be added beforehand or during evaluation using the Using Automatic application creation with the CLI feature.

Applications may be analyzed as a built archive file or a directory (build workspace) containing the application code.

As a Java application, the CLI is started using a java command with the required parameters. The syntax below represents the minimum set of options required to evaluate an application.

Example Lifecycle CLI Evaluation

The CLI requires the following parameters to run a scan: the applicationId, the Lifecycle URL, and credentials with permissions to analyze this application.

java -jar [sonatype-cli] -a [username:password] -i [--application-id] -s [--server-url] [scan-target]

Example command

java -jar nexus-iq-cli*.jar \ 
  -a username:password \ 
  -i sandbox-application \ 
  -s http://localhost:8070 \ 
  ./sample-application.zip

Access the CLI help by running it without parameters

java -jar ./nexus-iq-cli*.jar

CLI parameters

sonatype-cli

The path to the Sonatype CLI jar file or native binary.

-a, --authentication

Provide credentials in the following format: username:password

--pki-authentication

Delegate authentication to the JVM environment.

-i, --application-id

The PublicId for the application. When Automatic Applications is enabled and the PublicId has not yet been used, a new application will be created.

-O, --organization-id

The ID for the organization to which the application belongs. When automatic application creation is enabled and the application does not exist, it will be created under the organization having the provided organization ID.

-s, --server-url

The location of your Lifecycle server (e.g. http://localhost:8070).

Scan-Target

Path to specific files, directory, or Docker image. Include one or more scan targets at the end of the command.

Additional parameters

Additional options to use in evaluating applications with the Sonatype CLI.

-t, --stage

Specify the development lifecycle stage for the analysis. Defaults to the build stage

-r, --result-file

Send the output to a specific file path as a JSON data object.

-m, --metadata-file

Specify the file path providing a JSON object containing the commit hash for the SCM integrations.

{"commitHash": "<git-commit-hash>"}

--module-exclude

Specify module files to ignore via Apache Ant-styled patterns. Repeat the option for multiple specifications.

**/sonatype-clm/module.xml

-w, --fail-on-policy-warnings

Causes a failure of the evaluation if any warnings are encountered.

-e, --ignore-system-errors

Ignore system errors (e.g. IO, Network, server, etc.) when running on continuous integration servers to avoid unintentional build failures.

-E, --ignore-scanning-errors

Ignore scanning errors (e.g. invalid files, inaccessible files, etc) when the code base contains invalid files for testing purposes. Scanning these files may cause unintentional build failures.

-X, --debug

Enables debug logging for troubleshooting. Use with caution as this log may expose sensitive information.

-h, --help

Output help context for CLI.

-v, --version

Output version of the CLI

-k, --keep-scan-file

Retain the temporary scan file normally deleted at the end of the scan.

-o

Set the directory to write scan output files.

Proxy parameters

-p, --proxy

Specify a proxy to use when connecting to the Lifecycle server. This property is set using the format <host[:port]>, otherwise, the CLI uses the default HTTP proxy for the JVM.

-U, --proxy-user

Specify proxy credentials in the following format: <username:password>

Reachability Analysis parameters

See Reachability Analysis with Sonatype CLI for how to enable Reachability in Java/JVM builds.

Evaluation results

When the Sonatype CLI evaluation succeeds, the output includes a summary and a link to the scan report. If the target IQ server supports priorities URLs (with both developmentDashboardEnabled and prioritizedFindingsReportEnabled set), a link to the priorities URL is also provided.

Centralized CI configuration

To centrally manage supported CI evaluation settings for Sonatype IQ CLI through the Lifecycle organization and application hierarchy, see the CI Configuration REST API.

Exit Codes

The Sonatype IQ CLI emits the following exit codes:

Exit Code Description
0 Success
1 Policy violation
2 Scanning error
3 Reachability error
4 Configuration error
5 Connectivity error
6 Local I/O error
7 Authentication error
99 Internal error