diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-19 23:28:03 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-19 23:28:03 +0300 |
| commit | 507b84f2442eecf7422738b66dc29417870cda52 (patch) | |
| tree | 4daa19839a4cf237f1eb3254889dd20246519180 /internal/hexaicli | |
| parent | fd8e2fe8177305c9271d12c90cc6ad2ed73a1673 (diff) | |
config: apply HEXAI_* env even without config file; docs: clarify Copilot key; prefer HEXAI_COPILOT_API_KEY in builders
Diffstat (limited to 'internal/hexaicli')
| -rw-r--r-- | internal/hexaicli/run.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/hexaicli/run.go b/internal/hexaicli/run.go index 8cd5c82..14eff4f 100644 --- a/internal/hexaicli/run.go +++ b/internal/hexaicli/run.go @@ -88,7 +88,11 @@ func newClientFromConfig(cfg appconfig.App) (llm.Client, error) { if strings.TrimSpace(oaKey) == "" { oaKey = os.Getenv("OPENAI_API_KEY") } - cpKey := os.Getenv("COPILOT_API_KEY") + // Prefer HEXAI_COPILOT_API_KEY; fall back to COPILOT_API_KEY + cpKey := os.Getenv("HEXAI_COPILOT_API_KEY") + if strings.TrimSpace(cpKey) == "" { + cpKey = os.Getenv("COPILOT_API_KEY") + } return llm.NewFromConfig(llmCfg, oaKey, cpKey) } |
