Environment Variables
Optional environment variables you can set when running the PolyCLI CLI tool.
PolyCLI supports two environment variables. POLYCLI_API_KEY lets you store your API key without repeating the --key flag on every invocation — particularly useful in CI/CD pipelines. POLYCLI_API_URL is for pointing the CLI at a local or staging instance.
Reference
| Variable | Required | Default | Description |
|---|---|---|---|
| POLYCLI_API_KEY | One of --key or this var | — | Your PolyCLI API key. Used when --key is not passed. The --key flag takes precedence if both are set. |
| POLYCLI_API_URL | No | https://app.polycli.dev | Override the PolyCLI backend URL. Useful for pointing the CLI at a local development instance or a staging environment. |
Example: API key via env var
Export the key once in your shell session (or add it to your CI secrets) and run without the flag:
bash
export POLYCLI_API_KEY=bt_live_xxxxxxxxxxxxxxxxxxxx
npx @polycli/cli runExample: local development
If you are running the PolyCLI web app locally (e.g. on port 3000), point the CLI at it:
bash
export POLYCLI_API_KEY=bt_live_xxxxxxxxxxxxxxxxxxxx
export POLYCLI_API_URL=http://localhost:3000
npx @polycli/cli runGet your API key from the PolyCLI dashboard. Keys start with
bt_live_.