# Output formats

> Output formats in UiPath CLI, covering the structured envelope emitted by every command in JSON, table, YAML, and plain renderings.

Every `uip` command emits a single structured envelope on stdout. The envelope has the same schema whether you are reading it in a terminal, feeding it into `jq`, or consuming it from a pipeline. Five formats render that envelope differently: `json` (the default), `table`, `yaml`, `plain`, and `markdown`. Switch between them with `--output` and filter with `--output-filter`.

## The envelope

Success:

```json
{
  "Result": "Success",
  "Code": "FolderList",
  "Data": [
    {
      "Key": "9f2b3c…-…",
      "Name": "Shared",
      "Path": "Shared",
      "Type": "Standard"
    }
  ]
}
```

Failure:

```json
{
  "Result": "ValidationError",
  "Message": "Unknown option '--folder-pth'. Did you mean '--folder-path'?",
  "Instructions": "Run 'uip or folders list --help' to see valid options.",
  "ErrorCode": "invalid_argument",
  "Retry": "RetryWillNotFix",
  "Log": "/var/log/uip/2026-04-24.log"
}
```

Fields:

- `Result` — the outcome category. `Success` on success; `Failure`, `ConfigError`, `AuthenticationError`, `ValidationError`, or `TimeoutError` on failure. Maps directly to the [exit code](./exit-codes.md).
- `Code` — the command-specific success identifier. Stable within a MAJOR version (`FolderList`, `SolutionPack`, `JobStarted`, `SkillsInstall`, etc.).
- `Data` — the command's payload. Shape is command-specific; see each command's reference page for the exact fields.
- `Message`, `Instructions` — present on failure. `Message` is the human-readable error; `Instructions` tells the user or operator what to do.
- `ErrorCode` — present on every failure. A stable, command-independent taxonomy for scripts that need finer-grained branching than the exit code alone: `invalid_argument`, `confirmation_required`, `authentication_required`, `permission_denied`, `local_permission_denied`, `not_found`, `not_enabled`, `rate_limited`, `network_error`, `timeout`, `server_error`, `method_not_allowed`, `configuration_error`, `unknown_error`.
- `Retry` — present on every failure. Whether retrying is worth it, and how soon: `RetryWillNotFix`, `RetryLater`, `RetryAfter1Second`, `RetryAfter10Seconds`, `RetryAfter30Seconds`, `RetryAfter60Seconds`.
- `Context` — optional failure details (HTTP status, request ID, etc.).
- `Warning` — optional non-fatal note, for example when `--output-filter` returned nothing from the records it read.
- `Log` — when `--log-file` is active, the path to the log file, included in every envelope.

`ErrorCode` and `Retry` are populated automatically on every failure, even when a command doesn't set them explicitly — see [Scripting patterns — retrying on `Retry`](./scripting-patterns.md) for how to branch on them instead of parsing `Message` text.

The envelope itself is **stable across MINOR versions**. The shape of `Data` is command-specific and can evolve — see [Versioning and stability](./versioning.md).

## The five formats

### json (default)

```bash
uip or folders list
```

```json
{
  "Result": "Success",
  "Code": "FolderList",
  "Data": [
    { "Key": "9f2b3c…", "Name": "Shared", "Path": "Shared", "Type": "Standard" },
    { "Key": "a4b8f1…", "Name": "Finance", "Path": "Finance", "Type": "Standard" }
  ]
}
```

Default because it is parseable by any JSON consumer (`jq`, `--output-filter`, scripts, AI agents) and deterministic across versions. In a terminal it reads fine; for a pretty-printed table, switch to `--output table`.

### table

```bash
uip or folders list --output table
```

```
Key         Name       Path      Type
9f2b3c…     Shared     Shared    Standard
a4b8f1…     Finance    Finance   Standard
```

Colored and bordered in a real terminal (colors are suppressed when stdout is not a TTY). Each command picks the **columns** it considers most useful for the table view — not every field in `Data` is necessarily shown. For the complete field set, use JSON or YAML.

A list of plain values, such as a list of names, renders as a table with a single `Value` column.

**Do not parse the table output.** Column widths, borders, and even the set of columns can change between MINOR versions. It is for human reading only.

### yaml

```bash
uip or folders list --output yaml
```

```yaml
Result: Success
Code: FolderList
Data:
  - Key: 9f2b3c…
    Name: Shared
    Path: Shared
    Type: Standard
  - Key: a4b8f1…
    Name: Finance
    Path: Finance
    Type: Standard
```

A literal YAML serialization of the same envelope as `json`. Useful if your tooling prefers YAML (Ansible, Kubernetes manifests, some CI platforms) or if you are comparing two runs by eye and find YAML easier to scan.

### plain

