An unofficial command-line interface for SonarQube Server and SonarQube Cloud. Provides access to code quality analysis, issue management, quality gates, metrics, and administration features. This project is not affiliated with or endorsed by Sonar.
$ dotnet add package SQ.Clisq)An unofficial command-line interface for SonarQube Server and SonarQube Cloud, inspired by GitHub's gh CLI.
Note: This project is not affiliated with or endorsed by Sonar. SonarQube is a trademark of Sonar.
Download a prebuilt binary for your platform from the latest GitHub Release:
| Platform | Architecture | Download |
|---|---|---|
| Windows | x64 | sq-<version>-win-x64.zip |
| Windows | ARM64 | sq-<version>-win-arm64.zip |
| Linux | x64 | sq-<version>-linux-x64.tar.gz |
| Linux | ARM64 | sq-<version>-linux-arm64.tar.gz |
| macOS | Intel | sq-<version>-osx-x64.tar.gz |
| macOS | Apple Silicon | sq-<version>-osx-arm64.tar.gz |
Extract and place the sq binary somewhere on your PATH.
If you already have .NET 10 installed:
dotnet tool install --global SQ.Cli
# 1. Configure your SonarQube instance
sq config add-instance --name myserver --url https://sonarqube.example.com --token YOUR_TOKEN
# 2. Initialize your project directory
cd /path/to/my-project
sq init --project my-project-key
# 3. Run commands - project context is automatic!
sq quality-gate status # no project arg needed
sq metrics get # auto-resolves from .sq/project.json
sq issues list # works across all project-scoped commands
sq analysis history
sq init creates a .sq/project.json that stores your project key and instance, so you don't have to pass --project on every command. You can always override with explicit arguments when needed.
sq init (explicit arguments)sq config add-instance --name myserver --url https://sonarqube.example.com --token YOUR_TOKEN
sq config set-default --name myserver
sq quality-gate status my-project-key
sq issues list --project my-project-key
sq metrics get my-project-key
| Category | Description |
|---|---|
init | Initialize project context for the current directory |
config | Manage CLI configuration and instances |
projects | Create, list, search, and manage projects |
issues | Search, assign, comment, and transition issues |
hotspots | Manage security hotspots |
analysis | View analysis history and events |
quality-gate | Check status and manage quality gates |
quality-profiles | Manage quality profiles and rules |
metrics | View project metrics and history |
rules | Search and manage rules |
users | Manage users and tokens |
groups | Manage user groups |
permissions | Manage project and global permissions |
webhooks | Manage webhooks |
branches | Manage project branches |
system | System status, health, and administration |
devops | DevOps platform integrations (GitHub, GitLab, Azure, Bitbucket) |
sca | Software Composition Analysis (Enterprise Edition) |
-v, --verbose Enable verbose logging
-i, --instance Use specific instance
-f, --format Output format: table, json, csv, yaml (default: table)
-o, --organization Override organization (required for SonarCloud)
--force-v1 Force use of V1 API even if V2 is available
-h, --help Show help for any command
# Default table output
sq projects list
# JSON for scripting
sq projects list --format json | jq '.[] | .key'
# CSV for spreadsheets
sq issues list --project my-app --format csv > issues.csv
# YAML
sq quality-gate status my-app --format yaml
# GitHub Actions
- name: Check Quality Gate
run: sq quality-gate status ${{ github.repository }}
# GitLab CI
script:
- sq quality-gate status $CI_PROJECT_NAME
# Azure Pipelines
- script: sq quality-gate status $(Build.Repository.Name)
sq init)| Platform | Versions |
|---|---|
| SonarQube Server | 9.9 LTS - 2026.1 |
| SonarQube Cloud | Supported |
dotnet add package SQ.Api
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - See LICENSE for details.
This is an independent, individual developer project. It is not officially supported by Sonar. Use at your own risk.