From f82124beef35f4e98b6aa66db5424346b0d8cbc2 Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 24 Jan 2024 16:24:03 +0100 Subject: [PATCH] refactor: use OPENAI_API_KEY instead of OPENAI_KEY --- .env.example | 2 +- .gitignore | 1 + README.md | 2 +- src/config.ts | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 1028f7a..984bf4e 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ OPENAI_MODEL=gpt-3.5-turbo -OPENAI_KEY= +OPENAI_API_KEY= LOG_FILE=/app/helix-gpt.log OPENAI_CONTEXT= diff --git a/.gitignore b/.gitignore index 57bb58e..c728b3b 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,4 @@ out .DS_Store helix-gpt.log +dist/ diff --git a/README.md b/README.md index f70c0c0..9c4cb19 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ You can configure helix-gpt by exposing either the environment variables below, Environment vars ``` OPENAI_MODEL=gpt-3.5-turbo # Optional -OPENAI_KEY=123 # required +OPENAI_API_KEY=123 # required LOG_FILE=/app/debug-helix-gpt.log # Optional OPENAI_CONTEXT="A terrible code completion assistant" # Optional ``` diff --git a/src/config.ts b/src/config.ts index 2aa6d8d..7902af1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,12 +1,12 @@ import { parseArgs } from "util" import { context } from "./constants" -const { values, positionals } = parseArgs({ +const { values } = parseArgs({ args: Bun.argv, options: { openaiKey: { type: 'string', - default: Bun.env.OPENAI_KEY + default: Bun.env.OPENAI_API_KEY }, openaiContext: { type: 'string',