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

# CLI configuration

> Environment variables used by the geo CLI.

The CLI is configured entirely through environment variables and a repository-root `.env` file.

## Environment variables

The CLI loads `.env` from the repo root using `setdefault`, so real environment variables always win. The table below lists every variable the CLI reads.

| Variable          | Default    | Meaning                                                                  |
| ----------------- | ---------- | ------------------------------------------------------------------------ |
| `GEO_DATA_ROOT`   | `./data`   | Persistent pipeline data root (databases, raw responses, cache, reports) |
| `GEO_BRANDS_ROOT` | `./brands` | Writable workspace YAML root                                             |
| `GEO_ROOT`        | —          | App root directory (read by the web app, **not** the Python CLI)         |

The following four environment variables are required by `geo init`:

| Variable                             | Default | Meaning                                             |
| ------------------------------------ | ------- | --------------------------------------------------- |
| `OPENROUTER_API_KEY`                 | —       | OpenRouter API key for LLM queries                  |
| `GOOGLE_WORKSPACE_CLI_CLIENT_ID`     | —       | Google Workspace CLI OAuth client ID                |
| `GOOGLE_WORKSPACE_CLI_CLIENT_SECRET` | —       | Google Workspace CLI OAuth client secret            |
| `GOOGLE_ANALYTICS_REFRESH_TOKEN`     | —       | Google Analytics refresh token for GSC and GA4 data |

### Provider keys

| Variable                   | Default | Meaning                                                     |
| -------------------------- | ------- | ----------------------------------------------------------- |
| `EXA_API_KEY`              | —       | Exa API key (required when an Exa engine is selected)       |
| `GOOGLE_PAGESPEED_API_KEY` | —       | Google PageSpeed Insights API key (required for SEO audits) |

### Metering quartet

These four variables configure the server-scoped metering layer used by token-authorized pipeline commands:

| Variable                | Default | Meaning                                                        |
| ----------------------- | ------- | -------------------------------------------------------------- |
| `GEO_REQUIRE_METERING`  | —       | If set, reject pipeline commands without valid metering tokens |
| `GEO_METERING_ENDPOINT` | —       | Metering service HTTP endpoint                                 |
| `GEO_OPERATION_ID`      | —       | Server-issued operation id bound to the current job            |
| `GEO_OPERATION_TOKEN`   | —       | Opaque operation token authenticating the job                  |

### Production values (from INFRA-NOTES.md)

In production, these paths are configured for the ECS container:

```text theme={null}
GEO_ROOT=/srv/ai-cmo
GEO_DATA_ROOT=/srv/ai-cmo/apps/web/data/pipeline
GEO_BRANDS_ROOT=/srv/ai-cmo/apps/web/data/brands
GEO_EXECUTABLE=/usr/local/bin/geo
GEO_PYTHON_EXECUTABLE=/usr/local/bin/python
```

<Note>
  `GEO_ROOT` is read by the web app (Next.js), not by the Python `geo` CLI.
</Note>
