set project title

This commit is contained in:
2026-05-27 16:36:44 +10:00
parent a08ca39dbb
commit 741d5d6c06
5 changed files with 26 additions and 5 deletions

View File

@@ -1,10 +1,11 @@
import { join } from 'path'
import { join, basename } from 'path'
import { homedir } from 'os'
import { readFileSync, writeFileSync, mkdirSync } from 'fs'
export interface GlobalConfig {
apiKey?: string
projectPath?: string
projectTitle?: string
fontSize?: number
theme?: 'dark' | 'light'
}
@@ -28,6 +29,9 @@ export const getDraftRoot = (): string =>
export const getApiKey = (): string | undefined =>
_config.apiKey ?? process.env.ANTHROPIC_API_KEY
export const getProjectTitle = (): string =>
_config.projectTitle?.trim() || basename(getDraftRoot())
export function readGlobalConfig(): GlobalConfig {
return { ..._config }
}