Quickstart guide

Get up and running quickly with SonarQube CLI (secrets detection example).

circle-check

Step 1: Install the SonarQube CLI

Depending on your operating system, run these commands in your terminal:

MacOS and Linux:

curl -o- https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.sh | bash

Windows:

irm https://binaries.sonarsource.com/Distribution/sonarqube-cli/install.ps1 | iex

Step 2: Authenticate with the server

Create a user token in SonarQube Server or SonarQube Cloud.

Then authenticate and store it locally:

sonar auth login -s <YourSonarQubeURL> --with-token <YourSonarQubeUserToken>
circle-exclamation

Verify the connection:

sonar auth status
circle-info

If you’re using SonarQube Cloud, pass your organization with -o <YourSonarQubeCloudOrganization> instead of -s <YourSonarQubeServerURL>.

Step 3: Review the SonarQube CLI commands

For a full list of available commands, see the sonarqube-cliarrow-up-right repository.

Step 4: Choose a guide to run next

Next, check out our detailed quickstart guides to use with your AI agent.

Last updated

Was this helpful?