# Output formats

> **Warning:** This product is in Beta stage and we may release breaking changes. The documentation here matches the release version listed in the table of contents.

Several SonarQube CLI commands can output their results in different formats. Pick the one that matches what's consuming the output.

## Available formats

| Format  | Best for                              | Notes                                                                                                                                                                       |
| ------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `json`  | Scripts, dashboards, downstream tools | A JSON array or object. Default for `sonar list issues`; the only output of `sonar list projects`.                                                                          |
| `table` | Reading in your terminal              | A human-friendly aligned table. Adds no headers or borders that would break copy/paste.                                                                                     |
| `csv`   | Spreadsheets, BI tools, archives      | Comma-separated values with a header row.                                                                                                                                   |
| `toon`  | AI coding agents and LLM consumption  | [Token-Oriented Object Notation (TOON)](https://github.com/toon-format/toon)—a token-efficient, LLM-friendly serialization. Use it when piping data into Claude or Copilot. |
| `text`  | Default for analysis commands         | Native human-readable output. Used by `sonar analyze agentic` / `sonar verify`.                                                                                             |

## Which command supports which format

| Command                            | Supported formats              | Default |
| ---------------------------------- | ------------------------------ | ------- |
| `sonar list issues`                | `json`, `toon`, `table`, `csv` | `json`  |
| `sonar list projects`              | `json` (only)                  | `json`  |
| `sonar analyze agentic` / `verify` | `text`, `json`                 | `text`  |
| `sonar analyze secrets`            | (no `--format`; text only)     | -       |
| `sonar remediate`                  | (no `--format`; interactive)   | -       |
| `sonar api`                        | Raw response body              | -       |

## Choosing a format

* **You're a person reading the output.** Use `table` for `list` commands, or stick with the default `text` for analysis.
* **You're a script.** Use `json`. It's stable, structured, and widely supported.
* **You're piping into a spreadsheet or BI tool.** Use `csv`.
* **You're piping into an AI agent (Claude Code, Copilot, etc.).** Use `toon`. It packs the same information into far fewer tokens than JSON, letting the agent see more of the data inside its context window.

## Examples

Human-readable issues list:

```bash
sonar list issues -p my-project --format table
```

Pipe issues into `jq`:

```bash
sonar list issues -p my-project --format json | jq '.issues[] | select(.severity=="BLOCKER")'
```

Export issues to a spreadsheet:

```bash
sonar list issues -p my-project --format csv > issues.csv
```

Feed issues to an AI agent:

```bash
sonar list issues -p my-project --format toon
```

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

* [Commands reference](/sonarqube-cli/using-sonarqube-cli/commands.md)
* [Exit codes](/sonarqube-cli/using-sonarqube-cli/exit-codes.md)


---

# Agent Instructions: 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:

```
GET https://docs.sonarsource.com/sonarqube-cli/using-sonarqube-cli/output-formats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
