Skip to content

Commit 2c0f51e

Browse files
authored
Merge pull request #3 from bwl/codex/create-configurable-color-scheme-system
Create configurable color scheme system. default to Forest palette
2 parents 8a68dc7 + dfb3b5a commit 2c0f51e

6 files changed

Lines changed: 363 additions & 170 deletions

File tree

src/cli/commands/config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as clack from '@clack/prompts';
22
import { loadConfig, saveConfig, getConfigPath, type ForestConfig } from '../../lib/config';
3+
import { DEFAULT_COLOR_SCHEME, listColorSchemes } from '../../lib/color-schemes';
34

45
type ClercModule = typeof import('clerc');
56

@@ -229,6 +230,23 @@ async function runConfigWizard() {
229230
newConfig.llmTaggerModel = llmModel;
230231
}
231232

233+
const colorScheme = (await clack.select({
234+
message: 'Color scheme',
235+
options: listColorSchemes().map(({ value, label, description }) => ({
236+
value,
237+
label,
238+
hint: description,
239+
})),
240+
initialValue: currentConfig.colorScheme || DEFAULT_COLOR_SCHEME,
241+
})) as ForestConfig['colorScheme'];
242+
243+
if (clack.isCancel(colorScheme)) {
244+
clack.cancel('Configuration cancelled');
245+
return;
246+
}
247+
248+
newConfig.colorScheme = colorScheme;
249+
232250
// Save config
233251
saveConfig(newConfig);
234252

0 commit comments

Comments
 (0)