@nemus-cli/nemus 0.9.0 → 0.10.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 +18 -0
- package/README.md +10 -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/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/utils/prompt.js +26 -0
- package/dist/utils/prompts.js +86 -118
- package/package.json +3 -6
- 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/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/utils/prompt.ts +16 -0
- package/src/utils/prompts.test.ts +70 -41
- package/src/utils/prompts.ts +98 -128
|
@@ -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}`);
|
|
@@ -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; } });
|