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

# CLI global options

> Learn about the global options available for the Openlayer CLI

Global options are commonly available to use with multiple Openlayer CLI commands.

## API key

The `--api-key` option can be used to provide an [Openlayer API key](/workspace-and-projects/find-your-api-key)
when running Openlayer CLI commands.

For example, to push without having to run [`openlayer login`](/api-reference/cli/commands/login):

```bash theme={null}
openlayer push --api-key=[your api key here]
```

## Debug

The `--debug` option can be used to provide a more verbose output when running Openlayer CLI commands.

```bash theme={null}
openlayer --debug
```

## Profile name

The `--profile-name` option can be used to specify the profile name to read from for config (default `"default"`).

```bash theme={null}
openlayer --profile-name=[profile name]
```

## Environment variables

The CLI also reads configuration from environment variables. They are the simplest way to
configure the CLI in CI/CD and other non-interactive environments, because they replace
[`openlayer login`](/api-reference/cli/commands/login) and
[`openlayer link`](/api-reference/cli/commands/link) entirely:

| Variable                 | Description                                                                                      |
| ------------------------ | ------------------------------------------------------------------------------------------------ |
| `OPENLAYER_API_KEY`      | Your [Openlayer API key](/workspace-and-projects/find-your-api-key). Replaces `openlayer login`. |
| `OPENLAYER_PROJECT_ID`   | The id of the target project. Replaces `openlayer link`.                                         |
| `OPENLAYER_WORKSPACE_ID` | The id of the target workspace. Usually not needed — it is derived from the API key.             |
| `OPENLAYER_BASE_URL`     | The API base URL. Only needed for self-hosted or local Openlayer deployments.                    |

```bash theme={null}
export OPENLAYER_API_KEY=... OPENLAYER_PROJECT_ID=...
openlayer push --message "CI run"   # no login or link needed
```

## Output mode

The `--output-mode` option controls how the CLI formats its output. It accepts `terminal`
(the default, with colors and interactive progress) or `ci` (plain output suited for CI logs).

```bash theme={null}
openlayer push --output-mode=ci
```

`ci` is also a no-prompt guard: in this mode the CLI never asks for input. A command that
would otherwise prompt fails with an error telling you to pass the value as a flag or
environment variable, rather than hanging on a missing terminal.

That makes the commands that used to be terminal-only usable in automation:

* [`openlayer login`](/api-reference/cli/commands/login#non-interactive-sign-in) signs in from
  `--api-key` or `OPENLAYER_API_KEY`. An explicitly supplied key is enough on its own — you do
  not have to pass `--output-mode ci` for this.
* [`openlayer link`](/api-reference/cli/commands/link#non-interactive-linking) links to the
  project named by `--project`. `--output-mode ci` implies its `--yes` flag.
* [`openlayer init`](/api-reference/cli/commands/init#non-interactive-use) runs the whole setup
  flow from flags.

## Version

The `--version` option can be used to verify the version of Openlayer CLI being used.

```bash theme={null}
openlayer --version
```
