Sonarqube-client-go: a Go SDK and CLI for the SonarQube Web API

I built a Go client library for the SonarQube Web API, plus a CLI (sonar-cli) on top of it, and wanted to share in case it’s useful to anyone scripting against SonarQube or using it in CI/CD instead of doing raw HTTP calls by hand.

It has 100% coverage of the API surface, both v1 and v2, verified against Community and Enterprise editions. Everything is typed (no map[string]interface{} guessing), and the CLI is generated by reflecting over the SDK, so every service method is automatically available as a subcommand and the two never drift apart. Output can be JSON, YAML, or table, and there’s an --all flag that pages through paginated endpoints automatically.

Every endpoint is (automatically) validated end to end against real SonarQube instances (Community and Enterprise), with strict schema validation on the live responses. So if the actual API response ever drifts from what’s documented, it gets caught in CI, not by someone’s automation in production.

It’s already used in production by the SonarQube Crossplane provider.


# CLI
go install github.com/boxboxjason/sonarqube-client-go/v2/cmd/sonar-cli@latest
sonar-cli --url https://sonar.example.com --token $TOKEN issues search --projects my-project --severities CRITICAL,MAJOR --all


# SDK
go get github.com/boxboxjason/sonarqube-client-go/v2/sonar

Repo: GitHub - BoxBoxJason/sonarqube-client-go: SonarQube API client CLI & Golang SDK · GitHub
Docs: sonarqube-client-go module - github.com/boxboxjason/sonarqube-client-go/v2 - Go Packages

Apache-2.0. Feedback and issues welcome, especially if you hit a gap in API coverage.

Hey @BoxBoxJason, welcome to the Community! Looks nice, thanks for sharing!