Environment variables
Every setting in .hezgene/config.jsoncan be overridden via environment variables. This is especially useful for CI/CD pipelines where you don't want to commit configuration files.
Naming convention
Environment variables follow a strict mapping from the JSON path:HEZGENE_ + SECTION_KEY
| JSON Key | Environment Variable |
|---|---|
llm.provider | HEZGENE_LLM_PROVIDER |
llm.model | HEZGENE_LLM_MODEL |
llm.api_key | HEZGENE_LLM_API_KEY |
evolution.generations | HEZGENE_EVOLUTION_GENERATIONS |
evolution.min_improvement | HEZGENE_EVOLUTION_MIN_IMPROVEMENT |
Provider-specific keys
While you can use HEZGENE_LLM_API_KEY, HezGene will automatically detect the standard environment variables used by the providers if they are present:
OPENAI_API_KEYANTHROPIC_API_KEYGEMINI_API_KEY
Precedence
Environment variables take absolute precedence over the
config.json file.CI/CD example
name: HezGene Audit
on: [push]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Codebase Intelligence
run: hezgene audit --min-score 80
env:
HEZGENE_EVOLUTION_GENERATIONS: 1 # Fast audit for CI
HEZGENE_LLM_PROVIDER: "none" # pure AST mutationsWas this page helpful?