bs9 1.4.6 → 1.5.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.
@@ -0,0 +1,312 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { Command } from "commander";
4
+ import { readFileSync } from "node:fs";
5
+ import { join, dirname } from "node:path";
6
+
7
+ // Read version from package.json
8
+ const packageJsonPath = join(dirname(import.meta.path), '..', 'package.json');
9
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
10
+ const version = packageJson.version;
11
+
12
+ import { startCommand } from "../src/commands/start.js";
13
+ import { stopCommand } from "../src/commands/stop.js";
14
+ import { restartCommand } from "../src/commands/restart.js";
15
+ import { statusCommand } from "../src/commands/status.js";
16
+ import { logsCommand } from "../src/commands/logs.js";
17
+ import { monitCommand } from "../src/commands/monit.js";
18
+ import { webCommand } from "../src/commands/web.js";
19
+ import { alertCommand } from "../src/commands/alert.js";
20
+ import { exportCommand } from "../src/commands/export.js";
21
+ import { depsCommand } from "../src/commands/deps.js";
22
+ import { profileCommand } from "../src/commands/profile.js";
23
+ import { deleteCommand } from "../src/commands/delete.js";
24
+ import { saveCommand } from "../src/commands/save.js";
25
+ import { resurrectCommand } from "../src/commands/resurrect.js";
26
+ import { deployCommand } from "../src/commands/deploy.js";
27
+ import { loadbalancerCommand } from "../src/loadbalancer/manager.js";
28
+ import { windowsCommand } from "../src/windows/service.js";
29
+ import { launchdCommand } from "../src/macos/launchd.js";
30
+ import { updateCommand } from "../src/commands/update.js";
31
+ import { dbpoolCommand } from "../src/database/pool.js";
32
+ import { advancedMonitoringCommand } from "../src/monitoring/advanced.js";
33
+ import { consulCommand } from "../src/discovery/consul.js";
34
+ import { doctorCommand } from "../src/commands/doctor.js";
35
+ import { inspectCommand } from "../src/commands/inspect.js";
36
+ import { startAllServices, stopAllServices, restartAllServices, deleteAllServices, listServices } from "../src/commands/services.js";
37
+
38
+ const program = new Command();
39
+
40
+ program
41
+ .name("bs9")
42
+ .description("BS9 (Bun Sentinel 9) — Mission-critical process manager CLI")
43
+ .version(version);
44
+
45
+ program
46
+ .command("start")
47
+ .description("Start a process with hardened systemd unit")
48
+ .argument("<file>", "Application file to start")
49
+ .option("-n, --name <name>", "Service name")
50
+ .option("-p, --port <port>", "Port number", "3000")
51
+ .option("-h, --host <host>", "Host address", "localhost")
52
+ .option("--https", "Use HTTPS protocol")
53
+ .option("-e, --env <env>", "Environment variables (can be used multiple times)", (value, previous) => [...(previous || []), value])
54
+ .option("--otel", "Enable OpenTelemetry instrumentation", true)
55
+ .option("--prometheus", "Enable Prometheus metrics", true)
56
+ .option("--build", "Build TypeScript to JavaScript before starting")
57
+ .action(startCommand);
58
+
59
+ program
60
+ .command("stop")
61
+ .description("Stop a managed service")
62
+ .argument("<name>", "Service name")
63
+ .action(stopCommand);
64
+
65
+ program
66
+ .command("restart")
67
+ .description("Restart a managed service")
68
+ .argument("<name>", "Service name")
69
+ .action(restartCommand);
70
+
71
+ program
72
+ .command("status")
73
+ .description("Show status and SRE metrics for all services")
74
+ .option("-w, --watch", "Watch mode (refresh every 2s)")
75
+ .action(statusCommand);
76
+
77
+ program
78
+ .command("logs")
79
+ .description("Show logs for a service (via journalctl)")
80
+ .argument("<name>", "Service name")
81
+ .option("-f, --follow", "Follow logs")
82
+ .option("-n, --lines <number>", "Number of lines", "50")
83
+ .action(logsCommand);
84
+
85
+ program
86
+ .command("monit")
87
+ .description("Real-time terminal dashboard for all services")
88
+ .option("-r, --refresh <seconds>", "Refresh interval in seconds", "2")
89
+ .action(monitCommand);
90
+
91
+ program
92
+ .command("web")
93
+ .description("Start web-based monitoring dashboard")
94
+ .option("-p, --port <port>", "Port for web dashboard", "8080")
95
+ .option("-d, --detach", "Run in background")
96
+ .action(webCommand);
97
+
98
+ program
99
+ .command("alert")
100
+ .description("Configure alert thresholds and webhooks")
101
+ .option("--enable", "Enable alerts")
102
+ .option("--disable", "Disable alerts")
103
+ .option("--webhook <url>", "Set webhook URL for alerts")
104
+ .option("--cpu <percentage>", "CPU threshold percentage")
105
+ .option("--memory <percentage>", "Memory threshold percentage")
106
+ .option("--errorRate <percentage>", "Error rate threshold percentage")
107
+ .option("--uptime <percentage>", "Uptime threshold percentage")
108
+ .option("--cooldown <seconds>", "Alert cooldown period in seconds")
109
+ .option("--service <name>", "Configure alerts for specific service")
110
+ .option("--list", "List current alert configuration")
111
+ .option("--test", "Test webhook connectivity")
112
+ .action(alertCommand);
113
+
114
+ program
115
+ .command("export")
116
+ .description("Export historical metrics data")
117
+ .option("-f, --format <format>", "Export format (json|csv)", "json")
118
+ .option("-h, --hours <hours>", "Hours of data to export", "24")
119
+ .option("-o, --output <file>", "Output file path")
120
+ .option("-s, --service <name>", "Export specific service metrics")
121
+ .action(exportCommand);
122
+
123
+ program
124
+ .command("deps")
125
+ .description("Visualize service dependencies")
126
+ .option("-f, --format <format>", "Output format (text|dot|json)", "text")
127
+ .option("-o, --output <file>", "Output file path")
128
+ .action(depsCommand);
129
+
130
+ program
131
+ .command("profile")
132
+ .description("Performance profiling for services")
133
+ .option("-d, --duration <seconds>", "Profiling duration", "60")
134
+ .option("-i, --interval <ms>", "Sampling interval", "1000")
135
+ .option("-s, --service <name>", "Service name to profile")
136
+ .option("--flamegraph", "Generate flame graph")
137
+ .option("--top <number>", "Show top N functions", "10")
138
+ .action(profileCommand);
139
+
140
+ program
141
+ .command("delete")
142
+ .description("Delete managed services")
143
+ .argument("[name]", "Service name (optional)")
144
+ .option("-a, --all", "Delete all services")
145
+ .option("-f, --force", "Force deletion without errors")
146
+ .option("-r, --remove", "Remove service configuration files")
147
+ .option("-t, --timeout <seconds>", "Timeout for graceful shutdown (default: 30)")
148
+ .action(deleteCommand);
149
+
150
+ program
151
+ .command("save")
152
+ .description("Save service configurations to backup")
153
+ .argument("[name]", "Service name (optional)")
154
+ .option("-a, --all", "Save all services")
155
+ .option("-f, --force", "Force save without errors")
156
+ .option("-b, --backup", "Create timestamped backup")
157
+ .action(saveCommand);
158
+
159
+ program
160
+ .command("resurrect")
161
+ .description("Resurrect services from backup")
162
+ .argument("[name]", "Service name (optional)")
163
+ .option("-a, --all", "Resurrect all services")
164
+ .option("-f, --force", "Force resurrection without errors")
165
+ .option("-c, --config <file>", "Configuration file to use")
166
+ .action(resurrectCommand);
167
+
168
+ program
169
+ .command("deploy")
170
+ .description("🚀 Deploy applications with zero-config production setup")
171
+ .argument("<file>", "Application file to deploy")
172
+ .option("-n, --name <name>", "Service name")
173
+ .option("-p, --port <port>", "Port number", "3000")
174
+ .option("-h, --host <host>", "Host address", "localhost")
175
+ .option("-e, --env <env>", "Environment variables (multiple)", (value, previous) => [...(previous || []), value])
176
+ .option("-i, --instances <number>", "Number of instances")
177
+ .option("--memory <memory>", "Memory limit")
178
+ .option("--cpu <cpu>", "CPU limit")
179
+ .option("--log-level <level>", "Log level")
180
+ .option("--log-file <file>", "Log file path")
181
+ .option("--restart <policy>", "Restart policy")
182
+ .option("--no-health", "Skip health check")
183
+ .option("--no-metrics", "Disable metrics")
184
+ .option("--no-otel", "Disable OpenTelemetry")
185
+ .option("--no-prometheus", "Disable Prometheus")
186
+ .option("--https", "Enable HTTPS")
187
+ .option("--no-linger", "Don't enable linger")
188
+ .option("-f, --force", "Force deployment")
189
+ .option("--reload", "Reload existing service")
190
+ .option("--build", "Build TypeScript")
191
+ .action(deployCommand);
192
+
193
+ program
194
+ .command("loadbalancer")
195
+ .description("Load balancer management")
196
+ .argument("<action>", "Action to perform")
197
+ .option("-p, --port <port>", "Load balancer port", "8080")
198
+ .option("-a, --algorithm <type>", "Load balancing algorithm", "round-robin")
199
+ .option("-b, --backends <list>", "Backend servers (host:port,host:port)")
200
+ .option("--health-check", "Enable health checking", true)
201
+ .option("--health-path <path>", "Health check path", "/healthz")
202
+ .option("--health-interval <ms>", "Health check interval", "10000")
203
+ .action(loadbalancerCommand);
204
+
205
+ program
206
+ .command("dbpool")
207
+ .description("Database connection pool management")
208
+ .argument("<action>", "Action to perform")
209
+ .option("--host <host>", "Database host", "localhost")
210
+ .option("--port <port>", "Database port", "5432")
211
+ .option("--database <name>", "Database name", "testdb")
212
+ .option("--username <user>", "Database username", "user")
213
+ .option("--password <pass>", "Database password", "password")
214
+ .option("--max-connections <num>", "Maximum connections", "10")
215
+ .option("--min-connections <num>", "Minimum connections", "2")
216
+ .option("--concurrency <num>", "Test concurrency", "10")
217
+ .option("--iterations <num>", "Test iterations", "100")
218
+ .action(dbpoolCommand);
219
+
220
+ program
221
+ .command("update")
222
+ .description("Update BS9 to latest version")
223
+ .option("--check", "Check for updates without installing")
224
+ .option("--force", "Force update even if already latest")
225
+ .option("--rollback", "Rollback to previous version")
226
+ .option("--version <version>", "Update to specific version")
227
+ .action(updateCommand);
228
+
229
+ program
230
+ .command("advanced")
231
+ .description("Advanced monitoring dashboard")
232
+ .option("--port <port>", "Dashboard port", "8090")
233
+ .action(advancedMonitoringCommand);
234
+
235
+ program
236
+ .command("consul")
237
+ .description("Consul service discovery")
238
+ .argument("<action>", "Action to perform")
239
+ .option("--consul-url <url>", "Consul URL", "http://localhost:8500")
240
+ .option("--name <name>", "Service name")
241
+ .option("--id <id>", "Service ID")
242
+ .option("--address <address>", "Service address")
243
+ .option("--port <port>", "Service port")
244
+ .option("--tags <tags>", "Service tags (comma-separated)")
245
+ .option("--health-check <url>", "Health check URL")
246
+ .option("--meta <json>", "Service metadata (JSON)")
247
+ .option("--service <service>", "Service name for discovery")
248
+ .action(consulCommand);
249
+
250
+ program
251
+ .command("doctor")
252
+ .description("Perform comprehensive health check")
253
+ .option("--check <type>", "Specific check to run (dependencies|configuration|platform)")
254
+ .option("-v, --verbose", "Verbose output with system information")
255
+ .action(doctorCommand);
256
+
257
+ program
258
+ .command("inspect")
259
+ .description("Comprehensive system inspection and analysis")
260
+ .option("--security", "Security inspection only")
261
+ .option("--performance", "Performance inspection only")
262
+ .option("--configuration", "Configuration inspection only")
263
+ .option("--compliance", "Compliance inspection only")
264
+ .option("--full", "Complete system inspection")
265
+ .option("--report <format>", "Export report (json|csv)")
266
+ .option("--deep", "Deep system analysis")
267
+ .option("-v, --verbose", "Verbose output with detailed analysis")
268
+ .action(inspectCommand);
269
+
270
+ program
271
+ .command("services")
272
+ .description("Multi-service management commands")
273
+ .option("--all", "Apply to all services")
274
+ .option("--pattern <pattern>", "Filter services by name pattern")
275
+ .option("--pid <pid>", "Filter services by PID")
276
+ .option("--status <status>", "Filter services by status")
277
+ .option("--force", "Skip confirmation prompts")
278
+ .action(listServices);
279
+
280
+ program
281
+ .command("start-all")
282
+ .description("Start all stopped services")
283
+ .option("--all", "Start all services")
284
+ .option("--pattern <pattern>", "Start services matching pattern")
285
+ .option("--status <status>", "Start services with specific status")
286
+ .action(startAllServices);
287
+
288
+ program
289
+ .command("stop-all")
290
+ .description("Stop all running services")
291
+ .option("--all", "Stop all services")
292
+ .option("--pattern <pattern>", "Stop services matching pattern")
293
+ .option("--pid <pid>", "Stop service by PID")
294
+ .action(stopAllServices);
295
+
296
+ program
297
+ .command("restart-all")
298
+ .description("Restart multiple services")
299
+ .option("--all", "Restart all services")
300
+ .option("--pattern <pattern>", "Restart services matching pattern")
301
+ .option("--status <status>", "Restart services with specific status")
302
+ .action(restartAllServices);
303
+
304
+ program
305
+ .command("delete-all")
306
+ .description("Delete multiple services")
307
+ .option("--all", "Delete all services")
308
+ .option("--pattern <pattern>", "Delete services matching pattern")
309
+ .option("--force", "Skip confirmation prompts")
310
+ .action(deleteAllServices);
311
+
312
+ program.parse();
@@ -0,0 +1,281 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { Command } from "commander";
4
+ import { readFileSync } from "node:fs";
5
+ import { join, dirname } from "node:path";
6
+
7
+ // Read version from package.json
8
+ const packageJsonPath = join(dirname(import.meta.path), '..', 'package.json');
9
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
10
+ const version = packageJson.version;
11
+
12
+ import { startCommand } from "../src/commands/start.js";
13
+ import { stopCommand } from "../src/commands/stop.js";
14
+ import { restartCommand } from "../src/commands/restart.js";
15
+ import { statusCommand } from "../src/commands/status.js";
16
+ import { logsCommand } from "../src/commands/logs.js";
17
+ import { monitCommand } from "../src/commands/monit.js";
18
+ import { webCommand } from "../src/commands/web.js";
19
+ import { alertCommand } from "../src/commands/alert.js";
20
+ import { exportCommand } from "../src/commands/export.js";
21
+ import { depsCommand } from "../src/commands/deps.js";
22
+ import { profileCommand } from "../src/commands/profile.js";
23
+ import { deleteCommand } from "../src/commands/delete.js";
24
+ import { saveCommand } from "../src/commands/save.js";
25
+ import { resurrectCommand } from "../src/commands/resurrect.js";
26
+ import { deployCommand } from "../src/commands/deploy.js";
27
+ import { loadbalancerCommand } from "../src/loadbalancer/manager.js";
28
+ import { windowsCommand } from "../src/windows/service.js";
29
+ import { launchdCommand } from "../src/macos/launchd.js";
30
+ import { updateCommand } from "../src/commands/update.js";
31
+ import { dbpoolCommand } from "../src/database/pool.js";
32
+ import { advancedMonitoringCommand } from "../src/monitoring/advanced.js";
33
+ import { consulCommand } from "../src/discovery/consul.js";
34
+ import { doctorCommand } from "../src/commands/doctor.js";
35
+ import { inspectCommand } from "../src/commands/inspect.js";
36
+ import { servicesCommand } from "../src/commands/services.js";
37
+
38
+ const program = new Command();
39
+
40
+ program
41
+ .name("bs9")
42
+ .description("BS9 (Bun Sentinel 9) — Mission-critical process manager CLI")
43
+ .version(version);
44
+
45
+ program
46
+ .command("start")
47
+ .description("Start a process with hardened systemd unit")
48
+ .argument("<file>", "Application file to start")
49
+ .option("-n, --name <name>", "Service name")
50
+ .option("-p, --port <port>", "Port number", "3000")
51
+ .option("-h, --host <host>", "Host address", "localhost")
52
+ .option("--https", "Use HTTPS protocol")
53
+ .option("-e, --env <env>", "Environment variables (can be used multiple times)", (value, previous) => [...(previous || []), value])
54
+ .option("--otel", "Enable OpenTelemetry instrumentation", true)
55
+ .option("--prometheus", "Enable Prometheus metrics", true)
56
+ .option("--build", "Build TypeScript to JavaScript before starting")
57
+ .action(startCommand);
58
+
59
+ program
60
+ .command("stop")
61
+ .description("Stop a managed service")
62
+ .argument("<name>", "Service name")
63
+ .action(stopCommand);
64
+
65
+ program
66
+ .command("restart")
67
+ .description("Restart a managed service")
68
+ .argument("<name>", "Service name")
69
+ .action(restartCommand);
70
+
71
+ program
72
+ .command("status")
73
+ .description("Show status and SRE metrics for all services")
74
+ .option("-w, --watch", "Watch mode (refresh every 2s)")
75
+ .action(statusCommand);
76
+
77
+ program
78
+ .command("logs")
79
+ .description("Show logs for a service (via journalctl)")
80
+ .argument("<name>", "Service name")
81
+ .option("-f, --follow", "Follow logs")
82
+ .option("-n, --lines <number>", "Number of lines", "50")
83
+ .action(logsCommand);
84
+
85
+ program
86
+ .command("monit")
87
+ .description("Real-time terminal dashboard for all services")
88
+ .option("-r, --refresh <seconds>", "Refresh interval in seconds", "2")
89
+ .action(monitCommand);
90
+
91
+ program
92
+ .command("web")
93
+ .description("Start web-based monitoring dashboard")
94
+ .option("-p, --port <port>", "Port for web dashboard", "8080")
95
+ .option("-d, --detach", "Run in background")
96
+ .action(webCommand);
97
+
98
+ program
99
+ .command("alert")
100
+ .description("Configure alert thresholds and webhooks")
101
+ .option("--enable", "Enable alerts")
102
+ .option("--disable", "Disable alerts")
103
+ .option("--webhook <url>", "Set webhook URL for alerts")
104
+ .option("--cpu <percentage>", "CPU threshold percentage")
105
+ .option("--memory <percentage>", "Memory threshold percentage")
106
+ .option("--errorRate <percentage>", "Error rate threshold percentage")
107
+ .option("--uptime <percentage>", "Uptime threshold percentage")
108
+ .option("--cooldown <seconds>", "Alert cooldown period in seconds")
109
+ .option("--service <name>", "Configure alerts for specific service")
110
+ .option("--list", "List current alert configuration")
111
+ .option("--test", "Test webhook connectivity")
112
+ .action(alertCommand);
113
+
114
+ program
115
+ .command("export")
116
+ .description("Export historical metrics data")
117
+ .option("-f, --format <format>", "Export format (json|csv)", "json")
118
+ .option("-h, --hours <hours>", "Hours of data to export", "24")
119
+ .option("-o, --output <file>", "Output file path")
120
+ .option("-s, --service <name>", "Export specific service metrics")
121
+ .action(exportCommand);
122
+
123
+ program
124
+ .command("deps")
125
+ .description("Visualize service dependencies")
126
+ .option("-f, --format <format>", "Output format (text|dot|json)", "text")
127
+ .option("-o, --output <file>", "Output file path")
128
+ .action(depsCommand);
129
+
130
+ program
131
+ .command("profile")
132
+ .description("Performance profiling for services")
133
+ .option("-d, --duration <seconds>", "Profiling duration", "60")
134
+ .option("-i, --interval <ms>", "Sampling interval", "1000")
135
+ .option("-s, --service <name>", "Service name to profile")
136
+ .option("--flamegraph", "Generate flame graph")
137
+ .option("--top <number>", "Show top N functions", "10")
138
+ .action(profileCommand);
139
+
140
+ program
141
+ .command("delete")
142
+ .description("Delete managed services")
143
+ .argument("[name]", "Service name (optional)")
144
+ .option("-a, --all", "Delete all services")
145
+ .option("-f, --force", "Force deletion without errors")
146
+ .option("-r, --remove", "Remove service configuration files")
147
+ .option("-t, --timeout <seconds>", "Timeout for graceful shutdown (default: 30)")
148
+ .action(deleteCommand);
149
+
150
+ program
151
+ .command("save")
152
+ .description("Save service configurations to backup")
153
+ .argument("[name]", "Service name (optional)")
154
+ .option("-a, --all", "Save all services")
155
+ .option("-f, --force", "Force save without errors")
156
+ .option("-b, --backup", "Create timestamped backup")
157
+ .action(saveCommand);
158
+
159
+ program
160
+ .command("resurrect")
161
+ .description("Resurrect services from backup")
162
+ .argument("[name]", "Service name (optional)")
163
+ .option("-a, --all", "Resurrect all services")
164
+ .option("-f, --force", "Force resurrection without errors")
165
+ .option("-c, --config <file>", "Configuration file to use")
166
+ .action(resurrectCommand);
167
+
168
+ program
169
+ .command("deploy")
170
+ .description("🚀 Deploy applications with zero-config production setup")
171
+ .argument("<file>", "Application file to deploy")
172
+ .option("-n, --name <name>", "Service name")
173
+ .option("-p, --port <port>", "Port number", "3000")
174
+ .option("-h, --host <host>", "Host address", "localhost")
175
+ .option("-e, --env <env>", "Environment variables (multiple)", (value, previous) => [...(previous || []), value])
176
+ .option("-i, --instances <number>", "Number of instances")
177
+ .option("--memory <memory>", "Memory limit")
178
+ .option("--cpu <cpu>", "CPU limit")
179
+ .option("--log-level <level>", "Log level")
180
+ .option("--log-file <file>", "Log file path")
181
+ .option("--restart <policy>", "Restart policy")
182
+ .option("--no-health", "Skip health check")
183
+ .option("--no-metrics", "Disable metrics")
184
+ .option("--no-otel", "Disable OpenTelemetry")
185
+ .option("--no-prometheus", "Disable Prometheus")
186
+ .option("--https", "Enable HTTPS")
187
+ .option("--no-linger", "Don't enable linger")
188
+ .option("-f, --force", "Force deployment")
189
+ .option("--reload", "Reload existing service")
190
+ .option("--build", "Build TypeScript")
191
+ .action(deployCommand);
192
+
193
+ program
194
+ .command("loadbalancer")
195
+ .description("Load balancer management")
196
+ .argument("<action>", "Action to perform")
197
+ .option("-p, --port <port>", "Load balancer port", "8080")
198
+ .option("-a, --algorithm <type>", "Load balancing algorithm", "round-robin")
199
+ .option("-b, --backends <list>", "Backend servers (host:port,host:port)")
200
+ .option("--health-check", "Enable health checking", true)
201
+ .option("--health-path <path>", "Health check path", "/healthz")
202
+ .option("--health-interval <ms>", "Health check interval", "10000")
203
+ .action(loadbalancerCommand);
204
+
205
+ program
206
+ .command("dbpool")
207
+ .description("Database connection pool management")
208
+ .argument("<action>", "Action to perform")
209
+ .option("--host <host>", "Database host", "localhost")
210
+ .option("--port <port>", "Database port", "5432")
211
+ .option("--database <name>", "Database name", "testdb")
212
+ .option("--username <user>", "Database username", "user")
213
+ .option("--password <pass>", "Database password", "password")
214
+ .option("--max-connections <num>", "Maximum connections", "10")
215
+ .option("--min-connections <num>", "Minimum connections", "2")
216
+ .option("--concurrency <num>", "Test concurrency", "10")
217
+ .option("--iterations <num>", "Test iterations", "100")
218
+ .action(dbpoolCommand);
219
+
220
+ program
221
+ .command("update")
222
+ .description("Update BS9 to latest version")
223
+ .option("--check", "Check for updates without installing")
224
+ .option("--force", "Force update even if already latest")
225
+ .option("--rollback", "Rollback to previous version")
226
+ .option("--version <version>", "Update to specific version")
227
+ .action(updateCommand);
228
+
229
+ program
230
+ .command("advanced")
231
+ .description("Advanced monitoring dashboard")
232
+ .option("--port <port>", "Dashboard port", "8090")
233
+ .action(advancedMonitoringCommand);
234
+
235
+ program
236
+ .command("consul")
237
+ .description("Consul service discovery")
238
+ .argument("<action>", "Action to perform")
239
+ .option("--consul-url <url>", "Consul URL", "http://localhost:8500")
240
+ .option("--name <name>", "Service name")
241
+ .option("--id <id>", "Service ID")
242
+ .option("--address <address>", "Service address")
243
+ .option("--port <port>", "Service port")
244
+ .option("--tags <tags>", "Service tags (comma-separated)")
245
+ .option("--health-check <url>", "Health check URL")
246
+ .option("--meta <json>", "Service metadata (JSON)")
247
+ .option("--service <service>", "Service name for discovery")
248
+ .action(consulCommand);
249
+
250
+ program
251
+ .command("doctor")
252
+ .description("Perform comprehensive health check")
253
+ .option("--check <type>", "Specific check to run (dependencies|configuration|platform)")
254
+ .option("-v, --verbose", "Verbose output with system information")
255
+ .action(doctorCommand);
256
+
257
+ program
258
+ .command("inspect")
259
+ .description("Comprehensive system inspection and analysis")
260
+ .option("--security", "Security inspection only")
261
+ .option("--performance", "Performance inspection only")
262
+ .option("--configuration", "Configuration inspection only")
263
+ .option("--compliance", "Compliance inspection only")
264
+ .option("--full", "Complete system inspection")
265
+ .option("--report <format>", "Export report (json|csv)")
266
+ .option("--deep", "Deep system analysis")
267
+ .option("-v, --verbose", "Verbose output with detailed analysis")
268
+ .action(inspectCommand);
269
+
270
+ program
271
+ .command("services")
272
+ .description("Multi-service management operations")
273
+ .argument("<action>", "Action to perform (start|stop|restart|status)")
274
+ .option("--all", "Apply action to all services")
275
+ .option("--filter <pattern>", "Filter services by name pattern")
276
+ .option("--pid <pids>", "Filter services by PID (comma-separated)")
277
+ .option("--group <group>", "Filter services by group")
278
+ .option("-v, --verbose", "Verbose output with detailed information")
279
+ .action(servicesCommand);
280
+
281
+ program.parse();