# Environment variables

> The environment variables Shoplazza CLI reads, such as SHOPLAZZA_UAT, SHOPLAZZA_CLI_PROFILE, and SHOPLAZZA_CLI_FORMAT, how to set them for CI, and their precedence against flags.

Shoplazza CLI reads the following environment variables.

| Variable | Description | Example |
|----------|-------------|---------|
| `SHOPLAZZA_UAT` | User Access Token for non-interactive login; `auth login` uses it when `--uat` is not passed | `uat_abc123...` |
| `SHOPLAZZA_CLI_PROFILE` | Profile to use (overridden by `--profile`) | `prod-us` |
| `SHOPLAZZA_CLI_FORMAT` | Pin the default output format (`json`/`pretty`/`table`/`ndjson`/`csv`), overriding terminal auto-detection; `--format` still overrides it | `json` |
| `SHOPLAZZA_CLI_NO_INTERACTIVE` | Any non-empty value disables interactive prompts (same as `--no-input`) | `1` |
| `CI` | Any non-empty value disables interactive prompts, makes `json` the default output format, and skips the background update and metadata checks | `true` |
| `SHOPLAZZA_CLI_ENVIRONMENT` | Theme environment from `shoplazza.theme.toml` for `themes push` / `pull` / `serve` / `share` (same as `-e`) | `staging` |
| `SHOPLAZZA_CLI_NO_UPDATE_CHECK` | Disable the background new-version check | `1` |
| `SHOPLAZZA_CLI_NO_META_UPDATE` | Disable background API-metadata refreshes | `1` |
| `SHOPLAZZA_CLI_NO_NOTICE` | Set to `1` to drop the `_notice` block from JSON success envelopes | `1` |
| `SHOPLAZZA_CLI_AUTH_BASE_URL` | Override the auth base URL (default `https://partners.shoplazza.com`) | — |
| `SHOPLAZZA_CLI_USER_ID` | Override the `cli-user-id` request header (audit attribution). Defaults to the user ID captured at login; set it when `SHOPLAZZA_ACCESS_TOKEN` injects a token, which carries no login state | — |

## Usage

Set these variables for CI/CD pipelines or automated scripts:

```shell
export SHOPLAZZA_UAT=your-token

# auth login reads SHOPLAZZA_UAT, so no browser and no --uat flag
shoplazza auth login --store-domain my-store.myshoplaza.com

# Later commands use the stored login
shoplazza products +search --keyword "shirt"
```

## Precedence

1. Command-line flags (`--uat`, `--profile`, `--format`) take highest priority
2. Environment variables (`SHOPLAZZA_UAT`, `SHOPLAZZA_CLI_PROFILE`, `SHOPLAZZA_CLI_FORMAT`) are used when flags are not provided
3. Stored state is the fallback: the credentials and current profile saved by `auth login`, and for the output format, terminal auto-detection
