> 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/administration/system-status.md).

# Check system status

`sonar system status` gives you a single diagnostic view of your SonarQube CLI installation: whether your token is valid, which auxiliary binaries are installed, which integrations are configured, and whether a CLI update is available.

The command does not require authentication. It still reports whether saved credentials exist and, when possible, verifies the token against your SonarQube server.

## Run the status check

```bash
sonar system status
```

The output starts with a banner and a system check headline:

* **SYSTEM CHECK: Healthy** when authentication and integration configuration look good.
* **SYSTEM CHECK: Issues found** when the token is missing or invalid, when an MCP config file is present but malformed, or when an Antigravity secrets hook is installed but its configuration or backing script is invalid.

Authentication is reported as one of:

* **Not Set**: no active connection in `state.json`
* **Active**: token validated successfully
* **Invalid**: token rejected by the server
* **Set Unverified**: a token is stored but the server could not be reached to validate it

## What the report includes

| Section             | What it shows                                                                                                                                                                                                                                  |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authentication**  | Active server URL, organization (SonarQube Cloud), and the current token state.                                                                                                                                                                |
| **Binaries**        | Auxiliary tools the CLI downloaded (for example, the secrets engine and SCA scanner), their paths, versions, and whether a newer pinned version is available.                                                                                  |
| **Cache**           | Whether log, SCA scanner cache, and global Git hook directories exist under `~/.sonar/sonarqube-cli/`.                                                                                                                                         |
| **Integrations**    | Each `sonar integrate` install with its config path. For most agents, MCP Server status is shown (not configured, configured, or invalid config). For Antigravity, Secrets Hook status is also shown when a secrets hook is recorded in state. |
| **Recommendations** | Suggested next steps such as `sonar auth login`, `sonar self-update` (standalone builds only), or re-running an integrate command to fix MCP or secrets hook configuration.                                                                    |

For token verification details, see [`sonar auth status`](/sonarqube-cli/using-sonarqube-cli/commands.md#sonar-auth-status). For what reset clears, see [Reset the CLI](/sonarqube-cli/administration/system-reset.md).

## Machine-readable output

For scripts and automation, pass `--json`:

```bash
sonar system status --json
```

The JSON document includes the CLI version, authentication summary, binaries, cache directories, integrations, MCP configuration flags, Antigravity secrets hook flags (`configured` and `valid` under `hooks` when applicable), a top-level `healthy` boolean, and a `recommendations` array. Token state in JSON uses `not_set`, `active`, `invalid`, or `set_unverified`.

## When to use it

* After `sonar auth login` or when integrations stop working: confirm the token, MCP config, and (for Antigravity) secrets hook are healthy
* Before filing a support request: capture the status output
* In CI diagnostics when the CLI behaves unexpectedly but commands still run

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

* [Commands reference](/sonarqube-cli/using-sonarqube-cli/commands.md)
* [Reset the CLI](/sonarqube-cli/administration/system-reset.md)
* [State and storage](/sonarqube-cli/administration/state-and-storage.md)
* [Output formats](/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cli/administration/system-status.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
