Configuration Reference

Hexi uses layered TOML plus environment variables.

Files

  • .hexi/config.toml: shared defaults
  • .hexi/local.toml: machine-local overrides and optional local secrets
  • .hexi/runlog.jsonl: append-only event log

Precedence

  1. Environment variables
  2. .hexi/local.toml
  3. .hexi/config.toml
  4. Internal defaults

Model section

[model]
provider = "openai_compat"
model = "gpt-4o-mini"

Provider blocks

[providers.openrouter_http]
base_url = "https://openrouter.ai/api/v1"
api_style = "openai"

Supported provider keys:

  • openrouter_http
  • openrouter_sdk
  • openai_compat
  • anthropic_compat

Policy section

[policy]
allow_commands = ["git status", "git diff", "pytest"]
max_diff_chars = 4000
max_file_read_chars = 4000

Secrets

Preferred via environment variables:

  • OPENROUTER_API_KEY
  • OPENAI_API_KEY
  • ANTHROPIC_API_KEY

Optional local fallback:

[secrets]
openrouter_api_key = "..."
openai_api_key = "..."
anthropic_api_key = "..."