Repository navigation
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·70 lines (60 loc) · 1.84 KB
/
Copy pathcli.js
File metadata and controls
executable file
·70 lines (60 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env node
import { initFleet } from './init.js';
const args = process.argv.slice(2);
const help = args.includes('--help') || args.includes('-h');
let pattern = 'team-agent-registry';
let withLoop = null;
let tool = 'grok';
let target = '.';
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (arg === '--pattern' && args[i + 1]) {
pattern = args[++i];
continue;
}
if (arg === '--with-loop' && args[i + 1]) {
withLoop = args[++i];
continue;
}
if (arg === '--tool' && args[i + 1]) {
tool = args[++i];
continue;
}
if (arg === '--help' || arg === '-h') continue;
if (!arg.startsWith('-') && target === '.') {
target = arg;
}
}
if (help) {
console.log(`fleet-init — Scaffold fleet engineering artifacts (v0.3)
Usage:
fleet-init [path] --pattern <id> [--with-loop <loop>] [--tool grok|claude-code|codex]
Patterns:
team-agent-registry (default)
shared-inbox-hitl
hierarchical-delegation
agent-clone-fork
fleet-budget-guard
cross-agent-audit
Loops (--with-loop):
daily-triage, pr-babysitter, issue-triage, changelog-drafter,
dependency-sweeper, post-merge-cleanup
Examples:
fleet-init ~/my-fleet --pattern team-agent-registry
fleet-init . --pattern team-agent-registry --with-loop daily-triage --tool grok
Install: npx @cobusgreyling/fleet-init [path] --pattern <id>
`);
process.exit(0);
}
try {
const result = await initFleet(target, { pattern, withLoop, tool });
console.log(`Fleet scaffold → ${result.dest}`);
console.log(`Pattern: ${result.pattern}`);
if (result.loopPattern) console.log(`Loop: ${result.loopPattern} (${result.loopTool})`);
console.log('Created:');
for (const f of result.created) console.log(` ✓ ${f}`);
console.log(`\nNext: ${result.next}`);
} catch (err) {
console.error(err instanceof Error ? err.message : String(err));
process.exit(1);
}