diff --git a/src/config.ts b/src/config.ts index cc818ab..b0e5981 100644 --- a/src/config.ts +++ b/src/config.ts @@ -35,8 +35,9 @@ import type { Config } from 'bunfig'; import { loadConfig } from 'bunfig'; import type { PluginInput } from '@opencode-ai/plugin'; -import { join } from 'node:path'; import envPaths from 'env-paths'; +import { homedir } from 'node:os'; +import { join } from 'node:path'; import { PluginConfig } from './types'; export const OpenCodePaths = envPaths('opencode', { suffix: '' }); @@ -61,5 +62,13 @@ export async function getPluginConfig(ctx: PluginInput) { join(ctx.directory, '.opencode', 'skills') // Highest priority: Project-local ); + // Resolve '~' paths in basePaths to absolute paths + resolvedConfig.basePaths = resolvedConfig.basePaths.map((path) => { + if (path.startsWith('~/')) { + return join(homedir(), path.slice(2)); + } + return path; + }); + return resolvedConfig; }