```bash
uip or folders list --output plain
```

```
Data[0].Key=9f2b3c…
Data[0].Name=Shared
Data[0].Path=Shared
Data[0].Type=Standard
Data[1].Key=a4b8f1…
Data[1].Name=Finance
Data[1].Path=Finance
Data[1].Type=Standard
```

One `path=value` per line. The path is a dot-notation JMESPath-like key into the envelope. Convenient for shell loops on machines that don't have `jq`:

```bash
uip or folders list --output plain | grep -E '\.Name=' | cut -d= -f2
```

### markdown

```bash
uip or folders list --output markdown
```

```markdown
| Key | Name | Path | Type |
| --- | --- | --- | --- |
| 9f2b3c… | Shared | Shared | Standard |
| a4b8f1… | Finance | Finance | Standard |
```

Renders the envelope as GitHub-flavored markdown — a table for a list of records, or `**key:** value` lines and nested headed sections for a single record. Intended for an agent or chat surface reading `uip` output through a shell, not for a human terminal session: a command that already returns prose (for example `uip rpa validate`) passes it through verbatim instead of as an escaped JSON string. On failure, the format renders `**Failed:** <Message>` followed by any `Data` and `Instructions`.

## Filtering with --output-filter

`--output-filter` accepts a [JMESPath](https://jmespath.org/) expression. It runs on the envelope's `Data` field before formatting, and its result replaces `Data`; the other envelope fields stay in place. The filter output inherits whichever format `--output` produces.

Some common patterns:

```bash
# project specific fields
uip or folders list --limit 50 --output-filter "[*].{Name: Name, Path: Path}"

# count
uip or folders list --limit 50 --output-filter "length(@)"

# first match
uip or folders list --limit 50 --all --name Shared --output-filter "[0]"

# flat list of names
uip or folders list --limit 50 --output-filter "[*].Name" --output plain
```

A malformed expression exits with `ValidationError` (exit code `3`) before the command runs, so a typo does not waste an API call. When a filter returns nothing from records that were there, the envelope carries a `Warning` field naming the fields that do not exist. On failure, the filter applies to the failure's `Data` only. Refer to [Global options — `--output-filter`](./global-options.md#--output-filter) for the full flag.

## Stream separation

`--output` controls **stdout only**. Every other form of output goes to **stderr** regardless of format:

- Log lines (what `--log-level` controls).
- Progress indicators (spinners, download bars during tool auto-install).
- Error text rendered by the host when it detects an invalid flag.

This means a pipeline can capture clean output to a file without losing diagnostics:

```bash
uip or folders list > folders.json 2> uip.log
```

In CI, redirect them separately to make logs greppable without needing to strip ANSI or progress artifacts from the data stream.

## Colors and TTY detection

The `table` format emits ANSI color codes when stdout is an interactive terminal (`isTTY`). When you pipe to a file or to another process, or run in a CI runner that disables TTY, table output is plain text without escape codes by default.

Two environment variables override TTY auto-detection:

| Variable | Effect |
|---|---|
| `NO_COLOR` | Any value forces color off, even on a TTY. |
| `FORCE_COLOR` | Forces color on, even when stdout is not a TTY — useful when a CI log viewer renders ANSI codes and you want the colored table anyway. |

Other formats (`json`, `yaml`, `plain`) never emit colors.

## Overriding the default format

`--output` defaults to `json` when omitted. Set `UIP_DEFAULT_OUTPUT` to change that default for the current shell without passing `--output` on every command:

```bash
export UIP_DEFAULT_OUTPUT=table
uip tools list                  # → table

uip tools list --output yaml   # --output still wins → yaml
```

Accepts `table`, `json`, `yaml`, `plain`, or `markdown`; an invalid value is ignored and the built-in `json` default is kept.

## Choosing a format

| Use case | Recommended format |
|---|---|
| Reading in a terminal | `--output table` |
| Scripting (`jq`, shell pipelines) | `--output json` (default) |
| Ansible / Kubernetes integration | `--output yaml` |
| `grep`-friendly flat output without `jq` | `--output plain` |
| AI coding agents | `--output json` (default) with `--output-filter` for focused extraction, or `--output markdown` for a chat-readable rendering |
| CI pipelines that pass values between steps | `--output json` with `--output-filter`, or `--output plain` for simple cases |

## See also

- [Global options](./global-options.md) — the `--output`, `--output-filter`, `--log-level`, `--log-file` flags.
- [Exit codes](./exit-codes.md) — mapping from `Result` to process exit code.
- [Scripting patterns](./scripting-patterns.md) — retries, polling, and safe JSON extraction in CI.
- [Versioning and stability](./versioning.md) — what "stable JSON envelope" means under semver.
