Configuration
Environment variables, config file location, and key precedence for the ReddGrow CLI
The CLI can be configured through environment variables or a local config file. Environment variables always take precedence over the config file.
Environment Variables
REDDGROW_API_KEY
Your ReddGrow API key. When set, this overrides any key saved by reddgrow auth login.
export REDDGROW_API_KEY=rg_your_key_hereUseful for CI/CD pipelines, Docker containers, or any environment where you want to inject credentials without touching the filesystem.
REDDGROW_API_URL
The base URL for the ReddGrow API. Defaults to https://api.reddgrow.ai.
export REDDGROW_API_URL=https://api.reddgrow.aiOnly change this if you are pointing the CLI at a self-hosted or staging instance.
REDDGROW_MODE
Force a specific output mode. Accepted values: human, agent.
export REDDGROW_MODE=agentWhen set to agent, all commands output raw JSON regardless of whether the terminal is interactive. See Output Modes for full details.
Config File
When you run reddgrow auth login, the API key is written to a local config file:
~/.reddgrow/config.jsonExample file contents:
{
"apiKey": "rg_your_key_here"
}You can edit this file directly, but reddgrow auth login and reddgrow auth logout are the recommended way to manage it.
Precedence
When multiple sources provide the same setting, the CLI resolves them in this order (highest to lowest):
| Priority | Source |
|---|---|
| 1 (highest) | Environment variable (e.g., REDDGROW_API_KEY) |
| 2 | Config file (~/.reddgrow/config.json) |
| 3 (lowest) | Built-in defaults |
For output mode specifically:
| Priority | Source |
|---|---|
| 1 | --mode flag |
| 2 | REDDGROW_MODE environment variable |
| 3 | TTY auto-detection |
Quick Reference
| Variable | Default | Description |
|---|---|---|
REDDGROW_API_KEY | — | API key (overrides saved key) |
REDDGROW_API_URL | https://api.reddgrow.ai | API base URL |
REDDGROW_MODE | auto | Output mode: human or agent |