@nemus-cli/nemus 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +23 -5
- package/bin/workspace.js +12 -0
- package/dist/commands/analyze-deps.js +5 -12
- package/dist/commands/archive.js +13 -18
- package/dist/commands/branch/create.js +5 -12
- package/dist/commands/branch/switch.js +14 -25
- package/dist/commands/cache/manager.js +13 -24
- package/dist/commands/cleanup.js +14 -26
- package/dist/commands/configure-claude.js +4 -8
- package/dist/commands/configure.js +38 -32
- package/dist/commands/dashboard/session-picker.js +19 -26
- package/dist/commands/dashboard/workspace-picker.js +19 -26
- package/dist/commands/delete.js +15 -30
- package/dist/commands/ghq-status.js +7 -12
- package/dist/commands/go.js +18 -27
- package/dist/commands/history.js +6 -13
- package/dist/commands/list.js +20 -29
- package/dist/commands/prune.js +196 -0
- package/dist/commands/remove-repo.js +21 -29
- package/dist/commands/save-context.js +5 -10
- package/dist/commands/sessions.js +19 -25
- package/dist/commands/suite/create.js +27 -53
- package/dist/commands/suite/delete.js +13 -25
- package/dist/commands/suite/export.js +20 -36
- package/dist/commands/suite/import.js +9 -20
- package/dist/commands/suite/use.js +9 -17
- package/dist/program.js +2 -0
- package/dist/utils/prompt.js +26 -0
- package/dist/utils/prompts.js +86 -118
- package/dist/utils/prune.js +70 -0
- package/package.json +3 -6
- package/scripts/release-notes.mjs +54 -0
- package/skills/config.md +17 -0
- package/skills/nemus/SKILL.md +7 -2
- package/skills/nemus/references/completion.md +22 -0
- package/skills/nemus/references/config.md +32 -0
- package/skills/nemus/references/prune.md +44 -0
- package/skills/nemus/references/reflect.md +43 -0
- package/skills/nemus/references/save-context.md +25 -0
- package/skills/prune-workspaces.md +23 -0
- package/skills/reflect.md +21 -0
- package/src/commands/analyze-deps.ts +5 -9
- package/src/commands/archive.ts +5 -7
- package/src/commands/branch/create.ts +5 -9
- package/src/commands/branch/switch.ts +14 -22
- package/src/commands/cache/manager.ts +13 -21
- package/src/commands/cleanup.ts +14 -23
- package/src/commands/configure-claude.ts +4 -5
- package/src/commands/configure.ts +35 -29
- package/src/commands/dashboard/session-picker.ts +6 -11
- package/src/commands/dashboard/workspace-picker.ts +6 -11
- package/src/commands/delete.test.ts +36 -42
- package/src/commands/delete.ts +15 -27
- package/src/commands/ghq-status.ts +5 -7
- package/src/commands/go.ts +18 -25
- package/src/commands/history.ts +6 -10
- package/src/commands/list.test.ts +19 -26
- package/src/commands/list.ts +24 -31
- package/src/commands/prune.ts +183 -0
- package/src/commands/remove-repo.ts +11 -17
- package/src/commands/save-context.ts +3 -5
- package/src/commands/sessions.ts +6 -10
- package/src/commands/suite/create.ts +28 -50
- package/src/commands/suite/delete.ts +14 -23
- package/src/commands/suite/export.ts +20 -33
- package/src/commands/suite/import.ts +9 -17
- package/src/commands/suite/use.ts +9 -14
- package/src/program.ts +2 -0
- package/src/utils/prompt.ts +16 -0
- package/src/utils/prompts.test.ts +70 -41
- package/src/utils/prompts.ts +98 -128
- package/src/utils/prune.test.ts +121 -0
- package/src/utils/prune.ts +109 -0
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerRemoveRepoCommand = registerRemoveRepoCommand;
|
|
40
37
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -44,11 +41,9 @@ const workspace_meta_1 = require("../utils/workspace-meta");
|
|
|
44
41
|
const claude_integration_1 = require("../utils/claude-integration");
|
|
45
42
|
const logger_1 = require("../utils/logger");
|
|
46
43
|
const colors_1 = require("../utils/colors");
|
|
47
|
-
const
|
|
48
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
44
|
+
const prompt_1 = require("../utils/prompt");
|
|
49
45
|
const fuzzy = __importStar(require("fuzzy"));
|
|
50
46
|
const command_helpers_1 = require("../utils/command-helpers");
|
|
51
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
52
47
|
function registerRemoveRepoCommand(parent) {
|
|
53
48
|
parent
|
|
54
49
|
.command('remove-repo')
|
|
@@ -99,10 +94,9 @@ async function handleRemoveRepo(opts) {
|
|
|
99
94
|
(0, logger_1.logSuccess)(`Workspace "${workspaceName}" deleted.`);
|
|
100
95
|
}
|
|
101
96
|
else {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}]);
|
|
97
|
+
const deleteWorkspace = await (0, prompt_1.confirm)({
|
|
98
|
+
message: `Delete the entire workspace folder "${workspaceName}"?`, default: false,
|
|
99
|
+
});
|
|
106
100
|
if (deleteWorkspace) {
|
|
107
101
|
await fs.rm(workspacePath, { recursive: true, force: true });
|
|
108
102
|
(0, logger_1.logSuccess)(`Workspace "${workspaceName}" deleted.`);
|
|
@@ -135,20 +129,19 @@ async function handleRemoveRepo(opts) {
|
|
|
135
129
|
break;
|
|
136
130
|
}
|
|
137
131
|
try {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}]);
|
|
132
|
+
const repoDir = await (0, prompt_1.search)({
|
|
133
|
+
message: `Search and select repository (${(0, colors_1.colorize)(String(selectedDirs.length), 'cyan')} selected):`,
|
|
134
|
+
pageSize: 16,
|
|
135
|
+
source: async (term) => {
|
|
136
|
+
const searchInput = term || '';
|
|
137
|
+
const doneOption = { name: (0, colors_1.colorize)('done - Finish selection', 'green'), value: 'done' };
|
|
138
|
+
if (!searchInput || searchInput.toLowerCase().startsWith('done')) {
|
|
139
|
+
return [doneOption, ...available.map(e => ({ name: e.displayName, value: e.dirName }))];
|
|
140
|
+
}
|
|
141
|
+
const results = fuzzy.filter(searchInput, available, { extract: (e) => e.displayName });
|
|
142
|
+
return [doneOption, ...results.map(result => ({ name: result.original.displayName, value: result.original.dirName }))];
|
|
143
|
+
},
|
|
144
|
+
});
|
|
152
145
|
if (repoDir === 'done') {
|
|
153
146
|
if (selectedDirs.length === 0) {
|
|
154
147
|
console.log((0, colors_1.colorize)('\nYou must select at least one repository\n', 'yellow'));
|
|
@@ -170,11 +163,10 @@ async function handleRemoveRepo(opts) {
|
|
|
170
163
|
selectedDirs.forEach(dir => console.log(` - ${dir}`));
|
|
171
164
|
console.log('');
|
|
172
165
|
if (!opts.yes) {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!confirm) {
|
|
166
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
167
|
+
message: `Remove ${selectedDirs.length} instance(s)? This will delete the directories.`, default: false,
|
|
168
|
+
});
|
|
169
|
+
if (!confirmed) {
|
|
178
170
|
(0, logger_1.logInfo)('Removal cancelled');
|
|
179
171
|
process.exit(0);
|
|
180
172
|
}
|
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerSaveContextCommand = registerSaveContextCommand;
|
|
40
37
|
const path = __importStar(require("path"));
|
|
@@ -44,7 +41,7 @@ const logger_1 = require("../utils/logger");
|
|
|
44
41
|
const colors_1 = require("../utils/colors");
|
|
45
42
|
const workspace_meta_1 = require("../utils/workspace-meta");
|
|
46
43
|
const context_file_1 = require("../utils/context-file");
|
|
47
|
-
const
|
|
44
|
+
const prompt_1 = require("../utils/prompt");
|
|
48
45
|
const CONTEXT_FILENAME = 'CONTEXT.md';
|
|
49
46
|
function registerSaveContextCommand(parent) {
|
|
50
47
|
parent
|
|
@@ -102,12 +99,10 @@ async function resolveWorkspacePath(workspaceName) {
|
|
|
102
99
|
(0, logger_1.logError)('No workspaces found');
|
|
103
100
|
return null;
|
|
104
101
|
}
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
choices: workspaces.map(w => ({ name: w.name, value: w.name })),
|
|
110
|
-
}]);
|
|
102
|
+
const selected = await (0, prompt_1.select)({
|
|
103
|
+
message: 'Select workspace:',
|
|
104
|
+
choices: workspaces.map(w => ({ name: w.name, value: w.name })),
|
|
105
|
+
});
|
|
111
106
|
return { name: selected, path: path.join(config_1.WORKSPACES_DIR, selected) };
|
|
112
107
|
}
|
|
113
108
|
(0, logger_1.logError)('Could not determine workspace. Use --workspace <name> or run from within a workspace.');
|
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerSessionsCommand = registerSessionsCommand;
|
|
40
37
|
const path = __importStar(require("path"));
|
|
@@ -45,10 +42,8 @@ const workspace_meta_1 = require("../utils/workspace-meta");
|
|
|
45
42
|
const logger_1 = require("../utils/logger");
|
|
46
43
|
const output_1 = require("../utils/output");
|
|
47
44
|
const colors_1 = require("../utils/colors");
|
|
48
|
-
const
|
|
49
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
45
|
+
const prompt_1 = require("../utils/prompt");
|
|
50
46
|
const fuzzy = __importStar(require("fuzzy"));
|
|
51
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
52
47
|
const TEMP_FILE = path.join(os.homedir(), '.workspace-last-go');
|
|
53
48
|
const RESUME_FLAG_FILE = path.join(os.homedir(), '.workspace-resume-session');
|
|
54
49
|
function registerSessionsCommand(parent) {
|
|
@@ -111,25 +106,24 @@ async function handleSessions(opts = {}) {
|
|
|
111
106
|
console.log((0, colors_1.colorize)(` ... and ${items.length - 10} more`, 'dim'));
|
|
112
107
|
}
|
|
113
108
|
console.log('');
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}]);
|
|
109
|
+
const selected = await (0, prompt_1.search)({
|
|
110
|
+
message: 'Select workspace to resume:',
|
|
111
|
+
pageSize: 15,
|
|
112
|
+
source: async (term) => {
|
|
113
|
+
const searchInput = term || '';
|
|
114
|
+
const source = items.map(item => ({
|
|
115
|
+
name: `${item.session.workspaceName} ${(0, colors_1.colorize)(item.session.lastActiveLabel, 'dim')} ${(0, colors_1.colorize)(item.repoLabel, 'dim')}`,
|
|
116
|
+
value: item.session,
|
|
117
|
+
}));
|
|
118
|
+
if (!searchInput)
|
|
119
|
+
return source;
|
|
120
|
+
const results = fuzzy.filter(searchInput, items, { extract: (item) => item.session.workspaceName });
|
|
121
|
+
return results.map(result => ({
|
|
122
|
+
name: `${result.original.session.workspaceName} ${(0, colors_1.colorize)(result.original.session.lastActiveLabel, 'dim')} ${(0, colors_1.colorize)(result.original.repoLabel, 'dim')}`,
|
|
123
|
+
value: result.original.session,
|
|
124
|
+
}));
|
|
125
|
+
},
|
|
126
|
+
});
|
|
133
127
|
const session = selected;
|
|
134
128
|
await fs.writeFile(TEMP_FILE, session.workspacePath, 'utf-8');
|
|
135
129
|
// Write JSON with session ID and agent type for correct resume
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
4
|
exports.main = main;
|
|
8
5
|
const github_1 = require("../../utils/github");
|
|
@@ -11,46 +8,31 @@ const workspace_meta_1 = require("../../utils/workspace-meta");
|
|
|
11
8
|
const logger_1 = require("../../utils/logger");
|
|
12
9
|
const colors_1 = require("../../utils/colors");
|
|
13
10
|
const suite_1 = require("../../utils/suite");
|
|
14
|
-
const
|
|
11
|
+
const prompt_1 = require("../../utils/prompt");
|
|
15
12
|
async function promptSuiteDetails(defaultName) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'input',
|
|
27
|
-
name: 'description',
|
|
28
|
-
message: 'Suite description (optional):',
|
|
29
|
-
},
|
|
30
|
-
]);
|
|
13
|
+
const name = (await (0, prompt_1.input)({
|
|
14
|
+
message: 'Suite name:',
|
|
15
|
+
default: defaultName,
|
|
16
|
+
validate: (input) => (0, suite_1.validateSuiteName)(input.trim()),
|
|
17
|
+
})).trim();
|
|
18
|
+
const description = await (0, prompt_1.input)({
|
|
19
|
+
message: 'Suite description (optional):',
|
|
20
|
+
});
|
|
31
21
|
return { name, description: description || '' };
|
|
32
22
|
}
|
|
33
23
|
async function promptPostCloneHooks() {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
message: 'Add post-clone hooks?',
|
|
39
|
-
default: false,
|
|
40
|
-
},
|
|
41
|
-
]);
|
|
24
|
+
const addHooks = await (0, prompt_1.confirm)({
|
|
25
|
+
message: 'Add post-clone hooks?',
|
|
26
|
+
default: false,
|
|
27
|
+
});
|
|
42
28
|
if (!addHooks)
|
|
43
29
|
return undefined;
|
|
44
30
|
const commands = [];
|
|
45
31
|
console.log('Enter commands one at a time. Type "done" when finished.\n');
|
|
46
32
|
while (true) {
|
|
47
|
-
const
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
name: 'command',
|
|
51
|
-
message: `Command ${commands.length + 1} (or "done"):`,
|
|
52
|
-
},
|
|
53
|
-
]);
|
|
33
|
+
const command = await (0, prompt_1.input)({
|
|
34
|
+
message: `Command ${commands.length + 1} (or "done"):`,
|
|
35
|
+
});
|
|
54
36
|
if (command.trim().toLowerCase() === 'done')
|
|
55
37
|
break;
|
|
56
38
|
if (command.trim()) {
|
|
@@ -68,14 +50,10 @@ async function checkOverwrite(name) {
|
|
|
68
50
|
const existing = await (0, suite_1.getSuite)(name);
|
|
69
51
|
if (!existing)
|
|
70
52
|
return true;
|
|
71
|
-
const
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
message: `Suite "${name}" already exists (${existing.entries.length} repos). Overwrite?`,
|
|
76
|
-
default: false,
|
|
77
|
-
},
|
|
78
|
-
]);
|
|
53
|
+
const overwrite = await (0, prompt_1.confirm)({
|
|
54
|
+
message: `Suite "${name}" already exists (${existing.entries.length} repos). Overwrite?`,
|
|
55
|
+
default: false,
|
|
56
|
+
});
|
|
79
57
|
return overwrite;
|
|
80
58
|
}
|
|
81
59
|
async function createInteractive() {
|
|
@@ -182,17 +160,13 @@ async function main() {
|
|
|
182
160
|
console.log((0, colors_1.colorize)('Create Suite', 'bright'));
|
|
183
161
|
console.log('='.repeat(60) + '\n');
|
|
184
162
|
try {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
name: '
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
{ name: 'Save from an existing workspace', value: 'workspace' },
|
|
193
|
-
],
|
|
194
|
-
},
|
|
195
|
-
]);
|
|
163
|
+
const mode = await (0, prompt_1.select)({
|
|
164
|
+
message: 'How would you like to create the suite?',
|
|
165
|
+
choices: [
|
|
166
|
+
{ name: 'Pick repositories interactively', value: 'interactive' },
|
|
167
|
+
{ name: 'Save from an existing workspace', value: 'workspace' },
|
|
168
|
+
],
|
|
169
|
+
});
|
|
196
170
|
if (mode === 'interactive') {
|
|
197
171
|
await createInteractive();
|
|
198
172
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
4
|
exports.main = main;
|
|
8
5
|
const suite_1 = require("../../utils/suite");
|
|
9
6
|
const logger_1 = require("../../utils/logger");
|
|
10
7
|
const colors_1 = require("../../utils/colors");
|
|
11
|
-
const
|
|
8
|
+
const prompt_1 = require("../../utils/prompt");
|
|
12
9
|
async function main() {
|
|
13
10
|
console.log('\n' + '='.repeat(60));
|
|
14
11
|
console.log((0, colors_1.colorize)('Delete Suite', 'bright'));
|
|
@@ -19,27 +16,18 @@ async function main() {
|
|
|
19
16
|
(0, logger_1.logInfo)('No suites found');
|
|
20
17
|
process.exit(0);
|
|
21
18
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
name: '
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]);
|
|
35
|
-
const { confirmed } = await inquirer_1.default.prompt([
|
|
36
|
-
{
|
|
37
|
-
type: 'confirm',
|
|
38
|
-
name: 'confirmed',
|
|
39
|
-
message: `Are you sure you want to delete suite "${suiteName}"?`,
|
|
40
|
-
default: false,
|
|
41
|
-
},
|
|
42
|
-
]);
|
|
19
|
+
const suiteName = await (0, prompt_1.select)({
|
|
20
|
+
message: 'Select a suite to delete:',
|
|
21
|
+
choices: suites.map(s => ({
|
|
22
|
+
name: `${s.name} (${s.entries.length} repos)${s.description ? ` - ${s.description}` : ''}`,
|
|
23
|
+
value: s.name,
|
|
24
|
+
})),
|
|
25
|
+
pageSize: 15,
|
|
26
|
+
});
|
|
27
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
28
|
+
message: `Are you sure you want to delete suite "${suiteName}"?`,
|
|
29
|
+
default: false,
|
|
30
|
+
});
|
|
43
31
|
if (!confirmed) {
|
|
44
32
|
(0, logger_1.logInfo)('Deletion cancelled');
|
|
45
33
|
process.exit(0);
|
|
@@ -33,9 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
37
|
exports.main = main;
|
|
41
38
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -43,7 +40,7 @@ const path = __importStar(require("path"));
|
|
|
43
40
|
const suite_1 = require("../../utils/suite");
|
|
44
41
|
const logger_1 = require("../../utils/logger");
|
|
45
42
|
const colors_1 = require("../../utils/colors");
|
|
46
|
-
const
|
|
43
|
+
const prompt_1 = require("../../utils/prompt");
|
|
47
44
|
async function main(opts) {
|
|
48
45
|
console.log('\n' + '='.repeat(60));
|
|
49
46
|
console.log((0, colors_1.colorize)('Export Suite', 'bright'));
|
|
@@ -54,33 +51,24 @@ async function main(opts) {
|
|
|
54
51
|
(0, logger_1.logInfo)('No suites found');
|
|
55
52
|
process.exit(0);
|
|
56
53
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
name: '
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{ name: 'All suites', value: 'all' },
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
]);
|
|
54
|
+
const mode = await (0, prompt_1.select)({
|
|
55
|
+
message: 'What would you like to export?',
|
|
56
|
+
choices: [
|
|
57
|
+
{ name: 'A single suite', value: 'single' },
|
|
58
|
+
{ name: 'All suites', value: 'all' },
|
|
59
|
+
],
|
|
60
|
+
});
|
|
68
61
|
let data;
|
|
69
62
|
let defaultFilename;
|
|
70
63
|
if (mode === 'single') {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
name: '
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
short: s.name,
|
|
80
|
-
})),
|
|
81
|
-
pageSize: 15,
|
|
82
|
-
},
|
|
83
|
-
]);
|
|
64
|
+
const suiteName = await (0, prompt_1.select)({
|
|
65
|
+
message: 'Select a suite to export:',
|
|
66
|
+
choices: suites.map(s => ({
|
|
67
|
+
name: `${s.name} (${s.entries.length} repos)${s.description ? ` - ${s.description}` : ''}`,
|
|
68
|
+
value: s.name,
|
|
69
|
+
})),
|
|
70
|
+
pageSize: 15,
|
|
71
|
+
});
|
|
84
72
|
data = await (0, suite_1.exportSuite)(suiteName);
|
|
85
73
|
if (!data) {
|
|
86
74
|
(0, logger_1.logError)(`Suite "${suiteName}" not found`);
|
|
@@ -98,14 +86,10 @@ async function main(opts) {
|
|
|
98
86
|
outputPath = path.resolve(outputArg);
|
|
99
87
|
}
|
|
100
88
|
else {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
message: 'Output file path:',
|
|
106
|
-
default: `./${defaultFilename}`,
|
|
107
|
-
},
|
|
108
|
-
]);
|
|
89
|
+
const filePath = await (0, prompt_1.input)({
|
|
90
|
+
message: 'Output file path:',
|
|
91
|
+
default: `./${defaultFilename}`,
|
|
92
|
+
});
|
|
109
93
|
outputPath = path.resolve(filePath);
|
|
110
94
|
}
|
|
111
95
|
await fs.writeFile(outputPath, JSON.stringify(data, null, 2), 'utf-8');
|
|
@@ -33,9 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
37
|
exports.main = main;
|
|
41
38
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -43,7 +40,7 @@ const path = __importStar(require("path"));
|
|
|
43
40
|
const suite_1 = require("../../utils/suite");
|
|
44
41
|
const logger_1 = require("../../utils/logger");
|
|
45
42
|
const colors_1 = require("../../utils/colors");
|
|
46
|
-
const
|
|
43
|
+
const prompt_1 = require("../../utils/prompt");
|
|
47
44
|
async function main(opts) {
|
|
48
45
|
console.log('\n' + '='.repeat(60));
|
|
49
46
|
console.log((0, colors_1.colorize)('Import Suite', 'bright'));
|
|
@@ -55,14 +52,10 @@ async function main(opts) {
|
|
|
55
52
|
filePath = path.resolve(fileArg);
|
|
56
53
|
}
|
|
57
54
|
else {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
message: 'Path to suite JSON file:',
|
|
63
|
-
validate: (input) => input.trim().length > 0 || 'File path is required',
|
|
64
|
-
},
|
|
65
|
-
]);
|
|
55
|
+
const inputPath = await (0, prompt_1.input)({
|
|
56
|
+
message: 'Path to suite JSON file:',
|
|
57
|
+
validate: (input) => input.trim().length > 0 || 'File path is required',
|
|
58
|
+
});
|
|
66
59
|
filePath = path.resolve(inputPath);
|
|
67
60
|
}
|
|
68
61
|
let content;
|
|
@@ -93,14 +86,10 @@ async function main(opts) {
|
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
88
|
console.log('');
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
message: 'Overwrite existing suites with the same name?',
|
|
101
|
-
default: false,
|
|
102
|
-
},
|
|
103
|
-
]);
|
|
89
|
+
const overwrite = await (0, prompt_1.confirm)({
|
|
90
|
+
message: 'Overwrite existing suites with the same name?',
|
|
91
|
+
default: false,
|
|
92
|
+
});
|
|
104
93
|
const result = await (0, suite_1.importSuites)(data, overwrite);
|
|
105
94
|
if (result.imported.length > 0) {
|
|
106
95
|
(0, logger_1.logSuccess)(`Imported: ${result.imported.join(', ')}`);
|
|
@@ -33,9 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
37
|
exports.main = main;
|
|
41
38
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -50,7 +47,7 @@ const logger_1 = require("../../utils/logger");
|
|
|
50
47
|
const colors_1 = require("../../utils/colors");
|
|
51
48
|
const suite_1 = require("../../utils/suite");
|
|
52
49
|
const hooks_1 = require("../../utils/hooks");
|
|
53
|
-
const
|
|
50
|
+
const prompt_1 = require("../../utils/prompt");
|
|
54
51
|
const validation_1 = require("../../utils/validation");
|
|
55
52
|
async function main(opts) {
|
|
56
53
|
console.log('\n' + '='.repeat(60));
|
|
@@ -88,19 +85,14 @@ async function main(opts) {
|
|
|
88
85
|
selectedSuite = found;
|
|
89
86
|
}
|
|
90
87
|
else {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
name: '
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
short: s.name,
|
|
100
|
-
})),
|
|
101
|
-
pageSize: 15,
|
|
102
|
-
},
|
|
103
|
-
]);
|
|
88
|
+
const suite = await (0, prompt_1.select)({
|
|
89
|
+
message: 'Select a suite:',
|
|
90
|
+
choices: suites.map(s => ({
|
|
91
|
+
name: `${s.name} (${s.entries.length} repos)${s.description ? ` - ${s.description}` : ''}`,
|
|
92
|
+
value: s,
|
|
93
|
+
})),
|
|
94
|
+
pageSize: 15,
|
|
95
|
+
});
|
|
104
96
|
selectedSuite = suite;
|
|
105
97
|
}
|
|
106
98
|
console.log(`\n${(0, colors_1.colorize)('Suite repositories:', 'cyan')} ${selectedSuite.entries.length}`);
|
package/dist/program.js
CHANGED
|
@@ -70,6 +70,7 @@ const create_1 = require("./commands/create");
|
|
|
70
70
|
const list_1 = require("./commands/list");
|
|
71
71
|
const update_1 = require("./commands/update");
|
|
72
72
|
const delete_1 = require("./commands/delete");
|
|
73
|
+
const prune_1 = require("./commands/prune");
|
|
73
74
|
const sync_1 = require("./commands/sync");
|
|
74
75
|
const status_1 = require("./commands/status");
|
|
75
76
|
const diff_1 = require("./commands/diff");
|
|
@@ -96,6 +97,7 @@ const reflect_1 = require("./commands/reflect");
|
|
|
96
97
|
(0, list_1.registerListCommand)(exports.program);
|
|
97
98
|
(0, update_1.registerUpdateCommand)(exports.program);
|
|
98
99
|
(0, delete_1.registerDeleteCommand)(exports.program);
|
|
100
|
+
(0, prune_1.registerPruneCommand)(exports.program);
|
|
99
101
|
(0, sync_1.registerSyncCommand)(exports.program);
|
|
100
102
|
(0, status_1.registerStatusCommand)(exports.program);
|
|
101
103
|
(0, diff_1.registerDiffCommand)(exports.program);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Separator = exports.search = exports.password = exports.checkbox = exports.select = exports.input = exports.confirm = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Interactive prompt primitives.
|
|
6
|
+
*
|
|
7
|
+
* We depend on the modular `@inquirer/prompts` (the maintained successor to the
|
|
8
|
+
* classic `inquirer` package and its `inquirer-autocomplete-prompt` plugin).
|
|
9
|
+
* All prompt call sites import from HERE, not from `@inquirer/prompts` directly,
|
|
10
|
+
* so there is a single place to:
|
|
11
|
+
* - centralize the ESM-only package (loaded from our CommonJS build via
|
|
12
|
+
* Node 22's stable `require(esm)` — the CLI requires Node >= 22), and
|
|
13
|
+
* - stub prompts in tests (mock '../utils/prompt').
|
|
14
|
+
*
|
|
15
|
+
* The classic array API (`inquirer.prompt([{ type, name, message }])` returning
|
|
16
|
+
* `{ name: value }`) is replaced by these functions, which take an options
|
|
17
|
+
* object and return the answer VALUE directly.
|
|
18
|
+
*/
|
|
19
|
+
var prompts_1 = require("@inquirer/prompts");
|
|
20
|
+
Object.defineProperty(exports, "confirm", { enumerable: true, get: function () { return prompts_1.confirm; } });
|
|
21
|
+
Object.defineProperty(exports, "input", { enumerable: true, get: function () { return prompts_1.input; } });
|
|
22
|
+
Object.defineProperty(exports, "select", { enumerable: true, get: function () { return prompts_1.select; } });
|
|
23
|
+
Object.defineProperty(exports, "checkbox", { enumerable: true, get: function () { return prompts_1.checkbox; } });
|
|
24
|
+
Object.defineProperty(exports, "password", { enumerable: true, get: function () { return prompts_1.password; } });
|
|
25
|
+
Object.defineProperty(exports, "search", { enumerable: true, get: function () { return prompts_1.search; } });
|
|
26
|
+
Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return prompts_1.Separator; } });
|