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 KeyEnvironment Variable
llm.providerHEZGENE_LLM_PROVIDER
llm.modelHEZGENE_LLM_MODEL
llm.api_keyHEZGENE_LLM_API_KEY
evolution.generationsHEZGENE_EVOLUTION_GENERATIONS
evolution.min_improvementHEZGENE_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_KEY
  • ANTHROPIC_API_KEY
  • GEMINI_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 mutations
Previous
LLM Providers
Ollama, OpenAI, Anthropic configs