A CLI application for interacting with SonarQube products.
Beta Notice: This product is currently in Beta, and we are actively collecting feedback on it. Please share your thoughts via this form!
Linux/Mac OS:
curl -o- https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.sh | bashWindows (from PowerShell):
irm https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.ps1 | iexBelow is an example of a setup which will work for SonarQube Cloud EU (default). The authentication step is optional. With authentication, more types of secrets can be detected.
sonar auth login
sonar integrate claude -g
For SonarQube Cloud US, pass the server URL explicitly:
sonar auth login --server https://sonarqube.us
sonar integrate claude -g
For SonarQube Server, pass your instance URL:
sonar auth login --server https://sonarqube.mycompany.com
sonar integrate claude -g
The full list of commands is available at https://cli.sonarqube.com
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (validation, execution, etc.) |
See State Management for more information.
- Delete the
~/.local/share/sonarqube-cli/folder. - Remove
export PATH="$HOME/.local/share/sonarqube-cli/bin:$PATH"from your~/.bashrcor~/.zshrcfiles.
- Delete the
%localappdata%\sonarqube-cli\folder. - Remove this folder from the
PATHuser-level environment variable.
The SonarQube CLI collects anonymous usage data and error reports to help improve the product.
Telemetry: Anonymous command usage statistics are sent to SonarSource.
Error reporting: Unhandled exceptions are reported to Sentry to help us identify and fix crashes.
Both are enabled by default and share the same opt-out toggle. To disable all data collection:
sonar config telemetry --disabledNo personally identifiable information is transmitted.
Please be aware that we are not actively looking for feature contributions. The truth is that it's extremely difficult for someone outside SonarSource to comply with our roadmap and expectations. Therefore, we typically only accept minor cosmetic changes and typo fixes.
See CONTRIBUTING.md for setup instructions, coding guidelines, and how to run tests.
Copyright SonarSource Sàrl.
SonarQube CLI is released under the GNU Lesser General Public License, Version 3.0,.
Generated from src/cli/command-tree.ts — do not edit manually