---
schema_version: "1"
id: a548381728b82ff95a94df078a09285451140e9d70a0a1e2cef3352422ffc0ab
title: Run Output Schemas
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/code-analyzer/salesforce-code-analyzer/guides/output-schemas-run.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/output-schemas-run.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ef2470b461c60b4f7488f437518daeea30fc23707c88e83aa88dd0e08998dffd
products:
  - Salesforce Code Analyzer
---
# Run Output Schemas

When you analyze your code with the `code-analyzer run` command, use the `--output-file` flag to write the results to a file. The format of the file depends on the extension you specify; valid values are `.html`, `.sarif`, `.json`, `.xml`, and `.csv`. If you don't specify the `--output-file` flag, then you get human-readable output displayed in the terminal. Use `--output-file` and `--view` together to get both an output file and the human-readable results in the terminal.

This command, for example, writes the results to a JSON-formatted file.

```bash
sf code-analyzer run --output-file results.json
```

## Machine-Readable Run Output Schemas

See these reference docs for details about the machine-readable output schemas for the `run` command:

- [JSON](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/output-schemas-json.md)
- [XML](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/output-schemas-xml.md)
- [CSV](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/output-schemas-csv.md)
- [SARIF](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#supported-sarif-output-file-properties). SARIF is an acronym for Static Analysis Results Interchange Format. Code Analyzer follows the OASIS standard when it outputs SARIF-formatted files.

## HTML Human-Readable Run Output

You can also write the results of the `run` command to an HTML file if you want human-readable output.

```bash
sf code-analyzer run --output-file results.html
```

When you open the `results.html` file in a browser, you see something like this.

![Output of the run command in HTML format.](https://developer.salesforce.com/docs/media/salesforce-code-analyzer/code-analyzer-html-output.png)

By default, the report lists all the violations. To filter the list by severity, click the buttons at the top or use the drop-down menus. You can also filter by engines or use the search box to find a particular violation by name.

