sonar-integrate

Installation
SKILL.md

Integrate SonarQube

Guide the user through installing sonarqube-cli (if needed), updating it to the latest version when already installed, authenticating, and completing agent-specific integration. Assume SonarQube itself is already set up; this skill only wires the assistant.

Instructions

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.

Step 1 — Check for sonarqube-cli and update it

Check if the CLI is available by running 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.

If found: first determine how it was installed, because the upgrade path differs:

  • Managed by a package or version manager (e.g. installed via Homebrew or mise — the binary lives under the manager's prefix rather than ~/.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), then go to Step 2. If the upgrade fails, show the output but still continue to Step 2 as long as sonar remains usable.
  • Installed via the shell/PowerShell script, or unsure: run 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), then go to Step 2.
    • If it fails: show the relevant output, suggest they run sonar update manually (e.g. offline or network issues), then still continue to Step 2 if sonar remains usable — do not block the rest of the flow unless the binary is missing or broken.
Installs
49
GitHub Stars
114
First Seen
Apr 26, 2026