multi-agents-cli 1.0.61 → 1.0.63
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/core/workflow/agent.js +99 -4
- package/init.js +30 -0
- package/package.json +1 -1
package/core/workflow/agent.js
CHANGED
|
@@ -172,15 +172,16 @@ const openIDE = (worktreePath) => {
|
|
|
172
172
|
|
|
173
173
|
|
|
174
174
|
// ── Open new OS terminal with Claude Code CLI ───────────────────────────────
|
|
175
|
-
|
|
176
175
|
const openTerminal = (worktreePath) => {
|
|
176
|
+
const termCmd = config.terminal && config.terminal.cmd;
|
|
177
|
+
if (!termCmd) return false;
|
|
177
178
|
try {
|
|
178
179
|
if (process.platform === 'darwin') {
|
|
179
|
-
execSync(
|
|
180
|
+
execSync('osascript -e \'tell app "' + termCmd + '" to do script "cd \\"' + worktreePath + '\\" && claude"\'', { stdio: 'pipe' });
|
|
180
181
|
} else if (process.platform === 'win32') {
|
|
181
|
-
execSync(
|
|
182
|
+
execSync('start ' + termCmd + ' /k "cd /d ' + worktreePath + ' && claude"', { stdio: 'pipe' });
|
|
182
183
|
} else {
|
|
183
|
-
execSync(
|
|
184
|
+
execSync(termCmd + ' -- bash -c "cd \'' + worktreePath + '\' && claude; exec bash" &', { stdio: 'pipe' });
|
|
184
185
|
}
|
|
185
186
|
return true;
|
|
186
187
|
} catch { return false; }
|
|
@@ -1385,6 +1386,100 @@ ${excludedUrls}
|
|
|
1385
1386
|
separator();
|
|
1386
1387
|
console.log(`\n${bold(' Workspace is set up and ready.')}\n`);
|
|
1387
1388
|
|
|
1389
|
+
sessionLoop: while (true) {
|
|
1390
|
+
const sessionIdx = await arrowSelect('How would you like to start the session?', [
|
|
1391
|
+
{ label: `${green('→')} IDE + new terminal ${dim('(Claude Code CLI)')} ${dim('← recommended')}` },
|
|
1392
|
+
{ label: `${green('→')} IDE only` },
|
|
1393
|
+
{ label: `${green('→')} Claude Code CLI only ${dim('(new terminal)')}` },
|
|
1394
|
+
{ label: `${dim('?')} I'll continue from here, where do I start?` },
|
|
1395
|
+
], rl);
|
|
1396
|
+
|
|
1397
|
+
if (sessionIdx === 0) {
|
|
1398
|
+
const openedIDE = openIDE(worktreePath);
|
|
1399
|
+
if (openedIDE) console.log(` ${green('✓')} ${openedIDE} opened`);
|
|
1400
|
+
else console.log(` ${yellow('!')} Could not open IDE - open manually at: ${dim(worktreePath)}`);
|
|
1401
|
+
const termOpened = openTerminal(worktreePath);
|
|
1402
|
+
if (termOpened) console.log(` ${green('✓')} New terminal opened with Claude Code CLI`);
|
|
1403
|
+
else console.log(` ${yellow('!')} Could not open terminal - run ${cyan('claude')} manually in: ${dim(worktreePath)}`);
|
|
1404
|
+
separator();
|
|
1405
|
+
console.log(`\n ${dim('When the agent is done, run:')} ${cyan('npm run complete')}\n`);
|
|
1406
|
+
break sessionLoop;
|
|
1407
|
+
|
|
1408
|
+
} else if (sessionIdx === 1) {
|
|
1409
|
+
const openedIDE = openIDE(worktreePath);
|
|
1410
|
+
if (openedIDE) console.log(` ${green('✓')} ${openedIDE} opened`);
|
|
1411
|
+
else console.log(` ${yellow('!')} Could not open IDE - open manually at: ${dim(worktreePath)}`);
|
|
1412
|
+
separator();
|
|
1413
|
+
console.log(`\n ${dim('Open a NEW Claude Code session and type')} ${cyan('go')} ${dim('to start.')}\n`);
|
|
1414
|
+
console.log(` ${dim('When done, run:')} ${cyan('npm run complete')}\n`);
|
|
1415
|
+
break sessionLoop;
|
|
1416
|
+
|
|
1417
|
+
} else if (sessionIdx === 2) {
|
|
1418
|
+
const termOpened = openTerminal(worktreePath);
|
|
1419
|
+
if (termOpened) console.log(` ${green('✓')} New terminal opened with Claude Code CLI`);
|
|
1420
|
+
else console.log(` ${yellow('!')} Could not open terminal - run ${cyan('claude')} manually in: ${dim(worktreePath)}`);
|
|
1421
|
+
separator();
|
|
1422
|
+
console.log(`\n ${dim('When the agent is done, run:')} ${cyan('npm run complete')}\n`);
|
|
1423
|
+
break sessionLoop;
|
|
1424
|
+
|
|
1425
|
+
} else {
|
|
1426
|
+
separator();
|
|
1427
|
+
const subIdx = await arrowSelect('What would you like to view?', [
|
|
1428
|
+
{ label: 'View instructions' },
|
|
1429
|
+
{ label: 'View folder structure' },
|
|
1430
|
+
{ label: 'View available agents' },
|
|
1431
|
+
{ label: `${dim('←')} Back to session options` },
|
|
1432
|
+
], rl);
|
|
1433
|
+
|
|
1434
|
+
if (subIdx === 3) { continue sessionLoop; }
|
|
1435
|
+
|
|
1436
|
+
if (subIdx === 0) {
|
|
1437
|
+
separator();
|
|
1438
|
+
console.log(`\n ${bold('How to start your agent session:')}\n`);
|
|
1439
|
+
console.log(` ${bold('1.')} Open your IDE at:`);
|
|
1440
|
+
console.log(` ${cyan(worktreePath)}\n`);
|
|
1441
|
+
console.log(` ${bold('2.')} Open a NEW Claude Code session and type ${cyan('go')} to start`);
|
|
1442
|
+
console.log(dim(' Do NOT reuse a previous session.\n'));
|
|
1443
|
+
console.log(` ${bold('3.')} Let the agent run autonomously\n`);
|
|
1444
|
+
console.log(` ${bold('4.')} When done, run: ${cyan('npm run complete')} to merge into main\n`);
|
|
1445
|
+
separator();
|
|
1446
|
+
console.log('');
|
|
1447
|
+
await arrowSelect('Press enter to continue', [{ label: 'OK, got it' }], rl);
|
|
1448
|
+
continue sessionLoop;
|
|
1449
|
+
|
|
1450
|
+
} else if (subIdx === 1) {
|
|
1451
|
+
const framework = config.client?.framework || config.backend?.framework || '';
|
|
1452
|
+
displayWorkspaceTree(worktreeName, worktreePath, project, agent, framework);
|
|
1453
|
+
separator();
|
|
1454
|
+
console.log('');
|
|
1455
|
+
await arrowSelect('Press enter to continue', [{ label: 'OK, got it' }], rl);
|
|
1456
|
+
continue sessionLoop;
|
|
1457
|
+
|
|
1458
|
+
} else if (subIdx === 2) {
|
|
1459
|
+
const allAgents = AGENTS[project] || [];
|
|
1460
|
+
const completed = buildEntries.filter(e => e.scope === project && e.status === 'COMPLETED').map(e => e.agent);
|
|
1461
|
+
separator();
|
|
1462
|
+
console.log(`\n ${bold('Available agents for ' + project + ':')}\n`);
|
|
1463
|
+
allAgents.forEach(a => {
|
|
1464
|
+
const done = completed.includes(a);
|
|
1465
|
+
const current = a === agent;
|
|
1466
|
+
const icon = current ? cyan('→') : done ? green('✓') : dim('·');
|
|
1467
|
+
const label = current ? bold(cyan(a)) : done ? dim(a + ' (completed)') : a;
|
|
1468
|
+
console.log(` ${icon} ${label}`);
|
|
1469
|
+
});
|
|
1470
|
+
console.log('');
|
|
1471
|
+
separator();
|
|
1472
|
+
console.log('');
|
|
1473
|
+
await arrowSelect('Press enter to continue', [{ label: 'OK, got it' }], rl);
|
|
1474
|
+
continue sessionLoop;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
} // end sessionLoop
|
|
1478
|
+
// ── Session start selection ─────────────────────────────────────────────────
|
|
1479
|
+
|
|
1480
|
+
separator();
|
|
1481
|
+
console.log(`\n${bold(' Workspace is set up and ready.')}\n`);
|
|
1482
|
+
|
|
1388
1483
|
const sessionIdx = await arrowSelect('How would you like to start the session?', [
|
|
1389
1484
|
{ label: `${green('→')} IDE + new terminal ${dim('(Claude Code CLI)')} ${dim('← recommended')}` },
|
|
1390
1485
|
{ label: `${green('→')} IDE only` },
|
package/init.js
CHANGED
|
@@ -1013,6 +1013,32 @@ const main = async () => {
|
|
|
1013
1013
|
console.log(dim(' Re-selecting...\n'));
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
|
+
|
|
1017
|
+
// ── Terminal selection ────────────────────────────────────────────────────────
|
|
1018
|
+
|
|
1019
|
+
const TERMINAL_OPTIONS = process.platform === 'darwin'
|
|
1020
|
+
? [
|
|
1021
|
+
{ name: 'Terminal.app', cmd: 'Terminal' },
|
|
1022
|
+
{ name: 'iTerm2', cmd: 'iTerm2' },
|
|
1023
|
+
{ name: 'Warp', cmd: 'Warp' },
|
|
1024
|
+
{ name: 'Other / skip', cmd: null },
|
|
1025
|
+
]
|
|
1026
|
+
: process.platform === 'win32'
|
|
1027
|
+
? [
|
|
1028
|
+
{ name: 'Command Prompt', cmd: 'cmd' },
|
|
1029
|
+
{ name: 'PowerShell', cmd: 'powershell' },
|
|
1030
|
+
{ name: 'Other / skip', cmd: null },
|
|
1031
|
+
]
|
|
1032
|
+
: [
|
|
1033
|
+
{ name: 'gnome-terminal', cmd: 'gnome-terminal' },
|
|
1034
|
+
{ name: 'xterm', cmd: 'xterm' },
|
|
1035
|
+
{ name: 'Other / skip', cmd: null },
|
|
1036
|
+
];
|
|
1037
|
+
|
|
1038
|
+
const termIdx = await arrowSelect('* Preferred terminal (for Claude Code CLI):', TERMINAL_OPTIONS.map(t => ({ label: t.name })), rl);
|
|
1039
|
+
const termChoice = TERMINAL_OPTIONS[termIdx];
|
|
1040
|
+
console.log(` ${green('✓')} ${termChoice.name}`);
|
|
1041
|
+
|
|
1016
1042
|
separator();
|
|
1017
1043
|
|
|
1018
1044
|
// ── Summary ─────────────────────────────────────────────────────────────────
|
|
@@ -1192,6 +1218,10 @@ const main = async () => {
|
|
|
1192
1218
|
orm: backendOrm,
|
|
1193
1219
|
auth: backendAuth,
|
|
1194
1220
|
},
|
|
1221
|
+
terminal: {
|
|
1222
|
+
name: termChoice.name,
|
|
1223
|
+
cmd: termChoice.cmd,
|
|
1224
|
+
},
|
|
1195
1225
|
scaffolded: {
|
|
1196
1226
|
client: false,
|
|
1197
1227
|
backend: false,
|
package/package.json
CHANGED