# Global options

> Global options accepted by every `uip` invocation, covering output format, output filter, log level, and log file.

Every `uip` invocation is pre-scanned for a fixed set of global options before any tool or subcommand sees its arguments — they can appear anywhere on the command line, work identically across every tool, and are stripped out before per-command flag parsing runs.

| Option | Short | Value | Default | Purpose |
|---|---|---|---|---|
| `--output` | — | `table`, `json`, `yaml`, `plain`, `markdown` | `json` | Format of the primary output written to stdout. |
| `--output-filter` | — | JMESPath expression | — | Filter applied to the `Data` field of the response envelope before formatting. |
| `--log-level` | — | `debug`, `info`, `warn`, `error` | `warn` | Verbosity of log messages written to stderr (or to `--log-file` if set). |
| `--log-file` | — | path | — | If set, logs are written to this file instead of stderr. |
| `--profile` | — | name | — | Selects a named, saved login profile instead of the default credentials location. Mutually exclusive with a command's own `-f, --file <folder>` (for example on `uip login`, `uip login tenant list/set`, `uip logout`) — passing both is a `ValidationError`. See [Sessions and credentials](./concepts-sessions.md). |
| `--interactive` / `--no-interactive` | — | flag | auto (prompts only on a TTY) | Force prompting on or off, overriding the default "prompt only when connected to a TTY" behavior. Not specific to any one command — it governs every place a `uip` command would otherwise ask a question (for example tenant selection during `uip login`, or the agent/target picker on `uip skills install`). |

`--version` (`-v`) and `--help` (`-h`) are also recognized on `uip` and every subcommand, but they are standard CLI conventions rather than global flags in the sense above.

## --output

Choose the output format. Both `--output json` and `--output=json` work; values are case-sensitive.

```bash
uip or folders list                     # default: json
uip or folders list --output table      # human-friendly table
uip or folders list --output yaml       # yaml
uip or folders list --output plain      # key=value lines, no structure
uip or folders list --output markdown   # GitHub-flavored markdown, for agents/chat surfaces
```

