CLI — Configuration
Authentication, config file, and environment variables.
Config precedence
CLI flags override environment variables, which override the config file, which overrides defaults.
| Setting | Flag | Env var | Config file | Default |
|---|---|---|---|---|
| API key | --api-key | KORCLAW_API_KEY | apiKey | none |
| Base URL | --base-url | KORCLAW_BASE_URL | baseUrl | https://app.korclaw.com/api/v1 |
Config file
Config is stored at $XDG_CONFIG_HOME/korclaw/config.json (default ~/.config/korclaw/config.json), with fallback to ~/.korclaw/config.json. Written by korclaw login with mode 0600.
json
{
"apiKey": "kc_live_your_api_key_here",
"baseUrl": "https://app.korclaw.com/api/v1"
}Global options
- --api-key <key> — API key override
- --base-url <url> — Base URL override
- -h, --help — Show help
Exit codes
| Code | Error type |
|---|---|
| 1 | AuthenticationError or general error |
| 2 | ValidationError |
| 3 | RateLimitError |