@claude-flow/cli 3.0.0-alpha.2 → 3.0.0-alpha.21
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/README.md +172 -6
- package/bin/cli.js +0 -0
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +43 -27
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.d.ts +19 -0
- package/dist/src/commands/analyze.d.ts.map +1 -0
- package/dist/src/commands/analyze.js +1823 -0
- package/dist/src/commands/analyze.js.map +1 -0
- package/dist/src/commands/claims.d.ts +10 -0
- package/dist/src/commands/claims.d.ts.map +1 -0
- package/dist/src/commands/claims.js +288 -0
- package/dist/src/commands/claims.js.map +1 -0
- package/dist/src/commands/completions.d.ts +10 -0
- package/dist/src/commands/completions.d.ts.map +1 -0
- package/dist/src/commands/completions.js +539 -0
- package/dist/src/commands/completions.js.map +1 -0
- package/dist/src/commands/config.js +2 -2
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts +8 -0
- package/dist/src/commands/daemon.d.ts.map +1 -0
- package/dist/src/commands/daemon.js +545 -0
- package/dist/src/commands/daemon.js.map +1 -0
- package/dist/src/commands/deployment.d.ts +10 -0
- package/dist/src/commands/deployment.d.ts.map +1 -0
- package/dist/src/commands/deployment.js +289 -0
- package/dist/src/commands/deployment.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +10 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +429 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/embeddings.d.ts +18 -0
- package/dist/src/commands/embeddings.d.ts.map +1 -0
- package/dist/src/commands/embeddings.js +616 -0
- package/dist/src/commands/embeddings.js.map +1 -0
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +252 -35
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +326 -2
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +13 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +52 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/mcp.js +4 -4
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +236 -170
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +1 -1
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts +10 -0
- package/dist/src/commands/neural.d.ts.map +1 -0
- package/dist/src/commands/neural.js +224 -0
- package/dist/src/commands/neural.js.map +1 -0
- package/dist/src/commands/performance.d.ts +10 -0
- package/dist/src/commands/performance.d.ts.map +1 -0
- package/dist/src/commands/performance.js +262 -0
- package/dist/src/commands/performance.js.map +1 -0
- package/dist/src/commands/plugins.d.ts +10 -0
- package/dist/src/commands/plugins.d.ts.map +1 -0
- package/dist/src/commands/plugins.js +280 -0
- package/dist/src/commands/plugins.js.map +1 -0
- package/dist/src/commands/process.d.ts.map +1 -1
- package/dist/src/commands/process.js +95 -20
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/providers.d.ts +10 -0
- package/dist/src/commands/providers.d.ts.map +1 -0
- package/dist/src/commands/providers.js +232 -0
- package/dist/src/commands/providers.js.map +1 -0
- package/dist/src/commands/route.d.ts +16 -0
- package/dist/src/commands/route.d.ts.map +1 -0
- package/dist/src/commands/route.js +603 -0
- package/dist/src/commands/route.js.map +1 -0
- package/dist/src/commands/security.d.ts +10 -0
- package/dist/src/commands/security.d.ts.map +1 -0
- package/dist/src/commands/security.js +261 -0
- package/dist/src/commands/security.js.map +1 -0
- package/dist/src/commands/start.js +2 -2
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +26 -2
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +6 -6
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +63 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +218 -362
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +5 -0
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +22 -12
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +17 -1
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +5 -0
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +350 -14
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +317 -0
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -0
- package/dist/src/mcp-tools/config-tools.d.ts +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +262 -15
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +447 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +80 -15
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +6 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +6 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +157 -9
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.d.ts +8 -0
- package/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/session-tools.js +315 -0
- package/dist/src/mcp-tools/session-tools.js.map +1 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +37 -2
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts +8 -0
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/task-tools.js +302 -0
- package/dist/src/mcp-tools/task-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.js +481 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/dist/src/output.d.ts +16 -0
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +42 -0
- package/dist/src/output.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +277 -0
- package/dist/src/ruvector/ast-analyzer.js.map +1 -0
- package/dist/src/ruvector/coverage-router.d.ts +145 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +451 -0
- package/dist/src/ruvector/coverage-router.js.map +1 -0
- package/dist/src/ruvector/coverage-tools.d.ts +33 -0
- package/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-tools.js +157 -0
- package/dist/src/ruvector/coverage-tools.js.map +1 -0
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +662 -0
- package/dist/src/ruvector/diff-classifier.js.map +1 -0
- package/dist/src/ruvector/graph-analyzer.d.ts +174 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +878 -0
- package/dist/src/ruvector/graph-analyzer.js.map +1 -0
- package/dist/src/ruvector/index.d.ts +27 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +49 -0
- package/dist/src/ruvector/index.js.map +1 -0
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +681 -0
- package/dist/src/ruvector/q-learning-router.js.map +1 -0
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +243 -0
- package/dist/src/ruvector/vector-db.js.map +1 -0
- package/dist/src/services/index.d.ts +7 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +6 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/worker-daemon.d.ts +153 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +567 -0
- package/dist/src/services/worker-daemon.js.map +1 -0
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +200 -0
- package/dist/src/suggest.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -6
- package/.agentic-flow/intelligence.json +0 -16
- package/.claude-flow/metrics/agent-metrics.json +0 -1
- package/.claude-flow/metrics/performance.json +0 -87
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/__tests__/README.md +0 -140
- package/__tests__/TEST_SUMMARY.md +0 -144
- package/__tests__/cli.test.ts +0 -558
- package/__tests__/commands.test.ts +0 -726
- package/__tests__/config-adapter.test.ts +0 -362
- package/__tests__/config-loading.test.ts +0 -106
- package/__tests__/coverage/.tmp/coverage-0.json +0 -1
- package/__tests__/coverage/.tmp/coverage-1.json +0 -1
- package/__tests__/coverage/.tmp/coverage-2.json +0 -1
- package/__tests__/coverage/.tmp/coverage-3.json +0 -1
- package/__tests__/coverage/.tmp/coverage-4.json +0 -1
- package/__tests__/coverage/.tmp/coverage-5.json +0 -1
- package/__tests__/mcp-client.test.ts +0 -480
- package/__tests__/p1-commands.test.ts +0 -1064
- package/docs/CONFIG_LOADING.md +0 -236
- package/docs/IMPLEMENTATION_COMPLETE.md +0 -421
- package/docs/MCP_CLIENT_GUIDE.md +0 -620
- package/docs/REFACTORING_SUMMARY.md +0 -247
- package/src/commands/agent.ts +0 -941
- package/src/commands/config.ts +0 -452
- package/src/commands/hive-mind.ts +0 -762
- package/src/commands/hooks.ts +0 -2603
- package/src/commands/index.ts +0 -115
- package/src/commands/init.ts +0 -597
- package/src/commands/mcp.ts +0 -753
- package/src/commands/memory.ts +0 -1063
- package/src/commands/migrate.ts +0 -447
- package/src/commands/process.ts +0 -617
- package/src/commands/session.ts +0 -891
- package/src/commands/start.ts +0 -457
- package/src/commands/status.ts +0 -705
- package/src/commands/swarm.ts +0 -648
- package/src/commands/task.ts +0 -792
- package/src/commands/workflow.ts +0 -742
- package/src/config-adapter.ts +0 -210
- package/src/index.ts +0 -383
- package/src/infrastructure/in-memory-repositories.ts +0 -310
- package/src/init/claudemd-generator.ts +0 -631
- package/src/init/executor.ts +0 -756
- package/src/init/helpers-generator.ts +0 -628
- package/src/init/index.ts +0 -60
- package/src/init/mcp-generator.ts +0 -83
- package/src/init/settings-generator.ts +0 -274
- package/src/init/statusline-generator.ts +0 -211
- package/src/init/types.ts +0 -447
- package/src/mcp-client.ts +0 -227
- package/src/mcp-server.ts +0 -571
- package/src/mcp-tools/agent-tools.ts +0 -92
- package/src/mcp-tools/config-tools.ts +0 -88
- package/src/mcp-tools/hooks-tools.ts +0 -1819
- package/src/mcp-tools/index.ts +0 -12
- package/src/mcp-tools/memory-tools.ts +0 -89
- package/src/mcp-tools/swarm-tools.ts +0 -69
- package/src/mcp-tools/types.ts +0 -33
- package/src/output.ts +0 -593
- package/src/parser.ts +0 -417
- package/src/prompt.ts +0 -619
- package/src/types.ts +0 -287
- package/tmp.json +0 -0
- package/tsconfig.json +0 -16
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -13
package/src/commands/status.ts
DELETED
|
@@ -1,705 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V3 CLI Status Command
|
|
3
|
-
* System status display for Claude Flow
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { Command, CommandContext, CommandResult } from '../types.js';
|
|
7
|
-
import { output } from '../output.js';
|
|
8
|
-
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
9
|
-
import * as fs from 'fs';
|
|
10
|
-
import * as path from 'path';
|
|
11
|
-
|
|
12
|
-
// Status refresh interval (ms)
|
|
13
|
-
const DEFAULT_WATCH_INTERVAL = 2000;
|
|
14
|
-
|
|
15
|
-
// Check if project is initialized
|
|
16
|
-
function isInitialized(cwd: string): boolean {
|
|
17
|
-
const configPath = path.join(cwd, '.claude-flow', 'config.yaml');
|
|
18
|
-
return fs.existsSync(configPath);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Format uptime
|
|
22
|
-
function formatUptime(ms: number): string {
|
|
23
|
-
const seconds = Math.floor(ms / 1000);
|
|
24
|
-
const minutes = Math.floor(seconds / 60);
|
|
25
|
-
const hours = Math.floor(minutes / 60);
|
|
26
|
-
const days = Math.floor(hours / 24);
|
|
27
|
-
|
|
28
|
-
if (days > 0) {
|
|
29
|
-
return `${days}d ${hours % 24}h ${minutes % 60}m`;
|
|
30
|
-
} else if (hours > 0) {
|
|
31
|
-
return `${hours}h ${minutes % 60}m ${seconds % 60}s`;
|
|
32
|
-
} else if (minutes > 0) {
|
|
33
|
-
return `${minutes}m ${seconds % 60}s`;
|
|
34
|
-
} else {
|
|
35
|
-
return `${seconds}s`;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Format bytes
|
|
40
|
-
function formatBytes(bytes: number): string {
|
|
41
|
-
if (bytes === 0) return '0 B';
|
|
42
|
-
const k = 1024;
|
|
43
|
-
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
44
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
45
|
-
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Get system status data
|
|
49
|
-
async function getSystemStatus(): Promise<{
|
|
50
|
-
initialized: boolean;
|
|
51
|
-
running: boolean;
|
|
52
|
-
swarm: {
|
|
53
|
-
id: string | null;
|
|
54
|
-
topology: string;
|
|
55
|
-
agents: { total: number; active: number; idle: number };
|
|
56
|
-
health: string;
|
|
57
|
-
uptime: number;
|
|
58
|
-
};
|
|
59
|
-
mcp: {
|
|
60
|
-
running: boolean;
|
|
61
|
-
port: number | null;
|
|
62
|
-
transport: string;
|
|
63
|
-
};
|
|
64
|
-
memory: {
|
|
65
|
-
entries: number;
|
|
66
|
-
size: string;
|
|
67
|
-
backend: string;
|
|
68
|
-
performance: { searchTime: number; cacheHitRate: number };
|
|
69
|
-
};
|
|
70
|
-
tasks: {
|
|
71
|
-
total: number;
|
|
72
|
-
pending: number;
|
|
73
|
-
running: number;
|
|
74
|
-
completed: number;
|
|
75
|
-
failed: number;
|
|
76
|
-
};
|
|
77
|
-
performance: {
|
|
78
|
-
cpuUsage: number;
|
|
79
|
-
memoryUsage: number;
|
|
80
|
-
flashAttention: string;
|
|
81
|
-
searchSpeed: string;
|
|
82
|
-
};
|
|
83
|
-
}> {
|
|
84
|
-
try {
|
|
85
|
-
// Get swarm status
|
|
86
|
-
const swarmStatus = await callMCPTool<{
|
|
87
|
-
swarmId: string;
|
|
88
|
-
topology: string;
|
|
89
|
-
agents: { total: number; active: number; idle: number; terminated: number };
|
|
90
|
-
health: string;
|
|
91
|
-
uptime: number;
|
|
92
|
-
}>('swarm/status', { includeMetrics: true });
|
|
93
|
-
|
|
94
|
-
// Get MCP status
|
|
95
|
-
let mcpStatus = { running: false, port: null as number | null, transport: 'stdio' };
|
|
96
|
-
try {
|
|
97
|
-
const mcp = await callMCPTool<{
|
|
98
|
-
running: boolean;
|
|
99
|
-
port: number;
|
|
100
|
-
transport: string;
|
|
101
|
-
}>('mcp/status', {});
|
|
102
|
-
mcpStatus = mcp;
|
|
103
|
-
} catch {
|
|
104
|
-
// MCP not running
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Get memory status
|
|
108
|
-
const memoryStatus = await callMCPTool<{
|
|
109
|
-
entries: number;
|
|
110
|
-
size: number;
|
|
111
|
-
backend: string;
|
|
112
|
-
performance: { avgSearchTime: number; cacheHitRate: number };
|
|
113
|
-
}>('memory/stats', {});
|
|
114
|
-
|
|
115
|
-
// Get task status
|
|
116
|
-
const taskStatus = await callMCPTool<{
|
|
117
|
-
total: number;
|
|
118
|
-
pending: number;
|
|
119
|
-
running: number;
|
|
120
|
-
completed: number;
|
|
121
|
-
failed: number;
|
|
122
|
-
}>('task/summary', {});
|
|
123
|
-
|
|
124
|
-
return {
|
|
125
|
-
initialized: true,
|
|
126
|
-
running: true,
|
|
127
|
-
swarm: {
|
|
128
|
-
id: swarmStatus.swarmId,
|
|
129
|
-
topology: swarmStatus.topology,
|
|
130
|
-
agents: {
|
|
131
|
-
total: swarmStatus.agents.total,
|
|
132
|
-
active: swarmStatus.agents.active,
|
|
133
|
-
idle: swarmStatus.agents.idle
|
|
134
|
-
},
|
|
135
|
-
health: swarmStatus.health,
|
|
136
|
-
uptime: swarmStatus.uptime
|
|
137
|
-
},
|
|
138
|
-
mcp: mcpStatus,
|
|
139
|
-
memory: {
|
|
140
|
-
entries: memoryStatus.entries,
|
|
141
|
-
size: formatBytes(memoryStatus.size),
|
|
142
|
-
backend: memoryStatus.backend,
|
|
143
|
-
performance: {
|
|
144
|
-
searchTime: memoryStatus.performance.avgSearchTime,
|
|
145
|
-
cacheHitRate: memoryStatus.performance.cacheHitRate
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
tasks: taskStatus,
|
|
149
|
-
performance: {
|
|
150
|
-
cpuUsage: Math.random() * 30 + 10, // Simulated
|
|
151
|
-
memoryUsage: Math.random() * 40 + 20, // Simulated
|
|
152
|
-
flashAttention: '2.8x speedup',
|
|
153
|
-
searchSpeed: '150x faster'
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
} catch (error) {
|
|
157
|
-
// System not running
|
|
158
|
-
return {
|
|
159
|
-
initialized: true,
|
|
160
|
-
running: false,
|
|
161
|
-
swarm: {
|
|
162
|
-
id: null,
|
|
163
|
-
topology: 'none',
|
|
164
|
-
agents: { total: 0, active: 0, idle: 0 },
|
|
165
|
-
health: 'stopped',
|
|
166
|
-
uptime: 0
|
|
167
|
-
},
|
|
168
|
-
mcp: { running: false, port: null, transport: 'stdio' },
|
|
169
|
-
memory: {
|
|
170
|
-
entries: 0,
|
|
171
|
-
size: '0 B',
|
|
172
|
-
backend: 'none',
|
|
173
|
-
performance: { searchTime: 0, cacheHitRate: 0 }
|
|
174
|
-
},
|
|
175
|
-
tasks: { total: 0, pending: 0, running: 0, completed: 0, failed: 0 },
|
|
176
|
-
performance: {
|
|
177
|
-
cpuUsage: 0,
|
|
178
|
-
memoryUsage: 0,
|
|
179
|
-
flashAttention: 'N/A',
|
|
180
|
-
searchSpeed: 'N/A'
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Display status in text format
|
|
187
|
-
function displayStatus(status: Awaited<ReturnType<typeof getSystemStatus>>): void {
|
|
188
|
-
output.writeln();
|
|
189
|
-
|
|
190
|
-
// Header with overall status
|
|
191
|
-
const statusIcon = status.running
|
|
192
|
-
? output.success('[RUNNING]')
|
|
193
|
-
: output.warning('[STOPPED]');
|
|
194
|
-
output.writeln(`${output.bold('Claude Flow V3')} ${statusIcon}`);
|
|
195
|
-
output.writeln();
|
|
196
|
-
|
|
197
|
-
// Swarm section
|
|
198
|
-
output.writeln(output.bold('Swarm'));
|
|
199
|
-
if (status.running) {
|
|
200
|
-
output.printTable({
|
|
201
|
-
columns: [
|
|
202
|
-
{ key: 'property', header: 'Property', width: 15 },
|
|
203
|
-
{ key: 'value', header: 'Value', width: 30 }
|
|
204
|
-
],
|
|
205
|
-
data: [
|
|
206
|
-
{ property: 'ID', value: status.swarm.id },
|
|
207
|
-
{ property: 'Topology', value: status.swarm.topology },
|
|
208
|
-
{ property: 'Health', value: formatHealth(status.swarm.health) },
|
|
209
|
-
{ property: 'Uptime', value: formatUptime(status.swarm.uptime) }
|
|
210
|
-
]
|
|
211
|
-
});
|
|
212
|
-
} else {
|
|
213
|
-
output.printInfo(' Swarm not running');
|
|
214
|
-
}
|
|
215
|
-
output.writeln();
|
|
216
|
-
|
|
217
|
-
// Agents section
|
|
218
|
-
output.writeln(output.bold('Agents'));
|
|
219
|
-
output.printTable({
|
|
220
|
-
columns: [
|
|
221
|
-
{ key: 'status', header: 'Status', width: 12 },
|
|
222
|
-
{ key: 'count', header: 'Count', width: 10, align: 'right' }
|
|
223
|
-
],
|
|
224
|
-
data: [
|
|
225
|
-
{ status: 'Active', count: status.swarm.agents.active },
|
|
226
|
-
{ status: 'Idle', count: status.swarm.agents.idle },
|
|
227
|
-
{ status: output.bold('Total'), count: status.swarm.agents.total }
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
output.writeln();
|
|
231
|
-
|
|
232
|
-
// Tasks section
|
|
233
|
-
output.writeln(output.bold('Tasks'));
|
|
234
|
-
output.printTable({
|
|
235
|
-
columns: [
|
|
236
|
-
{ key: 'status', header: 'Status', width: 12 },
|
|
237
|
-
{ key: 'count', header: 'Count', width: 10, align: 'right' }
|
|
238
|
-
],
|
|
239
|
-
data: [
|
|
240
|
-
{ status: 'Pending', count: status.tasks.pending },
|
|
241
|
-
{ status: 'Running', count: status.tasks.running },
|
|
242
|
-
{ status: 'Completed', count: status.tasks.completed },
|
|
243
|
-
{ status: 'Failed', count: status.tasks.failed },
|
|
244
|
-
{ status: output.bold('Total'), count: status.tasks.total }
|
|
245
|
-
]
|
|
246
|
-
});
|
|
247
|
-
output.writeln();
|
|
248
|
-
|
|
249
|
-
// Memory section
|
|
250
|
-
output.writeln(output.bold('Memory'));
|
|
251
|
-
output.printTable({
|
|
252
|
-
columns: [
|
|
253
|
-
{ key: 'property', header: 'Property', width: 18 },
|
|
254
|
-
{ key: 'value', header: 'Value', width: 20, align: 'right' }
|
|
255
|
-
],
|
|
256
|
-
data: [
|
|
257
|
-
{ property: 'Backend', value: status.memory.backend },
|
|
258
|
-
{ property: 'Entries', value: status.memory.entries },
|
|
259
|
-
{ property: 'Size', value: status.memory.size },
|
|
260
|
-
{ property: 'Search Time', value: `${status.memory.performance.searchTime.toFixed(2)}ms` },
|
|
261
|
-
{ property: 'Cache Hit Rate', value: `${(status.memory.performance.cacheHitRate * 100).toFixed(1)}%` }
|
|
262
|
-
]
|
|
263
|
-
});
|
|
264
|
-
output.writeln();
|
|
265
|
-
|
|
266
|
-
// MCP section
|
|
267
|
-
output.writeln(output.bold('MCP Server'));
|
|
268
|
-
if (status.mcp.running) {
|
|
269
|
-
output.printInfo(` Running on port ${status.mcp.port} (${status.mcp.transport})`);
|
|
270
|
-
} else {
|
|
271
|
-
output.printInfo(' Not running');
|
|
272
|
-
}
|
|
273
|
-
output.writeln();
|
|
274
|
-
|
|
275
|
-
// Performance section
|
|
276
|
-
if (status.running) {
|
|
277
|
-
output.writeln(output.bold('V3 Performance Gains'));
|
|
278
|
-
output.printList([
|
|
279
|
-
`Flash Attention: ${output.success(status.performance.flashAttention)}`,
|
|
280
|
-
`Vector Search: ${output.success(status.performance.searchSpeed)}`,
|
|
281
|
-
`CPU Usage: ${status.performance.cpuUsage.toFixed(1)}%`,
|
|
282
|
-
`Memory Usage: ${status.performance.memoryUsage.toFixed(1)}%`
|
|
283
|
-
]);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// Format health status with color
|
|
288
|
-
function formatHealth(health: string): string {
|
|
289
|
-
switch (health) {
|
|
290
|
-
case 'healthy':
|
|
291
|
-
return output.success(health);
|
|
292
|
-
case 'degraded':
|
|
293
|
-
return output.warning(health);
|
|
294
|
-
case 'unhealthy':
|
|
295
|
-
case 'stopped':
|
|
296
|
-
return output.error(health);
|
|
297
|
-
default:
|
|
298
|
-
return health;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// Main status action
|
|
303
|
-
const statusAction = async (ctx: CommandContext): Promise<CommandResult> => {
|
|
304
|
-
const watch = ctx.flags.watch as boolean;
|
|
305
|
-
const interval = (ctx.flags.interval as number) || DEFAULT_WATCH_INTERVAL / 1000;
|
|
306
|
-
const healthCheck = ctx.flags['health-check'] as boolean;
|
|
307
|
-
const cwd = ctx.cwd;
|
|
308
|
-
|
|
309
|
-
// Check initialization
|
|
310
|
-
if (!isInitialized(cwd)) {
|
|
311
|
-
output.printError('Claude Flow is not initialized in this directory');
|
|
312
|
-
output.printInfo('Run "claude-flow init" to initialize');
|
|
313
|
-
return { success: false, exitCode: 1 };
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// Get status
|
|
317
|
-
const status = await getSystemStatus();
|
|
318
|
-
|
|
319
|
-
// Health check mode
|
|
320
|
-
if (healthCheck) {
|
|
321
|
-
return performHealthCheck(status);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// JSON output
|
|
325
|
-
if (ctx.flags.format === 'json') {
|
|
326
|
-
output.printJson(status);
|
|
327
|
-
return { success: true, data: status };
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Watch mode
|
|
331
|
-
if (watch) {
|
|
332
|
-
return watchStatus(interval);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// Single status display
|
|
336
|
-
displayStatus(status);
|
|
337
|
-
|
|
338
|
-
return { success: true, data: status };
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
// Perform health checks
|
|
342
|
-
async function performHealthCheck(
|
|
343
|
-
status: Awaited<ReturnType<typeof getSystemStatus>>
|
|
344
|
-
): Promise<CommandResult> {
|
|
345
|
-
output.writeln();
|
|
346
|
-
output.writeln(output.bold('Health Check'));
|
|
347
|
-
output.writeln();
|
|
348
|
-
|
|
349
|
-
const checks: Array<{ name: string; status: 'pass' | 'fail' | 'warn'; message: string }> = [];
|
|
350
|
-
|
|
351
|
-
// Check if system is running
|
|
352
|
-
checks.push({
|
|
353
|
-
name: 'System Running',
|
|
354
|
-
status: status.running ? 'pass' : 'fail',
|
|
355
|
-
message: status.running ? 'System is running' : 'System is not running'
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
// Check swarm health
|
|
359
|
-
if (status.running) {
|
|
360
|
-
checks.push({
|
|
361
|
-
name: 'Swarm Health',
|
|
362
|
-
status: status.swarm.health === 'healthy' ? 'pass' :
|
|
363
|
-
status.swarm.health === 'degraded' ? 'warn' : 'fail',
|
|
364
|
-
message: `Swarm is ${status.swarm.health}`
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// Check agent count
|
|
368
|
-
checks.push({
|
|
369
|
-
name: 'Agents Available',
|
|
370
|
-
status: status.swarm.agents.active > 0 ? 'pass' :
|
|
371
|
-
status.swarm.agents.idle > 0 ? 'warn' : 'fail',
|
|
372
|
-
message: `${status.swarm.agents.active} active, ${status.swarm.agents.idle} idle`
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
// Check MCP
|
|
376
|
-
checks.push({
|
|
377
|
-
name: 'MCP Server',
|
|
378
|
-
status: status.mcp.running ? 'pass' : 'warn',
|
|
379
|
-
message: status.mcp.running ? `Running on port ${status.mcp.port}` : 'Not running'
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
// Check memory backend
|
|
383
|
-
checks.push({
|
|
384
|
-
name: 'Memory Backend',
|
|
385
|
-
status: status.memory.backend !== 'none' ? 'pass' : 'fail',
|
|
386
|
-
message: `Using ${status.memory.backend} backend`
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
// Check for failed tasks
|
|
390
|
-
const failRate = status.tasks.total > 0
|
|
391
|
-
? status.tasks.failed / status.tasks.total
|
|
392
|
-
: 0;
|
|
393
|
-
checks.push({
|
|
394
|
-
name: 'Task Success Rate',
|
|
395
|
-
status: failRate < 0.05 ? 'pass' : failRate < 0.2 ? 'warn' : 'fail',
|
|
396
|
-
message: `${((1 - failRate) * 100).toFixed(1)}% success rate`
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// Display results
|
|
401
|
-
for (const check of checks) {
|
|
402
|
-
const icon = check.status === 'pass' ? output.success('[PASS]') :
|
|
403
|
-
check.status === 'warn' ? output.warning('[WARN]') :
|
|
404
|
-
output.error('[FAIL]');
|
|
405
|
-
output.writeln(`${icon} ${check.name}: ${check.message}`);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
output.writeln();
|
|
409
|
-
|
|
410
|
-
const passed = checks.filter(c => c.status === 'pass').length;
|
|
411
|
-
const warned = checks.filter(c => c.status === 'warn').length;
|
|
412
|
-
const failed = checks.filter(c => c.status === 'fail').length;
|
|
413
|
-
|
|
414
|
-
if (failed === 0) {
|
|
415
|
-
output.printSuccess(`All checks passed (${passed} passed, ${warned} warnings)`);
|
|
416
|
-
} else {
|
|
417
|
-
output.printError(`Health check failed (${passed} passed, ${warned} warnings, ${failed} failed)`);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return {
|
|
421
|
-
success: failed === 0,
|
|
422
|
-
exitCode: failed > 0 ? 1 : 0,
|
|
423
|
-
data: { checks, summary: { passed, warned, failed } }
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// Watch mode - continuous status updates
|
|
428
|
-
async function watchStatus(intervalSeconds: number): Promise<CommandResult> {
|
|
429
|
-
output.writeln();
|
|
430
|
-
output.writeln(output.bold('Watch Mode'));
|
|
431
|
-
output.writeln(output.dim(`Refreshing every ${intervalSeconds}s. Press Ctrl+C to exit.`));
|
|
432
|
-
output.writeln();
|
|
433
|
-
|
|
434
|
-
const refresh = async () => {
|
|
435
|
-
// Clear screen
|
|
436
|
-
process.stdout.write('\x1b[2J\x1b[H');
|
|
437
|
-
|
|
438
|
-
output.writeln(output.dim(`Last updated: ${new Date().toLocaleTimeString()}`));
|
|
439
|
-
output.writeln();
|
|
440
|
-
|
|
441
|
-
const status = await getSystemStatus();
|
|
442
|
-
displayStatus(status);
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
// Initial display
|
|
446
|
-
await refresh();
|
|
447
|
-
|
|
448
|
-
// Set up interval
|
|
449
|
-
const intervalId = setInterval(refresh, intervalSeconds * 1000);
|
|
450
|
-
|
|
451
|
-
// Handle exit
|
|
452
|
-
return new Promise((resolve) => {
|
|
453
|
-
process.on('SIGINT', () => {
|
|
454
|
-
clearInterval(intervalId);
|
|
455
|
-
output.writeln();
|
|
456
|
-
output.printInfo('Watch mode stopped');
|
|
457
|
-
resolve({ success: true });
|
|
458
|
-
});
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
// Agents subcommand
|
|
463
|
-
const agentsCommand: Command = {
|
|
464
|
-
name: 'agents',
|
|
465
|
-
description: 'Show detailed agent status',
|
|
466
|
-
action: async (ctx: CommandContext): Promise<CommandResult> => {
|
|
467
|
-
try {
|
|
468
|
-
const result = await callMCPTool<{
|
|
469
|
-
agents: Array<{
|
|
470
|
-
id: string;
|
|
471
|
-
type: string;
|
|
472
|
-
status: string;
|
|
473
|
-
task?: string;
|
|
474
|
-
uptime: number;
|
|
475
|
-
metrics: { tasksCompleted: number; successRate: number };
|
|
476
|
-
}>;
|
|
477
|
-
}>('agent/list', { includeMetrics: true, status: 'all' });
|
|
478
|
-
|
|
479
|
-
if (ctx.flags.format === 'json') {
|
|
480
|
-
output.printJson(result);
|
|
481
|
-
return { success: true, data: result };
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
output.writeln();
|
|
485
|
-
output.writeln(output.bold('Agent Status'));
|
|
486
|
-
output.writeln();
|
|
487
|
-
|
|
488
|
-
if (result.agents.length === 0) {
|
|
489
|
-
output.printInfo('No agents running');
|
|
490
|
-
return { success: true, data: result };
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
output.printTable({
|
|
494
|
-
columns: [
|
|
495
|
-
{ key: 'id', header: 'ID', width: 20 },
|
|
496
|
-
{ key: 'type', header: 'Type', width: 12 },
|
|
497
|
-
{ key: 'status', header: 'Status', width: 10 },
|
|
498
|
-
{ key: 'task', header: 'Current Task', width: 25 },
|
|
499
|
-
{ key: 'uptime', header: 'Uptime', width: 12 },
|
|
500
|
-
{ key: 'success', header: 'Success', width: 8 }
|
|
501
|
-
],
|
|
502
|
-
data: result.agents.map(a => ({
|
|
503
|
-
id: a.id,
|
|
504
|
-
type: a.type,
|
|
505
|
-
status: formatHealth(a.status),
|
|
506
|
-
task: a.task || '-',
|
|
507
|
-
uptime: formatUptime(a.uptime),
|
|
508
|
-
success: `${(a.metrics.successRate * 100).toFixed(0)}%`
|
|
509
|
-
}))
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
return { success: true, data: result };
|
|
513
|
-
} catch (error) {
|
|
514
|
-
if (error instanceof MCPClientError) {
|
|
515
|
-
output.printError(`Failed to get agent status: ${error.message}`);
|
|
516
|
-
} else {
|
|
517
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
518
|
-
}
|
|
519
|
-
return { success: false, exitCode: 1 };
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
// Tasks subcommand
|
|
525
|
-
const tasksCommand: Command = {
|
|
526
|
-
name: 'tasks',
|
|
527
|
-
description: 'Show detailed task status',
|
|
528
|
-
action: async (ctx: CommandContext): Promise<CommandResult> => {
|
|
529
|
-
try {
|
|
530
|
-
const result = await callMCPTool<{
|
|
531
|
-
tasks: Array<{
|
|
532
|
-
id: string;
|
|
533
|
-
type: string;
|
|
534
|
-
status: string;
|
|
535
|
-
priority: string;
|
|
536
|
-
agent?: string;
|
|
537
|
-
progress: number;
|
|
538
|
-
createdAt: string;
|
|
539
|
-
}>;
|
|
540
|
-
}>('task/list', { status: 'all', limit: 50 });
|
|
541
|
-
|
|
542
|
-
if (ctx.flags.format === 'json') {
|
|
543
|
-
output.printJson(result);
|
|
544
|
-
return { success: true, data: result };
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
output.writeln();
|
|
548
|
-
output.writeln(output.bold('Task Status'));
|
|
549
|
-
output.writeln();
|
|
550
|
-
|
|
551
|
-
if (result.tasks.length === 0) {
|
|
552
|
-
output.printInfo('No tasks');
|
|
553
|
-
return { success: true, data: result };
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
output.printTable({
|
|
557
|
-
columns: [
|
|
558
|
-
{ key: 'id', header: 'ID', width: 15 },
|
|
559
|
-
{ key: 'type', header: 'Type', width: 15 },
|
|
560
|
-
{ key: 'status', header: 'Status', width: 12 },
|
|
561
|
-
{ key: 'priority', header: 'Priority', width: 10 },
|
|
562
|
-
{ key: 'agent', header: 'Agent', width: 15 },
|
|
563
|
-
{ key: 'progress', header: 'Progress', width: 10 }
|
|
564
|
-
],
|
|
565
|
-
data: result.tasks.map(t => ({
|
|
566
|
-
id: t.id,
|
|
567
|
-
type: t.type,
|
|
568
|
-
status: formatHealth(t.status),
|
|
569
|
-
priority: t.priority,
|
|
570
|
-
agent: t.agent || '-',
|
|
571
|
-
progress: `${t.progress}%`
|
|
572
|
-
}))
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
return { success: true, data: result };
|
|
576
|
-
} catch (error) {
|
|
577
|
-
if (error instanceof MCPClientError) {
|
|
578
|
-
output.printError(`Failed to get task status: ${error.message}`);
|
|
579
|
-
} else {
|
|
580
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
581
|
-
}
|
|
582
|
-
return { success: false, exitCode: 1 };
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
// Memory subcommand
|
|
588
|
-
const memoryCommand: Command = {
|
|
589
|
-
name: 'memory',
|
|
590
|
-
description: 'Show detailed memory status',
|
|
591
|
-
action: async (ctx: CommandContext): Promise<CommandResult> => {
|
|
592
|
-
try {
|
|
593
|
-
const result = await callMCPTool<{
|
|
594
|
-
backend: string;
|
|
595
|
-
entries: number;
|
|
596
|
-
size: number;
|
|
597
|
-
namespaces: Array<{ name: string; entries: number }>;
|
|
598
|
-
performance: {
|
|
599
|
-
avgSearchTime: number;
|
|
600
|
-
avgWriteTime: number;
|
|
601
|
-
cacheHitRate: number;
|
|
602
|
-
hnswEnabled: boolean;
|
|
603
|
-
};
|
|
604
|
-
v3Gains: {
|
|
605
|
-
searchImprovement: string;
|
|
606
|
-
memoryReduction: string;
|
|
607
|
-
};
|
|
608
|
-
}>('memory/detailed-stats', {});
|
|
609
|
-
|
|
610
|
-
if (ctx.flags.format === 'json') {
|
|
611
|
-
output.printJson(result);
|
|
612
|
-
return { success: true, data: result };
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
output.writeln();
|
|
616
|
-
output.writeln(output.bold('Memory Status'));
|
|
617
|
-
output.writeln();
|
|
618
|
-
|
|
619
|
-
output.printTable({
|
|
620
|
-
columns: [
|
|
621
|
-
{ key: 'property', header: 'Property', width: 20 },
|
|
622
|
-
{ key: 'value', header: 'Value', width: 25 }
|
|
623
|
-
],
|
|
624
|
-
data: [
|
|
625
|
-
{ property: 'Backend', value: result.backend },
|
|
626
|
-
{ property: 'Total Entries', value: result.entries.toLocaleString() },
|
|
627
|
-
{ property: 'Storage Size', value: formatBytes(result.size) },
|
|
628
|
-
{ property: 'HNSW Index', value: result.performance.hnswEnabled ? 'Enabled' : 'Disabled' }
|
|
629
|
-
]
|
|
630
|
-
});
|
|
631
|
-
|
|
632
|
-
output.writeln();
|
|
633
|
-
output.writeln(output.bold('Performance'));
|
|
634
|
-
output.printTable({
|
|
635
|
-
columns: [
|
|
636
|
-
{ key: 'metric', header: 'Metric', width: 20 },
|
|
637
|
-
{ key: 'value', header: 'Value', width: 20, align: 'right' }
|
|
638
|
-
],
|
|
639
|
-
data: [
|
|
640
|
-
{ metric: 'Avg Search Time', value: `${result.performance.avgSearchTime.toFixed(2)}ms` },
|
|
641
|
-
{ metric: 'Avg Write Time', value: `${result.performance.avgWriteTime.toFixed(2)}ms` },
|
|
642
|
-
{ metric: 'Cache Hit Rate', value: `${(result.performance.cacheHitRate * 100).toFixed(1)}%` }
|
|
643
|
-
]
|
|
644
|
-
});
|
|
645
|
-
|
|
646
|
-
output.writeln();
|
|
647
|
-
output.writeln(output.bold('V3 Performance Gains'));
|
|
648
|
-
output.printList([
|
|
649
|
-
`Search Speed: ${output.success(result.v3Gains.searchImprovement)}`,
|
|
650
|
-
`Memory Usage: ${output.success(result.v3Gains.memoryReduction)}`
|
|
651
|
-
]);
|
|
652
|
-
|
|
653
|
-
return { success: true, data: result };
|
|
654
|
-
} catch (error) {
|
|
655
|
-
if (error instanceof MCPClientError) {
|
|
656
|
-
output.printError(`Failed to get memory status: ${error.message}`);
|
|
657
|
-
} else {
|
|
658
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
659
|
-
}
|
|
660
|
-
return { success: false, exitCode: 1 };
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
|
|
665
|
-
// Main status command
|
|
666
|
-
export const statusCommand: Command = {
|
|
667
|
-
name: 'status',
|
|
668
|
-
description: 'Show system status',
|
|
669
|
-
subcommands: [agentsCommand, tasksCommand, memoryCommand],
|
|
670
|
-
options: [
|
|
671
|
-
{
|
|
672
|
-
name: 'watch',
|
|
673
|
-
short: 'w',
|
|
674
|
-
description: 'Watch mode - continuously update status',
|
|
675
|
-
type: 'boolean',
|
|
676
|
-
default: false
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
name: 'interval',
|
|
680
|
-
short: 'i',
|
|
681
|
-
description: 'Watch mode update interval in seconds',
|
|
682
|
-
type: 'number',
|
|
683
|
-
default: 2
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
name: 'health-check',
|
|
687
|
-
description: 'Perform health checks and exit',
|
|
688
|
-
type: 'boolean',
|
|
689
|
-
default: false
|
|
690
|
-
}
|
|
691
|
-
],
|
|
692
|
-
examples: [
|
|
693
|
-
{ command: 'claude-flow status', description: 'Show current system status' },
|
|
694
|
-
{ command: 'claude-flow status --watch', description: 'Watch mode with live updates' },
|
|
695
|
-
{ command: 'claude-flow status --watch -i 5', description: 'Watch mode updating every 5 seconds' },
|
|
696
|
-
{ command: 'claude-flow status --health-check', description: 'Run health checks' },
|
|
697
|
-
{ command: 'claude-flow status --json', description: 'Output status as JSON' },
|
|
698
|
-
{ command: 'claude-flow status agents', description: 'Show detailed agent status' },
|
|
699
|
-
{ command: 'claude-flow status tasks', description: 'Show detailed task status' },
|
|
700
|
-
{ command: 'claude-flow status memory', description: 'Show detailed memory status' }
|
|
701
|
-
],
|
|
702
|
-
action: statusAction
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
export default statusCommand;
|