feat(install): add Cline as a first-class runtime (#1991) (#2032)

Cline was documented as a supported runtime but was absent from
bin/install.js. This adds full Cline support:

- Registers --cline CLI flag and adds 'cline' to --all list
- Adds getDirName/getConfigDirFromHome/getGlobalDir entries (CLINE_CONFIG_DIR env var respected)
- Adds convertClaudeToCliineMarkdown() and convertClaudeAgentToClineAgent()
- Wires Cline into copyWithPathReplacement(), install(), writeManifest(), finishInstall()
- Local install writes to project root (like Claude Code), not .cline/ subdirectory
- Generates .clinerules at install root with GSD integration rules
- Installs get-shit-done engine and agents with path/brand replacement
- Adds Cline as option 4 in interactive menu (13-runtime menu, All = 14)
- Updates banner description to include Cline
- Exports convertClaudeToCliineMarkdown and convertClaudeAgentToClineAgent for testing
- Adds tests/cline-install.test.cjs with 17 regression tests
- Updates multi-runtime-select, copilot-install, kilo-install tests for new option numbers

Fixes #1991

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-10 11:47:22 -04:00
committed by GitHub
parent 14c3ef5b1f
commit aa3e9cfaf4
5 changed files with 359 additions and 74 deletions

View File

@@ -0,0 +1,182 @@
/**
* Regression tests for bug #1991
*
* Cline is listed in GSD documentation as a supported runtime but was
* completely absent from bin/install.js. Running `npx get-shit-done-cc`
* did not show Cline as an option in the interactive menu.
*
* Fixed: Cline is now a first-class runtime that:
* - Appears in the interactive menu and --all flag
* - Supports the --cline CLI flag
* - Writes .clinerules to the install directory
* - Installs get-shit-done/ engine with path replacement
*/
'use strict';
process.env.GSD_TEST_MODE = '1';
const { test, describe, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const os = require('node:os');
const { createTempDir, cleanup } = require('./helpers.cjs');
const {
getDirName,
getGlobalDir,
getConfigDirFromHome,
convertClaudeToCliineMarkdown,
install,
} = require('../bin/install.js');
describe('Cline runtime directory mapping', () => {
test('getDirName returns .cline for local installs', () => {
assert.strictEqual(getDirName('cline'), '.cline');
});
test('getGlobalDir returns ~/.cline for global installs', () => {
assert.strictEqual(getGlobalDir('cline'), path.join(os.homedir(), '.cline'));
});
test('getConfigDirFromHome returns .cline fragment', () => {
assert.strictEqual(getConfigDirFromHome('cline', false), "'.cline'");
assert.strictEqual(getConfigDirFromHome('cline', true), "'.cline'");
});
});
describe('getGlobalDir (Cline)', () => {
let originalClineConfigDir;
beforeEach(() => {
originalClineConfigDir = process.env.CLINE_CONFIG_DIR;
});
afterEach(() => {
if (originalClineConfigDir !== undefined) {
process.env.CLINE_CONFIG_DIR = originalClineConfigDir;
} else {
delete process.env.CLINE_CONFIG_DIR;
}
});
test('returns ~/.cline with no env var or explicit dir', () => {
delete process.env.CLINE_CONFIG_DIR;
const result = getGlobalDir('cline');
assert.strictEqual(result, path.join(os.homedir(), '.cline'));
});
test('returns explicit dir when provided', () => {
const result = getGlobalDir('cline', '/custom/cline-path');
assert.strictEqual(result, '/custom/cline-path');
});
test('respects CLINE_CONFIG_DIR env var', () => {
process.env.CLINE_CONFIG_DIR = '~/custom-cline';
const result = getGlobalDir('cline');
assert.strictEqual(result, path.join(os.homedir(), 'custom-cline'));
});
test('explicit dir takes priority over CLINE_CONFIG_DIR', () => {
process.env.CLINE_CONFIG_DIR = '~/from-env';
const result = getGlobalDir('cline', '/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'));
});
});
describe('Cline markdown conversion', () => {
test('convertClaudeToCliineMarkdown exists and is a function', () => {
assert.strictEqual(typeof convertClaudeToCliineMarkdown, 'function');
});
test('replaces Claude Code brand with Cline', () => {
const result = convertClaudeToCliineMarkdown('Use Claude Code to run');
assert.ok(!result.includes('Claude Code'));
assert.ok(result.includes('Cline'));
});
test('replaces .claude/ paths with .cline/', () => {
const result = convertClaudeToCliineMarkdown('See ~/.claude/get-shit-done/');
assert.ok(!result.includes('.claude/'), `Expected no .claude/ in: ${result}`);
assert.ok(result.includes('.cline/'));
});
test('replaces CLAUDE.md references', () => {
const result = convertClaudeToCliineMarkdown('See CLAUDE.md for config');
assert.ok(!result.includes('CLAUDE.md'));
assert.ok(result.includes('.clinerules'));
});
test('replaces .claude/skills/ with .cline/skills/', () => {
const result = convertClaudeToCliineMarkdown('skills at .claude/skills/gsd-executor');
assert.ok(!result.includes('.claude/skills/'));
assert.ok(result.includes('.cline/skills/'));
});
});
describe('Cline install (local)', () => {
let tmpDir;
let previousCwd;
beforeEach(() => {
tmpDir = createTempDir('gsd-cline-test-');
previousCwd = process.cwd();
process.chdir(tmpDir);
});
afterEach(() => {
process.chdir(previousCwd);
cleanup(tmpDir);
});
test('install creates .clinerules file', () => {
install(false, 'cline');
const clinerules = path.join(tmpDir, '.clinerules');
assert.ok(fs.existsSync(clinerules), '.clinerules must exist after cline install');
});
test('.clinerules contains GSD instructions', () => {
install(false, 'cline');
const clinerules = path.join(tmpDir, '.clinerules');
const content = fs.readFileSync(clinerules, 'utf8');
assert.ok(content.includes('GSD') || content.includes('gsd'), '.clinerules must reference GSD');
});
test('install creates get-shit-done engine directory', () => {
install(false, 'cline');
const engineDir = path.join(tmpDir, 'get-shit-done');
assert.ok(fs.existsSync(engineDir), 'get-shit-done directory must exist after install');
});
test('installed engine files have no leaked .claude paths', () => {
install(false, 'cline');
const engineDir = path.join(tmpDir, 'get-shit-done');
if (!fs.existsSync(engineDir)) return; // skip if engine not installed
function scanDir(dir) {
const entries = fs.readdirSync(dir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = path.join(dir, entry.name);
if (entry.isDirectory()) {
scanDir(fullPath);
} else if (entry.name.endsWith('.md') || entry.name.endsWith('.cjs') || entry.name.endsWith('.js')) {
// CHANGELOG.md is a historical record and is not path-converted — skip it
if (entry.name === 'CHANGELOG.md') continue;
const content = fs.readFileSync(fullPath, 'utf8');
// Check for GSD install paths that should have been substituted.
// profile-pipeline.cjs intentionally references ~/.claude/projects (Claude Code
// session data) as a runtime feature — that is not a leaked install path.
const hasLeaked = /~\/\.claude\/(?:get-shit-done|commands|agents|hooks)|HOME\/\.claude\/(?:get-shit-done|commands|agents|hooks)/.test(content);
assert.ok(!hasLeaked, `Found leaked GSD .claude install path in ${fullPath}`);
}
}
}
scanDir(engineDir);
});
});

View File

@@ -139,8 +139,8 @@ describe('Source code integration (Copilot)', () => {
assert.ok(src.includes('--copilot'), 'help text has --copilot option');
});
test('CLI-02: promptRuntime runtimeMap has Copilot as option 6', () => {
assert.ok(src.includes("'6': 'copilot'"), 'runtimeMap has 6 -> copilot');
test('CLI-02: promptRuntime runtimeMap has Copilot as option 7', () => {
assert.ok(src.includes("'7': 'copilot'"), 'runtimeMap has 7 -> copilot');
});
test('CLI-02: promptRuntime allRuntimes array includes copilot', () => {

View File

@@ -221,12 +221,12 @@ describe('Source code integration (Kilo)', () => {
assert.ok(src.includes("'kilo'"), '--all includes kilo runtime');
});
test('promptRuntime runtimeMap has Kilo as option 9', () => {
assert.ok(src.includes("'9': 'kilo'"), 'runtimeMap has 9 -> kilo');
test('promptRuntime runtimeMap has Kilo as option 10', () => {
assert.ok(src.includes("'10': 'kilo'"), 'runtimeMap has 10 -> kilo');
});
test('prompt text shows Kilo above OpenCode without marketing copy', () => {
assert.ok(src.includes('9${reset}) Kilo'), 'prompt lists Kilo as option 9');
assert.ok(src.includes('10${reset}) Kilo'), 'prompt lists Kilo as option 10');
assert.ok(!src.includes('the #1 AI coding platform on OpenRouter'), 'prompt does not include marketing tagline');
});

View File

@@ -21,17 +21,18 @@ const runtimeMap = {
'1': 'claude',
'2': 'antigravity',
'3': 'augment',
'4': 'codebuddy',
'5': 'codex',
'6': 'copilot',
'7': 'cursor',
'8': 'gemini',
'9': 'kilo',
'10': 'opencode',
'11': 'trae',
'12': 'windsurf'
'4': 'cline',
'5': 'codebuddy',
'6': 'codex',
'7': 'copilot',
'8': 'cursor',
'9': 'gemini',
'10': 'kilo',
'11': 'opencode',
'12': 'trae',
'13': 'windsurf'
};
const allRuntimes = ['claude', 'antigravity', 'augment', 'codebuddy', 'codex', 'copilot', 'cursor', 'gemini', 'kilo', 'opencode', 'trae', 'windsurf'];
const allRuntimes = ['claude', 'antigravity', 'augment', 'cline', 'codebuddy', 'codex', 'copilot', 'cursor', 'gemini', 'kilo', 'opencode', 'trae', 'windsurf'];
/**
* Simulate the parsing logic from promptRuntime without requiring readline.
@@ -40,7 +41,7 @@ const allRuntimes = ['claude', 'antigravity', 'augment', 'codebuddy', 'codex', '
function parseRuntimeInput(input) {
input = input.trim() || '1';
if (input === '13') {
if (input === '14') {
return allRuntimes;
}
@@ -61,42 +62,43 @@ describe('multi-runtime selection parsing', () => {
assert.deepStrictEqual(parseRuntimeInput('1'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('2'), ['antigravity']);
assert.deepStrictEqual(parseRuntimeInput('3'), ['augment']);
assert.deepStrictEqual(parseRuntimeInput('4'), ['codebuddy']);
assert.deepStrictEqual(parseRuntimeInput('5'), ['codex']);
assert.deepStrictEqual(parseRuntimeInput('6'), ['copilot']);
assert.deepStrictEqual(parseRuntimeInput('7'), ['cursor']);
assert.deepStrictEqual(parseRuntimeInput('4'), ['cline']);
assert.deepStrictEqual(parseRuntimeInput('5'), ['codebuddy']);
assert.deepStrictEqual(parseRuntimeInput('6'), ['codex']);
assert.deepStrictEqual(parseRuntimeInput('7'), ['copilot']);
assert.deepStrictEqual(parseRuntimeInput('8'), ['cursor']);
});
test('comma-separated choices return multiple runtimes', () => {
assert.deepStrictEqual(parseRuntimeInput('1,6,8'), ['claude', 'copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('1,7,9'), ['claude', 'copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('2,3'), ['antigravity', 'augment']);
assert.deepStrictEqual(parseRuntimeInput('3,5'), ['augment', 'codex']);
assert.deepStrictEqual(parseRuntimeInput('3,6'), ['augment', 'codex']);
});
test('space-separated choices return multiple runtimes', () => {
assert.deepStrictEqual(parseRuntimeInput('1 6 8'), ['claude', 'copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('7 9'), ['cursor', 'kilo']);
assert.deepStrictEqual(parseRuntimeInput('1 7 9'), ['claude', 'copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('8 10'), ['cursor', 'kilo']);
});
test('mixed comma and space separators work', () => {
assert.deepStrictEqual(parseRuntimeInput('1, 6, 8'), ['claude', 'copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('2 , 7'), ['antigravity', 'cursor']);
assert.deepStrictEqual(parseRuntimeInput('1, 7, 9'), ['claude', 'copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('2 , 8'), ['antigravity', 'cursor']);
});
test('single choice for opencode', () => {
assert.deepStrictEqual(parseRuntimeInput('10'), ['opencode']);
assert.deepStrictEqual(parseRuntimeInput('11'), ['opencode']);
});
test('single choice for trae', () => {
assert.deepStrictEqual(parseRuntimeInput('11'), ['trae']);
assert.deepStrictEqual(parseRuntimeInput('12'), ['trae']);
});
test('single choice for windsurf', () => {
assert.deepStrictEqual(parseRuntimeInput('12'), ['windsurf']);
assert.deepStrictEqual(parseRuntimeInput('13'), ['windsurf']);
});
test('choice 13 returns all runtimes', () => {
assert.deepStrictEqual(parseRuntimeInput('13'), allRuntimes);
test('choice 14 returns all runtimes', () => {
assert.deepStrictEqual(parseRuntimeInput('14'), allRuntimes);
});
test('empty input defaults to claude', () => {
@@ -105,29 +107,29 @@ describe('multi-runtime selection parsing', () => {
});
test('invalid choices are ignored, falls back to claude if all invalid', () => {
assert.deepStrictEqual(parseRuntimeInput('14'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('15'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('0'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('abc'), ['claude']);
});
test('invalid choices mixed with valid are filtered out', () => {
assert.deepStrictEqual(parseRuntimeInput('1,14,6'), ['claude', 'copilot']);
assert.deepStrictEqual(parseRuntimeInput('1,15,7'), ['claude', 'copilot']);
assert.deepStrictEqual(parseRuntimeInput('abc 3 xyz'), ['augment']);
});
test('duplicate choices are deduplicated', () => {
assert.deepStrictEqual(parseRuntimeInput('1,1,1'), ['claude']);
assert.deepStrictEqual(parseRuntimeInput('6,6,8,8'), ['copilot', 'gemini']);
assert.deepStrictEqual(parseRuntimeInput('7,7,9,9'), ['copilot', 'gemini']);
});
test('preserves selection order', () => {
assert.deepStrictEqual(parseRuntimeInput('8,1,6'), ['gemini', 'claude', 'copilot']);
assert.deepStrictEqual(parseRuntimeInput('9,2,7'), ['kilo', 'antigravity', 'cursor']);
assert.deepStrictEqual(parseRuntimeInput('9,1,7'), ['gemini', 'claude', 'copilot']);
assert.deepStrictEqual(parseRuntimeInput('10,2,8'), ['kilo', 'antigravity', 'cursor']);
});
});
describe('install.js source contains multi-select support', () => {
test('runtimeMap is defined with all 12 runtimes', () => {
test('runtimeMap is defined with all 13 runtimes', () => {
for (const [key, name] of Object.entries(runtimeMap)) {
assert.ok(
installSrc.includes(`'${key}': '${name}'`),
@@ -144,21 +146,21 @@ describe('install.js source contains multi-select support', () => {
}
});
test('all shortcut uses option 13', () => {
test('all shortcut uses option 14', () => {
assert.ok(
installSrc.includes("if (input === '13')"),
'all shortcut uses option 13'
installSrc.includes("if (input === '14')"),
'all shortcut uses option 14'
);
});
test('prompt lists Trae as option 11 and All as option 13', () => {
test('prompt lists Trae as option 12 and All as option 14', () => {
assert.ok(
installSrc.includes('11${reset}) Trae'),
'prompt lists Trae as option 11'
installSrc.includes('12${reset}) Trae'),
'prompt lists Trae as option 12'
);
assert.ok(
installSrc.includes('13${reset}) All'),
'prompt lists All as option 13'
installSrc.includes('14${reset}) All'),
'prompt lists All as option 14'
);
});