For the complete documentation index, see llms.txt. This page is also available as Markdown.
Developer

Uninstalling

Remove the SonarQube CLI binary, state, credentials, and integrations from your machine.

The SonarQube CLI installs itself in a few well-defined locations, and removing it is a matter of deleting them in order.

To clear credentials, binaries, integrations, and cached CLI files in one step, run Reset the CLI first. That command doesn't remove the sonar binary from your PATH. Use the steps below for a full uninstall.

Step 1: Clear saved tokens from the keychain

While the CLI binary is still available, log out of the saved connection:

sonar auth logout

If you've already removed the CLI or state.json and need to clean up tokens afterwards, open your OS keychain manually and remove every entry whose service name is sonarqube-cli.

Step 2: Remove the binary and PATH entry

If you installed via Homebrew:

brew uninstall sonarqube-cli

This removes the binary and its PATH entry automatically. Skip to Step 3.

If you installed via Mise:

mise use -g --remove sonarqube-cli
mise uninstall --all sonarqube-cli

Skip to Step 3.

For install-script installs, continue below.

rm -rf ~/.local/share/sonarqube-cli

Then edit your shell profile (~/.bashrc, ~/.zshrc, ~/.bash_profile, or ~/.profile) and remove this line:

export PATH="$HOME/.local/share/sonarqube-cli/bin:$PATH"

Reload your shell (source ~/.bashrc or open a new terminal) to drop the sonar command from your PATH.

Delete the install directory:

Remove-Item -Recurse -Force "$env:LOCALAPPDATA\sonarqube-cli"

Then remove the install path from your user PATH:

  1. Open System Properties > Environment Variables.

  2. Edit the user-level Path variable.

  3. Remove the entry pointing to …\sonarqube-cli\bin.

  4. Sign out and back in (or open a new PowerShell session) for the change to take effect.

Step 3: Remove CLI state and auxiliary binaries

This wipes:

  • state.json (your active connection, telemetry preferences, integration registry)

  • Auxiliary scanner binaries

  • CLI logs

  • Globally-installed Git hooks (from sonar integrate git --global)

Step 4: Remove agent integrations

To remove individual integration features interactively, re-run the matching sonar integrate command (for example, sonar integrate claude) and decline Keep? on the features you want to remove. See integrations/README.md.

If you ran sonar integrate claude, sonar integrate copilot, sonar integrate codex, or sonar integrate cursor:

  • Global installs: delete the SonarQube hook files inside ~/.claude/, ~/.copilot/, ~/.cursor/, or ~/.codex/, and remove the SonarQube MCP server entry from your agent configuration.

  • Project installs: delete the SonarQube-related files inside your repo's agent configuration directory (.claude/, Copilot config, .cursor/, or Codex config).

If you ran sonar integrate git:

  • Per-repo (plain Git hooks): delete .git/hooks/pre-commit and .git/hooks/pre-push if they were installed by the CLI.

  • Per-repo (Husky or pre-commit framework): remove the SonarQube entry from your Husky scripts or .pre-commit-config.yaml.

  • Globally: git config --global --unset core.hooksPath and delete ~/.sonar/sonarqube-cli/hooks/ (handled by Step 2 if you removed ~/.sonar/sonarqube-cli).

Step 5: Verify the removal

Last updated

Was this helpful?