import { cosmiconfigSync } from 'cosmiconfig'; import type { Config } from '../types/index.js'; const moduleName = 'grove'; const defaultConfig: Config = { worktreeLocation: '../', projectName: null, quickCommands: { test: 'npm test', lint: 'npm run lint', build: 'npm run build', dev: 'npm run dev' }, autoStart: { claudeCode: true } }; export async function loadConfig(): Promise { const explorer = cosmiconfigSync(moduleName); const result = explorer.search(); if (result) { return { ...defaultConfig, ...result.config as Partial }; } return defaultConfig; }