> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cli/analysis/analysis.md).

# Overview

Use SonarQube CLI to catch issues before they reach a pull request: detect secrets, verify local changes against SonarQube (Server, Cloud), and apply AI-suggested fixes.

Find problems in your code from your terminal, no CI run required.

* [Secrets scanning](https://docs.sonarsource.com/sonarqube-cli/analysis/secrets-detection.md)
* [Analyzing local changes](https://docs.sonarsource.com/sonarqube-cli/analysis/analyzing-local-changes.md)
* [AI remediation](https://docs.sonarsource.com/sonarqube-cli/analysis/ai-remediation.md)
* [Software composition analysis](https://docs.sonarsource.com/sonarqube-cli/analysis/sca.md)

## Pick the right command

| You want to…                                                            | Run                                       | Where                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Catch hardcoded credentials before they leave your machine              | `sonar analyze secrets`                   | Anywhere: Cloud, Server, or offline.                                                                                                                                                                                                                                                                                                       |
| See what new issues your in-progress changes introduce                  | `sonar analyze` / `sonar analyze agentic` | [Vortex analysis](https://docs.sonarsource.com/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-analysis.md) requires a SonarQube Cloud Team (annual) or Enterprise plan, or a SonarQube Server 2026.5 Enterprise or Data Center edition. Secrets detection runs locally and needs no SonarQube connection. |
| Scan dependencies for vulnerabilities, malware, and prohibited licenses | `sonar analyze dependency-risks`          | [SonarQube Cloud](https://docs.sonarsource.com/sonarqube-cloud/advanced-security/analyzing-projects-for-dependencies-sca.md), or SonarQube Server 2026.4 or newer. Requires Advanced Security with SCA enabled.                                                                                                                            |
| Have an AI agent propose a fix for an existing issue                    | `sonar remediate`                         | SonarQube Cloud Team (annual) or Enterprise plan, or a SonarQube Server 2026.5 Enterprise or Data Center edition; requires a subscription to the [Remediation Agent](https://docs.sonarsource.com/agent-centric-development-cycle/in-your-long-living-branches-the-code-maintenance-loop/remediation-agent.md).                            |

For the full set of options and exit codes, see [Commands](https://docs.sonarsource.com/sonarqube-cli/using-sonarqube-cli/commands.md) and [Exit codes](https://docs.sonarsource.com/sonarqube-cli/using-sonarqube-cli/exit-codes.md).

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Integrations](https://docs.sonarsource.com/sonarqube-cli/integrations/integrations.md)
* [Output formats](https://docs.sonarsource.com/sonarqube-cli/using-sonarqube-cli/output-formats.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-cli/analysis/analysis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
