> 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/using-sonarqube-cli/output-formats.md).

# Output formats

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` and `sonar analyze agentic`.                                                                                           |

## 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` / `analyze agentic` | `text`, `json`                 | `text`  |
| `sonar analyze dependency-risks`    | `json`, `toon`, `table`        | `table` |
| `sonar analyze secrets`             | (no `--format`; text only)     | -       |
| `sonar remediate`                   | (no `--format`; interactive)   | -       |
| `sonar api`                         | Raw response body              | -       |
| `sonar system status`               | `json` (via `--json`)          | `text`  |

## 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. For `sonar analyze dependency-risks`, progress prints to stderr and the payload prints to stdout, so `jq` and other parsers see only the results.
* **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
```

Feed dependency risks to an AI agent:

```bash
sonar analyze dependency-risks -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
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/using-sonarqube-cli/output-formats.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.
