support authentication via APIKEY configuration
This commit is contained in:
@@ -4,9 +4,11 @@ import {
|
||||
decrementReferenceCount,
|
||||
} from "./processCheck";
|
||||
import { closeService } from "./close";
|
||||
import { readConfigFile } from ".";
|
||||
|
||||
export async function executeCodeCommand(args: string[] = []) {
|
||||
// Set environment variables
|
||||
const config = await readConfigFile();
|
||||
const env = {
|
||||
...process.env,
|
||||
ANTHROPIC_AUTH_TOKEN: "test",
|
||||
@@ -14,6 +16,11 @@ export async function executeCodeCommand(args: string[] = []) {
|
||||
API_TIMEOUT_MS: "600000",
|
||||
};
|
||||
|
||||
if (config?.APIKEY) {
|
||||
env.ANTHROPIC_API_KEY = config.APIKEY;
|
||||
delete env.ANTHROPIC_AUTH_TOKEN;
|
||||
}
|
||||
|
||||
// Increment reference count when command starts
|
||||
incrementReferenceCount();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user