multi-agents-cli 1.0.27 → 1.0.28
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/init.js +14 -3
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -80,10 +80,20 @@ const red = (s) => `${c.red}${s}${c.reset}`;
|
|
|
80
80
|
|
|
81
81
|
// ── CLI argument handling ─────────────────────────────────────────────────────
|
|
82
82
|
|
|
83
|
-
const args
|
|
83
|
+
const args = process.argv.slice(2);
|
|
84
84
|
const isGlobalCLI = args[0] === 'init' && args[1];
|
|
85
|
+
const isReInit = args[0] === 'init' && !args[1];
|
|
85
86
|
const projectArg = isGlobalCLI ? args[1] : null;
|
|
86
87
|
|
|
88
|
+
if (isReInit) {
|
|
89
|
+
// Re-init from inside project or worktree - self-relocate to repo root
|
|
90
|
+
try {
|
|
91
|
+
const { execSync } = require('child_process');
|
|
92
|
+
const repoRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf8' }).trim();
|
|
93
|
+
process.chdir(repoRoot);
|
|
94
|
+
} catch { /* stay in current directory */ }
|
|
95
|
+
}
|
|
96
|
+
|
|
87
97
|
if (isGlobalCLI) {
|
|
88
98
|
const targetDir = path.resolve(process.cwd(), projectArg);
|
|
89
99
|
|
|
@@ -1137,8 +1147,9 @@ If a dependency is not met:
|
|
|
1137
1147
|
prompts: '^2.4.2',
|
|
1138
1148
|
},
|
|
1139
1149
|
scripts: {
|
|
1140
|
-
|
|
1141
|
-
|
|
1150
|
+
init: 'multi-agents init',
|
|
1151
|
+
agent: 'node .workflow/agent.js',
|
|
1152
|
+
complete: 'node .workflow/complete.js',
|
|
1142
1153
|
},
|
|
1143
1154
|
};
|
|
1144
1155
|
fs.writeFileSync(path.join(ROOT, 'package.json'), JSON.stringify(userPackage, null, 2), 'utf8');
|
package/package.json
CHANGED