Simple debug mode for CLI side (#66)

* Adds debug mode config flag.

* Wire through debug lines

* Add debug mode logging example

* Run format

* Run format again
This commit is contained in:
Juliette Love
2025-04-20 20:20:40 +01:00
committed by GitHub
parent 99f5ed9ecb
commit a66ad2e2af
5 changed files with 45 additions and 10 deletions

View File

@@ -13,11 +13,18 @@ export class Config {
private apiKey: string;
private model: string;
private targetDir: string;
private debugMode: boolean;
constructor(apiKey: string, model: string, targetDir: string) {
constructor(
apiKey: string,
model: string,
targetDir: string,
debugMode: boolean,
) {
this.apiKey = apiKey;
this.model = model;
this.targetDir = targetDir;
this.debugMode = debugMode;
}
getApiKey(): string {
@@ -31,6 +38,10 @@ export class Config {
getTargetDir(): string {
return this.targetDir;
}
getDebugMode(): boolean {
return this.debugMode;
}
}
function findEnvFile(startDir: string): string | null {
@@ -60,6 +71,7 @@ export function createServerConfig(
apiKey: string,
model: string,
targetDir: string,
debugMode: boolean,
): Config {
return new Config(apiKey, model, path.resolve(targetDir));
return new Config(apiKey, model, path.resolve(targetDir), debugMode);
}