refactor(cli): update max turns configuration precedence and enhance documentation

This commit is contained in:
teknium1 2026-02-28 10:35:49 -08:00
parent 6366177118
commit 1ddf8c26f5
3 changed files with 20 additions and 3 deletions

View file

@ -161,6 +161,19 @@ hermes config set terminal.backend docker
hermes config set OPENROUTER_API_KEY sk-or-... # Saves to .env
```
### Configuration Precedence
Settings are resolved in this order (highest priority first):
1. **CLI arguments**`hermes chat --max-turns 100` (per-invocation override)
2. **`~/.hermes/config.yaml`** — the primary config file for all non-secret settings
3. **`~/.hermes/.env`** — fallback for env vars; **required** for secrets (API keys, tokens, passwords)
4. **Built-in defaults** — hardcoded safe defaults when nothing else is set
**Rule of thumb:** Secrets (API keys, bot tokens, passwords) go in `.env`. Everything else (model, terminal backend, compression settings, memory limits, toolsets) goes in `config.yaml`. When both are set, `config.yaml` wins for non-secret settings.
The `hermes config set` command automatically routes values to the right file — API keys are saved to `.env`, everything else to `config.yaml`.
### Optional API Keys
| Feature | Provider | Env Variable |