-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcli.ts
More file actions
132 lines (103 loc) · 3.81 KB
/
cli.ts
File metadata and controls
132 lines (103 loc) · 3.81 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env node
import 'reflect-metadata';
import { Command } from 'commander';
import { existsSync, readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { initCommand } from './commands/init.js';
import { runCommand } from './commands/run.js';
import { reviewCommand } from './commands/review.js';
import { qaCommand } from './commands/qa.js';
import { auditCommand } from './commands/audit.js';
import { analyticsCommand } from './commands/analytics.js';
import { installCommand } from './commands/install.js';
import { uninstallCommand } from './commands/uninstall.js';
import { statusCommand } from './commands/status.js';
import { logsCommand } from './commands/logs.js';
import { prdCommand } from './commands/prd.js';
import { dashboardCommand } from './commands/dashboard.js';
import { doctorCommand } from './commands/doctor.js';
import { serveCommand } from './commands/serve.js';
import { historyCommand } from './commands/history.js';
import { updateCommand } from './commands/update.js';
import { prdStateCommand } from './commands/prd-state.js';
import { retryCommand } from './commands/retry.js';
import { prsCommand } from './commands/prs.js';
import { prdsCommand } from './commands/prds.js';
import { cancelCommand } from './commands/cancel.js';
import { sliceCommand } from './commands/slice.js';
import { createStateCommand } from './commands/state.js';
import { boardCommand } from './commands/board.js';
import { queueCommand } from './commands/queue.js';
import { notifyCommand } from './commands/notify.js';
import { summaryCommand } from './commands/summary.js';
// Find the package root (works from both src/ in dev and dist/src/ in production)
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
function findPackageRoot(dir: string): string {
let d = dir;
for (let i = 0; i < 5; i++) {
if (existsSync(join(d, 'package.json'))) return d;
d = dirname(d);
}
return dir;
}
const packageRoot = findPackageRoot(__dirname);
const packageJson = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf-8'));
const program = new Command();
program
.name('night-watch')
.description('Autonomous PRD execution using Claude CLI + cron')
.version(packageJson.version);
// Register init command
initCommand(program);
// Register run command
runCommand(program);
// Register review command
reviewCommand(program);
// Register qa command
qaCommand(program);
// Register audit command
auditCommand(program);
// Register analytics command
analyticsCommand(program);
// Register Phase 5 commands
installCommand(program);
uninstallCommand(program);
statusCommand(program);
logsCommand(program);
// Register prd command
prdCommand(program);
// Register doctor command
doctorCommand(program);
// Register dashboard command
dashboardCommand(program);
// Register serve command
serveCommand(program);
// Register history command (used by bash scripts for cooldown tracking)
historyCommand(program);
// Register update command
updateCommand(program);
// Register prd-state command (used by bash scripts for pending-review state)
prdStateCommand(program);
// Register retry command
retryCommand(program);
// Register prs command
prsCommand(program);
// Register prds command
prdsCommand(program);
// Register cancel command
cancelCommand(program);
// Register slice command (roadmap slicer)
sliceCommand(program);
// Register state command (state management + migration)
program.addCommand(createStateCommand());
// Register board command (GitHub Projects board provider)
boardCommand(program);
// Register queue command (global job queue)
queueCommand(program);
// Register notify command (send notification events from bash scripts)
notifyCommand(program);
// Register summary command (morning briefing)
summaryCommand(program);
program.parse();