Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '' });
Expand All @@ -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;
}
Loading