SonarSource/sonarqube-cli

Command-line interface for SonarQube with AI agent integration. Scan for secrets and get fast feedback on code quality and security from your terminal.

What it solves

The SonarQube CLI brings enterprise-grade code quality and security analysis directly into your terminal. It helps developers catch bugs, vulnerabilities, and hardcoded secrets locally before code is ever pushed to production or shared with AI coding assistants.

How it works

The tool connects to your SonarQube Cloud or self-hosted server to perform static analysis. It offers three primary modes:

  • Agentic: Integrates with AI coding tools (like Claude Code or GitHub Copilot) to scan for secrets and provide quality analysis before the AI processes your code.
  • Interactive: Allows you to run manual scans, list project issues, and manage projects directly from your command line.
  • Scriptable: Outputs data in JSON or a token-efficient format (toon) so you can pipe results into other tools or automate quality gates in your CI/CD pipelines.

Who it’s for

It is designed for developers and automation engineers who want fast, local feedback on code quality and security without waiting for full CI/CD cycles. It is also specifically optimized for users of AI coding agents who need to ensure their code is secure before sending it to LLM providers.

Highlights

  • Secret Detection: Scans for hardcoded credentials to prevent accidental exposure.
  • AI Agent Integration: Provides hooks for tools like Claude Code, Cursor, Devin, and GitHub Copilot.
  • Fast Feedback: Enables local analysis of uncommitted changes.
  • Flexible Output: Supports JSON, table, and LLM-optimized formats for easy parsing.
  • Automation Ready: Easily integrates into Git hooks and custom scripts.

Related

  • Project
  • Project
  • Project
  • Project