mirror of
https://github.com/glittercowboy/get-shit-done
synced 2026-04-25 17:25:23 +02:00
fix: use ~/.codeium/windsurf as Windsurf global config dir (#1856)
This commit is contained in:
@@ -160,7 +160,7 @@ npx get-shit-done-cc --cursor --global # Install to ~/.cursor/
|
|||||||
npx get-shit-done-cc --cursor --local # Install to ./.cursor/
|
npx get-shit-done-cc --cursor --local # Install to ./.cursor/
|
||||||
|
|
||||||
# Windsurf
|
# Windsurf
|
||||||
npx get-shit-done-cc --windsurf --global # Install to ~/.windsurf/
|
npx get-shit-done-cc --windsurf --global # Install to ~/.codeium/windsurf/
|
||||||
npx get-shit-done-cc --windsurf --local # Install to ./.windsurf/
|
npx get-shit-done-cc --windsurf --local # Install to ./.windsurf/
|
||||||
|
|
||||||
# Antigravity
|
# Antigravity
|
||||||
|
|||||||
@@ -303,14 +303,14 @@ function getGlobalDir(runtime, explicitDir = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (runtime === 'windsurf') {
|
if (runtime === 'windsurf') {
|
||||||
// Windsurf: --config-dir > WINDSURF_CONFIG_DIR > ~/.windsurf
|
// Windsurf: --config-dir > WINDSURF_CONFIG_DIR > ~/.codeium/windsurf
|
||||||
if (explicitDir) {
|
if (explicitDir) {
|
||||||
return expandTilde(explicitDir);
|
return expandTilde(explicitDir);
|
||||||
}
|
}
|
||||||
if (process.env.WINDSURF_CONFIG_DIR) {
|
if (process.env.WINDSURF_CONFIG_DIR) {
|
||||||
return expandTilde(process.env.WINDSURF_CONFIG_DIR);
|
return expandTilde(process.env.WINDSURF_CONFIG_DIR);
|
||||||
}
|
}
|
||||||
return path.join(os.homedir(), '.windsurf');
|
return path.join(os.homedir(), '.codeium', 'windsurf');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runtime === 'augment') {
|
if (runtime === 'augment') {
|
||||||
@@ -1122,7 +1122,7 @@ function convertClaudeAgentToCursorAgent(content) {
|
|||||||
|
|
||||||
// --- Windsurf converters ---
|
// --- Windsurf converters ---
|
||||||
// Windsurf uses a tool set similar to Cursor.
|
// Windsurf uses a tool set similar to Cursor.
|
||||||
// Config lives in .windsurf/ (local) and ~/.windsurf/ (global).
|
// Config lives in .windsurf/ (local) and ~/.codeium/windsurf/ (global).
|
||||||
|
|
||||||
// Tool name mapping from Claude Code to Windsurf Cascade
|
// Tool name mapping from Claude Code to Windsurf Cascade
|
||||||
const claudeToWindsurfTools = {
|
const claudeToWindsurfTools = {
|
||||||
@@ -3572,7 +3572,7 @@ function copyCommandsAsWindsurfSkills(srcDir, skillsDir, prefix, pathPrefix, run
|
|||||||
const globalClaudeRegex = /~\/\.claude\//g;
|
const globalClaudeRegex = /~\/\.claude\//g;
|
||||||
const globalClaudeHomeRegex = /\$HOME\/\.claude\//g;
|
const globalClaudeHomeRegex = /\$HOME\/\.claude\//g;
|
||||||
const localClaudeRegex = /\.\/\.claude\//g;
|
const localClaudeRegex = /\.\/\.claude\//g;
|
||||||
const windsurfDirRegex = /~\/\.windsurf\//g;
|
const windsurfDirRegex = /~\/\.codeium\/windsurf\//g;
|
||||||
content = content.replace(globalClaudeRegex, pathPrefix);
|
content = content.replace(globalClaudeRegex, pathPrefix);
|
||||||
content = content.replace(globalClaudeHomeRegex, pathPrefix);
|
content = content.replace(globalClaudeHomeRegex, pathPrefix);
|
||||||
content = content.replace(localClaudeRegex, `./${getDirName(runtime)}/`);
|
content = content.replace(localClaudeRegex, `./${getDirName(runtime)}/`);
|
||||||
@@ -5965,7 +5965,7 @@ function promptRuntime(callback) {
|
|||||||
${cyan}8${reset}) Kilo ${dim}(~/.config/kilo)${reset}
|
${cyan}8${reset}) Kilo ${dim}(~/.config/kilo)${reset}
|
||||||
${cyan}9${reset}) OpenCode ${dim}(~/.config/opencode)${reset}
|
${cyan}9${reset}) OpenCode ${dim}(~/.config/opencode)${reset}
|
||||||
${cyan}10${reset}) Trae ${dim}(~/.trae)${reset}
|
${cyan}10${reset}) Trae ${dim}(~/.trae)${reset}
|
||||||
${cyan}11${reset}) Windsurf ${dim}(~/.windsurf)${reset}
|
${cyan}11${reset}) Windsurf ${dim}(~/.codeium/windsurf)${reset}
|
||||||
${cyan}12${reset}) All
|
${cyan}12${reset}) All
|
||||||
|
|
||||||
${dim}Select multiple: 1,2,6 or 1 2 6${reset}
|
${dim}Select multiple: 1,2,6 or 1 2 6${reset}
|
||||||
|
|||||||
52
tests/windsurf-install.test.cjs
Normal file
52
tests/windsurf-install.test.cjs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
process.env.GSD_TEST_MODE = '1';
|
||||||
|
|
||||||
|
const { describe, test, beforeEach, afterEach } = require('node:test');
|
||||||
|
const assert = require('node:assert/strict');
|
||||||
|
const os = require('os');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const { getGlobalDir } = require('../bin/install.js');
|
||||||
|
|
||||||
|
describe('getGlobalDir (Windsurf)', () => {
|
||||||
|
let originalWindsurfConfigDir;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
originalWindsurfConfigDir = process.env.WINDSURF_CONFIG_DIR;
|
||||||
|
delete process.env.WINDSURF_CONFIG_DIR;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
if (originalWindsurfConfigDir !== undefined) {
|
||||||
|
process.env.WINDSURF_CONFIG_DIR = originalWindsurfConfigDir;
|
||||||
|
} else {
|
||||||
|
delete process.env.WINDSURF_CONFIG_DIR;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test('returns ~/.codeium/windsurf with no env var or explicit dir', () => {
|
||||||
|
const result = getGlobalDir('windsurf');
|
||||||
|
assert.strictEqual(result, path.join(os.homedir(), '.codeium', 'windsurf'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('returns explicit dir when provided', () => {
|
||||||
|
const result = getGlobalDir('windsurf', '/custom/windsurf-path');
|
||||||
|
assert.strictEqual(result, '/custom/windsurf-path');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('respects WINDSURF_CONFIG_DIR env var', () => {
|
||||||
|
process.env.WINDSURF_CONFIG_DIR = '~/custom-windsurf';
|
||||||
|
const result = getGlobalDir('windsurf');
|
||||||
|
assert.strictEqual(result, path.join(os.homedir(), 'custom-windsurf'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('explicit dir takes priority over WINDSURF_CONFIG_DIR', () => {
|
||||||
|
process.env.WINDSURF_CONFIG_DIR = '~/from-env';
|
||||||
|
const result = getGlobalDir('windsurf', '/explicit/path');
|
||||||
|
assert.strictEqual(result, '/explicit/path');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('does not break other runtimes', () => {
|
||||||
|
assert.strictEqual(getGlobalDir('claude'), path.join(os.homedir(), '.claude'));
|
||||||
|
assert.strictEqual(getGlobalDir('codex'), path.join(os.homedir(), '.codex'));
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user