- **`json`** (default) — one JSON document on stdout. Parseable by `jq`, `--output-filter`, and any JSON consumer. This is the default for every invocation regardless of whether the terminal is a TTY.
- **`table`** — bordered, colored table suitable for reading in a terminal. Not stable across versions — do not parse it.
- **`yaml`** — YAML serialization of the same structure as `json`.
- **`plain`** — flat `key=value` lines. Useful for piping into shell `read`, `grep`, and `cut` without installing `jq`.
- **`markdown`** — a GFM table for a list, or `**key:** value` lines for a single record. Meant for an agent or chat surface reading `uip` output, not a terminal session. Refer to [Output formats — markdown](./output-formats.md#markdown) for the full behavior.

Only the five format names above are read as the global option. Several commands own a `-o, --output <path>` option of their own; a value that is not a format name, such as `--output ./report.pdf`, is left for the command. You can therefore combine a format and a command's output path in one invocation, for example `--output json -o ./report.pdf`.

:::note
The default is **`json`**, not `table`. When a human runs `uip or folders list` in a terminal they see a JSON document on stdout. Pass `--output table` explicitly (or add it to a shell alias) for the reading-friendly view. This choice keeps the same stdout shape in a terminal and in a pipeline — scripts do not need to care whether they are running interactively.
:::

## --profile

Select a named, saved login profile instead of the default credentials location:

```bash
uip login --profile ci-runner --client-id env.UIPATH_CLIENT_ID --client-secret env.UIPATH_CLIENT_SECRET --tenant Production
uip or folders list --profile ci-runner
```

`--profile <name>` and a command's own `-f, --file <folder>` are mutually exclusive — passing both fails with `ValidationError: option '--profile' cannot be used with option '--file'`. Profile names are normalized (case and separator rules apply); an invalid name is rejected before any network call. See [Sessions and credentials — named profiles](./concepts-sessions.md).

## --interactive / --no-interactive

Override the default "prompt only when stdout is a TTY" behavior:

```bash
uip login --interactive        # force the tenant-selection prompt even when not on a TTY
uip skills install --no-interactive --agent claude   # never prompt, fail instead if a required choice is missing
```

`--interactive` sets prompting to always-on; `--no-interactive` forces it off. Neither flag is specific to `uip login` — despite appearing in login examples throughout this documentation set, interactivity is a cross-cutting global option with no command-specific short form (there is no `--it` or similar alias anywhere in the CLI).

### Stream separation

`--output` controls **stdout only**. Logs, progress indicators, and human-facing errors go to **stderr**, regardless of format. This means a pipeline can capture clean JSON with:

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

…and still see the log output separately.

## --output-filter

Apply a [JMESPath](https://jmespath.org/) expression to the `Data` field of the response envelope before formatting. The expression starts at `Data`, not at the envelope, so `[*].Name` picks names out of a `Data` array and `length(@)` returns a count. The result replaces `Data`; `Result`, `Code`, and the other envelope fields stay in place.

```bash
# folder names only
uip or folders list --limit 50 --output-filter "[*].Name"

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

# first folder's key and name
uip or folders list --limit 50 --output-filter "[0].{Key: Key, Name: Name}"
```

Keys in the filtered result are normalized to PascalCase, the same as unfiltered `Data`. A projection that returns plain values, such as `[*].Name`, is rendered as one record per value, keyed by the last field name in the expression.

Combining with `--output`:

```bash
# names as YAML
uip or folders list --limit 50 --output-filter "[*].Name" --output yaml

# names as one-per-line plain text
uip or folders list --limit 50 --output-filter "[*].Name" --output plain
```

A malformed filter expression fails fast with a `ValidationError` and exit code 3 before the underlying command runs — so a typo does not waste an API call.

A filter can also fail while it runs on the records. For example, `contains()`, `starts_with()`, and `ends_with()` fail on a null argument. The command fails with `ValidationError` and exit code 3. When the failing argument is a field read from the records, `Message` names it:

- A field that the records do not have is reported as not a field, followed by the available fields. Field names are case-sensitive.
- A field that is null or missing on some records is reported with the number of those records, and `Instructions` shows a default to add, for example `Note || ''`.

The filter runs on the client, over the records the command fetched. On a command whose `--limit` has a default value, `--output-filter` requires an explicit `--limit`; without one, the command fails instead of filtering only the first page of records.

When the filter returns nothing, or only null values, from records that were there, the envelope carries a `Warning` field that names the fields the expression read that do not exist, and lists the available fields. The same note is written to stderr.

On failure, the filter is applied to the failure envelope's `Data` the same way. `Message`, `Instructions`, `ErrorCode`, `Retry`, and `Context` are never filtered. If the filter cannot be evaluated against a failure's `Data`, `Data` is shown in full and `Warning` explains why.

:::tip
`--output-filter` is the CLI's version of Azure CLI's `--query`, AWS CLI's `--query`, and gcloud's `--filter`/`--format`. If you already know JMESPath from those tools, the syntax is identical.
:::

## --log-level

Set the verbosity of log messages (written to stderr, or to `--log-file` if provided).

```bash
uip or folders list --log-level debug   # verbose — HTTP calls, auth refresh, tool loading
uip or folders list --log-level info
uip or folders list --log-level warn    # default
uip or folders list --log-level error   # only failures
```

Values are case-insensitive. Unknown values are silently ignored (the default is kept) rather than erroring — on purpose, so a typo in a wrapper script does not break a pipeline.

At the default `warn` level, warnings are written to stderr. stdout and exit codes do not depend on the log level, so a script that treats any stderr output as a failure should pass `--log-level error`.

When `--log-level` is not passed, the level comes from the first of these that is set:

1. `logLevel` in the configuration file, set with [`uip config set logLevel <level>`](./uip-config.md) and stored as `core.logLevel` in `.uipath/config.json`.
2. The `UIP_LOG_LEVEL` environment variable, which takes the same values as `--log-level`.
3. The `DEBUG` environment variable set to `true` or `1`, which selects `debug`.

Otherwise the level is `warn`. The `UIPATH_LOG_LEVEL` environment variable is not honored.

## --log-file

Write the log stream to the specified file instead of stderr. The file is created if it does not exist, including missing parent directories, and is **truncated** at the start of each run — use a build-specific path if you need to keep logs from several runs.

```bash
uip or folders list --log-file ./uip.log
uip or folders list --log-file /var/log/uip/$(date +%F).log --log-level debug
```

Each line in the file is the log message prefixed with an ISO 8601 timestamp:

```
2026-04-24T18:42:00.123Z [DEBUG] <message>
```

Debug, warning, and error lines carry a `[DEBUG]`, `[WARN]`, or `[ERROR]` tag; info lines carry none. When `--log-file` is set, every envelope includes a `Log` field with the file path.

## Where global options apply

Global options are stripped from the command line before per-command flags are parsed, so they can appear anywhere on the command line:

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

All four invocations are equivalent.

Tool subcommands do not define their own `--log-level`. Commands that take an output path define `-o, --output <path>`; the CLI reads `--output` as the global option only when its value is one of the format names, so the two do not collide.

## Exit codes

Global options control output and logging only; they do not affect exit codes. See [Exit codes](./exit-codes.md).

## Environment variable overrides

These environment variables change global-option behavior without a flag:

| Variable | Effect |
|---|---|
| `UIP_DEFAULT_OUTPUT` | Overrides the built-in `json` default for `--output` when the flag isn't passed. Accepts `table`, `json`, `yaml`, `plain`, or `markdown`; invalid values are ignored. An explicit `--output` on the command line always wins. |
| `UIP_TIMINGS` | Set to `1` or `true` to print a per-invocation timing line on every `uip` command. Refer to [Command timings](#command-timings) below. |
| `UIP_TIMINGS_FILE` | Path of a file to append the timing line to, instead of writing it to stderr. Read only when `UIP_TIMINGS` is on. |

## Command timings

Set `UIP_TIMINGS=1` (or `true`) and every invocation prints one line to stderr (or to the `--log-file` file, when one is set):

```
[timing] 'uip or assets list' exit=0 total=1250ms startup=380ms command=863ms http=691ms httpCalls=3 flush=7ms
```

| Field | Meaning |
|---|---|
| *(the quoted command)* | The command as typed. |
| `exit` | The exit code the invocation returned. |
| `total` | Total wall clock, measured from process start. |
| `startup` | Everything before the command handler ran — process boot, config, tool loading. |
| `command` | The command handler itself. |
| `http` | Summed duration of the run's outbound HTTP calls — a **sum**, not wall clock. It overlaps `command` rather than adding to it, so parallel calls can make it larger than `command`. |
| `httpCalls` | How many outbound HTTP calls that sum covers. |
| `flush` | Everything after the handler returned — telemetry bookkeeping and the final flush. |

`startup + command + flush` always equals `total`. Fields are omitted when they don't apply: a run that never reaches a handler (`uip --version`, an unknown command) prints only `total` and `exit`; a command that makes no HTTP call has neither `http` nor `httpCalls`.

The report has its own switch — it doesn't depend on `--log-level`, so you get durations without turning on debug output, and stdout is never touched.

To keep the report off stderr without moving the rest of the log stream, set `UIP_TIMINGS_FILE` to a file path. Each invocation appends its line to that file, so several runs can share one file. Only the values `1` and `true` turn the report on; any other `UIP_TIMINGS` value leaves it off.

## See also

- [Output formats (table, JSON, YAML)](./output-formats.md) — deeper coverage with full examples of each format.
- [Scripting patterns](./scripting-patterns.md) — exit codes, stream separation, retries, polling.
- [uip login reference](./uip-login.md) and other command pages — document their per-command flags in addition to these globals.
