/sonarqube:sonar-install-clifrom sonarqube
Installs or updates the SonarQube CLI (sonarqube-cli) via install script, Homebrew, or mise. Handles missing or outdated binaries and reports install/update status.
Ships in sonarqube. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Make sure sonarqube-cli is installed and up to date, and report which of these happened: installed, up to date (or upgraded), not updated (the update failed but sonar still works; also return the manual upgrade command for its install route), or not installed (the user declined, the install failed, or the agent runs in a cloud or web environment).
Interaction rule: for every finite decision, always present predefined selector options (single-choice or multi-choice as appropriate) instead of asking for free-form text. If the user gives an invalid answer, re-show the same selector.
When another skill invoked this one, return to it with the result. Only not installed should stop the caller.
If you run in a cloud or web environment, where the CLI cannot be installed on the user's machine, do not attempt an install. Report not installed and tell the user to set up SonarQube through the sonar-integrate skill, which connects cloud environments through hosted MCP. Otherwise, or if you are not sure where you run, go to Step 1.
Run sonar --version (macOS/Linux) or sonar.exe --version (Windows) yourself; a zero exit code (version printed) means found. If found, also run which sonar (macOS/Linux) or (Get-Command sonar.exe).Source (Windows) to find the installation location, then go to Step 2. If not found, go to Step 3.
First determine how it was installed, because the upgrade path differs:
~/.local/share/sonarqube-cli/bin): do not run sonar update, as it conflicts with the manager. Run the manager's upgrade command yourself instead (Homebrew: brew upgrade --cask sonarqube-cli; mise: mise upgrade aqua:SonarSource/sonarqube-cli).sonar update yourself and wait for it to finish.If it succeeds: briefly tell the user the CLI is up to date (or was upgraded). The result is up to date.
If it fails: show the relevant output and suggest they run the upgrade manually in a terminal (e.g. offline or network issues), with the command for the route it was installed with: sonar update for the install script, brew upgrade --cask sonarqube-cli for Homebrew, mise upgrade aqua:SonarSource/sonarqube-cli for mise. Never suggest sonar update for a Homebrew or mise install: it refuses to update them. The result is not updated, as long as sonar remains usable.
Either way, re-run sonar --version (or sonar.exe --version) yourself. If it now fails, the upgrade left the CLI missing or broken: show the output and go to Step 3 to reinstall it.
Pick an install command from the table below, show it to the user, and ask for explicit confirmation before running it. Do not execute the command until the user confirms.
The shell/PowerShell script is the default and works everywhere. If the user already manages CLIs with Homebrew or mise, prefer that route so future upgrades stay managed by the tool — Step 2 then defers to the manager.
| Platform / method | Install command |
|---|---|
| macOS / Linux (script) | curl -o- https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.sh | bash |
| macOS / Linux (Homebrew) | brew install --cask sonarqube-cli |
| Any OS (mise) | mise use -g aqua:SonarSource/sonarqube-cli |
| Windows (PowerShell) | irm https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.ps1 | iex |
If the user confirms: run the command yourself. After it finishes, re-run the version check (sonar --version or sonar.exe --version) yourself. If it succeeds, the result is installed. If it fails, show the output; the result is not installed.
If the user declines: ask them to install sonarqube-cli manually and then re-invoke the skill they started from. The result is not installed.
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/sonar-analyzeAnalyze a file for quality and security issues using SonarQube/sonar-coverageFind files with low test coverage and inspect uncovered lines in a SonarQube project (project key optional when MCP integration already defines the default project)/sonar-dependency-risksSearch for software composition analysis (SCA) dependency risks in a SonarQube project (project key optional when MCP integration already defines the default project)/sonar-duplicationFind files with code duplications in a SonarQube project and inspect duplication blocks for a file (project key optional when MCP integration already defines the default project)npx claudepluginhub sonarsource/sonarqube-agent-plugins --plugin sonarqubeOther plugins' skills for the same job