> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oumi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GLOBAL OPTIONS

> Flags, environment variables, and exit codes shared by every command

These options work at any position in the command line, so `oumi-cli --output json datasets list` and `oumi-cli datasets list --output json` do the same thing.

| Option            | Type                                            | Description                                                                                 |
| ----------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `--output`, `-o`  | `json`, `table`, `id`                           | Output mode. Defaults to `json` unless both stdin and stdout are TTYs. Env: `OUMI_OUTPUT`.  |
| `--profile`       | text                                            | Active configuration profile. Default: `default`. Env: `OUMI_PROFILE`.                      |
| `--config`        | path                                            | Path to the `config.toml` file, overriding the default location. Env: `OUMI_CONFIG`.        |
| `--log-level`     | `debug`, `info`, `warning`, `error`, `critical` | Log level. Defaults to `warning`. Overrides `OUMI_LOG_LEVEL` and the profile.               |
| `--verbose`, `-v` | integer                                         | Shortcut for `--log-level`. `-v` sets info, `-vv` sets debug.                               |
| `--quiet`, `-q`   | flag                                            | Suppress non-essential stderr.                                                              |
| `--no-input`      | flag                                            | Disable interactive prompts. Env: `OUMI_NO_INPUT`.                                          |
| `--command-list`  | flag                                            | Print the full command tree as JSON and exit. Renders as a tree on an interactive terminal. |
| `--version`       | flag                                            | Print the version and exit.                                                                 |
| `--help`, `-h`    | flag                                            | Show help for the current command and exit.                                                 |

For what the three output modes look like and how to page through long lists, see [output formats](/cli/basics/output-formats).

## ENVIRONMENT VARIABLES

| Variable            | Description                                              |
| ------------------- | -------------------------------------------------------- |
| `OUMI_API_KEY`      | API key for the session. Avoids persisting a credential. |
| `OUMI_ORG_ID`       | Default organization.                                    |
| `OUMI_PROJECT_ID`   | Default project for commands that take `--project`.      |
| `OUMI_OUTPUT`       | Default output mode.                                     |
| `OUMI_PROFILE`      | Active configuration profile.                            |
| `OUMI_CONFIG`       | Path to the config file.                                 |
| `OUMI_API_BASE_URL` | Base URL of the Oumi API.                                |
| `OUMI_LOG_LEVEL`    | Default log level.                                       |
| `OUMI_NO_INPUT`     | Disable interactive prompts.                             |

Resolution order is the command-line flag, then the environment variable, then the active profile. See [configuration](/cli/basics/configuration).

## EXIT CODES

Commands exit non-zero on failure and write a machine-readable error to stderr in `json` mode:

```json theme={null}
{"error": {"code": "http_not_found", "message": "...", "exit_code": 5}}
```

| Code | Meaning                                                              |
| ---- | -------------------------------------------------------------------- |
| 0    | Success                                                              |
| 1    | Local failure, or an HTTP error that maps to nothing more specific   |
| 2    | Argument or usage error                                              |
| 3    | Network unreachable, or a 5xx from the server                        |
| 4    | Credentials missing or rejected (401, 403)                           |
| 5    | Resource not found (404), or a local config key or profile is absent |
| 6    | Conflict, or the resource already exists (409)                       |
| 7    | Server-side validation failure (422)                                 |
| 8    | Command is registered but not implemented yet                        |
| 70   | Bug in the CLI itself. Please open an issue.                         |
| 130  | Interrupted with Ctrl-C                                              |

Prefer checking the exit code over parsing output:

```bash theme={null}
if ! oumi-cli evaluations get "$EVAL_ID" >/dev/null; then
  echo "lookup failed with exit code $?"
fi
```

## UTILITY COMMANDS

These sit at the top level and belong to no command group.

```bash theme={null}
oumi-cli version
oumi-cli search train
oumi-cli agent-instructions > AGENTS.md
```

`search` matches against every command path and summary. `agent-instructions` prints an `AGENTS.md`-style guide for driving the CLI from an automated agent.

## DISCOVERING COMMANDS

`--help` works at every level, and any help page is available as JSON for tooling:

```bash theme={null}
oumi-cli datasets upload --help
oumi-cli datasets upload --help --output json
oumi-cli --command-list --output json
```
