vibecodingmachine-cli 2026.2.20-438 → 2026.2.26-1739

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.
Files changed (101) hide show
  1. package/bin/auth/auth-compliance.js +126 -0
  2. package/bin/cli-program.js +104 -0
  3. package/bin/cli-setup.js +52 -0
  4. package/bin/commands/agent-commands.js +310 -0
  5. package/bin/commands/auto-commands.js +70 -0
  6. package/bin/commands/command-aliases.js +118 -0
  7. package/bin/commands/repo-commands.js +39 -0
  8. package/bin/commands/rui-commands.js +152 -0
  9. package/bin/config/cli-config.js +394 -0
  10. package/bin/init/environment-setup.js +84 -0
  11. package/bin/update/update-checker.js +126 -0
  12. package/bin/vibecodingmachine-new.js +50 -0
  13. package/bin/vibecodingmachine.js +29 -663
  14. package/package.json +8 -2
  15. package/src/commands/agents/add.js +277 -0
  16. package/src/commands/agents/check.js +380 -0
  17. package/src/commands/agents/list.js +471 -0
  18. package/src/commands/agents/remove.js +351 -0
  19. package/src/commands/analyze-file-sizes.js +428 -0
  20. package/src/commands/auto-direct/code-processor.js +282 -0
  21. package/src/commands/auto-direct/file-scanner.js +266 -0
  22. package/src/commands/auto-direct/provider-config.js +178 -0
  23. package/src/commands/auto-direct/provider-manager.js +219 -0
  24. package/src/commands/auto-direct/requirement-manager.js +172 -0
  25. package/src/commands/auto-direct/status-display.js +91 -0
  26. package/src/commands/auto-direct/utils.js +106 -0
  27. package/src/commands/auto-direct.js +875 -488
  28. package/src/commands/auto-execution.js +342 -0
  29. package/src/commands/auto-provider-management.js +102 -0
  30. package/src/commands/auto-requirement-management.js +161 -0
  31. package/src/commands/auto-status-helpers.js +141 -0
  32. package/src/commands/auto.js +105 -5155
  33. package/src/commands/check-compliance.js +536 -0
  34. package/src/commands/continuous-scan.js +119 -0
  35. package/src/commands/ide.js +16 -4
  36. package/src/commands/refactor-file.js +486 -0
  37. package/src/commands/requirements.js +301 -2
  38. package/src/commands/timeout.js +290 -0
  39. package/src/trui/TruiInterface.js +108 -0
  40. package/src/trui/agents/AgentInterface.js +580 -0
  41. package/src/utils/antigravity-installer.js +60 -6
  42. package/src/utils/clarification-actions.js +290 -0
  43. package/src/utils/config.js +123 -2
  44. package/src/utils/first-run.js +5 -5
  45. package/src/utils/ide-handlers.js +212 -0
  46. package/src/utils/interactive/clarification-actions.js +348 -0
  47. package/src/utils/interactive/core-ui.js +265 -0
  48. package/src/utils/interactive/file-backup.js +237 -0
  49. package/src/utils/interactive/file-import-export.js +305 -0
  50. package/src/utils/interactive/file-operations.js +49 -0
  51. package/src/utils/interactive/file-validation.js +276 -0
  52. package/src/utils/interactive/interactive-prompts.js +480 -0
  53. package/src/utils/interactive/requirement-actions.js +127 -0
  54. package/src/utils/interactive/requirement-crud.js +356 -0
  55. package/src/utils/interactive/requirements-navigation.js +286 -0
  56. package/src/utils/interactive.js +390 -3459
  57. package/src/utils/provider-checker/agent-checker.js +250 -0
  58. package/src/utils/provider-checker/agent-runner.js +450 -0
  59. package/src/utils/provider-checker/cli-installer.js +123 -0
  60. package/src/utils/provider-checker/cli-utils.js +15 -0
  61. package/src/utils/provider-checker/format-utils.js +32 -0
  62. package/src/utils/provider-checker/ide-manager.js +72 -0
  63. package/src/utils/provider-checker/ide-utils.js +71 -0
  64. package/src/utils/provider-checker/node-detector.js +56 -0
  65. package/src/utils/provider-checker/node-utils.js +61 -0
  66. package/src/utils/provider-checker/process-spawn.js +22 -0
  67. package/src/utils/provider-checker/process-utils.js +37 -0
  68. package/src/utils/provider-checker/provider-validator.js +160 -0
  69. package/src/utils/provider-checker/quota-checker.js +54 -0
  70. package/src/utils/provider-checker/quota-detector.js +44 -0
  71. package/src/utils/provider-checker/requirements-manager.js +94 -0
  72. package/src/utils/provider-checker/test-requirements.js +95 -0
  73. package/src/utils/provider-checker/time-formatter.js +18 -0
  74. package/src/utils/provider-checker-new.js +14 -0
  75. package/src/utils/provider-checker.js +12 -407
  76. package/src/utils/provider-checkers/ide-manager.js +128 -0
  77. package/src/utils/provider-checkers/node-executable-finder.js +51 -0
  78. package/src/utils/provider-checkers/provider-checker-core.js +172 -0
  79. package/src/utils/provider-checkers/provider-checker-main.js +107 -0
  80. package/src/utils/provider-manager.js +60 -4
  81. package/src/utils/provider-registry.js +26 -3
  82. package/src/utils/provider-utils.js +173 -0
  83. package/src/utils/quota-detectors.js +212 -0
  84. package/src/utils/requirement-action-handlers.js +288 -0
  85. package/src/utils/requirement-actions/clarification-actions.js +229 -0
  86. package/src/utils/requirement-actions/confirmation-prompts.js +93 -0
  87. package/src/utils/requirement-actions/file-operations.js +92 -0
  88. package/src/utils/requirement-actions/helpers.js +40 -0
  89. package/src/utils/requirement-actions/requirement-operations.js +335 -0
  90. package/src/utils/requirement-actions.js +46 -856
  91. package/src/utils/requirement-file-operations.js +259 -0
  92. package/src/utils/requirement-helpers.js +128 -0
  93. package/src/utils/requirement-management.js +279 -0
  94. package/src/utils/requirement-navigation.js +146 -0
  95. package/src/utils/requirement-organization.js +271 -0
  96. package/src/utils/simple-trui.js +75 -1
  97. package/src/utils/trui-navigation.js +28 -2
  98. package/src/utils/trui-req-tree.js +196 -11
  99. package/src/utils/trui-specifications.js +31 -1
  100. package/src/utils/interactive-backup.js +0 -5664
  101. package/src/utils/trui-provider-manager.js +0 -182
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Command aliases and shortcuts for CLI
3
+ */
4
+
5
+ const { program } = require('commander');
6
+
7
+ /**
8
+ * Setup command aliases
9
+ */
10
+ function setupCommandAliases() {
11
+ // Agent list aliases
12
+ program
13
+ .command('la')
14
+ .description('Alias for "agents:list"')
15
+ .action(async (options) => {
16
+ const { listAgents } = require('../../src/commands/agents/list');
17
+ const listCommand = new listAgents(options);
18
+ await listCommand.execute();
19
+ });
20
+
21
+ program
22
+ .command('li')
23
+ .description('Alias for "agents:list"')
24
+ .action(async (options) => {
25
+ const { listAgents } = require('../../src/commands/agents/list');
26
+ const listCommand = new listAgents(options);
27
+ await listCommand.execute();
28
+ });
29
+
30
+ // Agents check aliases
31
+ program
32
+ .command('ch')
33
+ .description('Alias for "agents:check"')
34
+ .action(async (options) => {
35
+ const agentsCheckModule = require('../../src/commands/agents-check');
36
+ await agentsCheckModule(options);
37
+ });
38
+
39
+ program
40
+ .command('ca')
41
+ .description('Alias for "agents:check"')
42
+ .action(async (options) => {
43
+ const agentsCheckModule = require('../../src/commands/agents-check');
44
+ await agentsCheckModule(options);
45
+ });
46
+
47
+ program
48
+ .command('!/1')
49
+ .description('Check agents (shortcut for first agent)')
50
+ .action(async (options) => {
51
+ const agentsCheckModule = require('../../src/commands/agents-check');
52
+ await agentsCheckModule(options);
53
+ });
54
+
55
+ // Agent get alias
56
+ program
57
+ .command('ge <agent-id>')
58
+ .description('Alias for "agents:get"')
59
+ .action(async (agentId, options) => {
60
+ const AgentResponseFormatter = require('../../src/commands/AgentResponseFormatter');
61
+ const { AgentCommands } = require('../../../core/src/rui/commands/AgentCommands');
62
+ const AgentConfigManager = require('../../../core/src/agents/config/AgentConfigManager');
63
+ const AgentLogger = require('../../../core/src/agents/logging/AgentLogger');
64
+ const FileManager = require('../../../core/src/agents/storage/FileManager');
65
+
66
+ const agentCommands = new AgentCommands({
67
+ configManager: new AgentConfigManager(),
68
+ logger: new AgentLogger(),
69
+ fileManager: new FileManager()
70
+ });
71
+
72
+ const result = await agentCommands.getAgent(agentId, options);
73
+ const formatter = new AgentResponseFormatter();
74
+ formatter.formatAndDisplay(result, options);
75
+ });
76
+
77
+ // Agent enable alias
78
+ program
79
+ .command('en <agent-id>')
80
+ .description('Alias for "agents:enable"')
81
+ .action(async (agentId) => {
82
+ const { AgentCommands } = require('../../../core/src/rui/commands/AgentCommands');
83
+ const AgentConfigManager = require('../../../core/src/agents/config/AgentConfigManager');
84
+ const AgentLogger = require('../../../core/src/agents/logging/AgentLogger');
85
+ const FileManager = require('../../../core/src/agents/storage/FileManager');
86
+
87
+ const agentCommands = new AgentCommands({
88
+ configManager: new AgentConfigManager(),
89
+ logger: new AgentLogger(),
90
+ fileManager: new FileManager()
91
+ });
92
+
93
+ await agentCommands.enableAgent(agentId);
94
+ });
95
+
96
+ // Agent disable alias
97
+ program
98
+ .command('di <agent-id>')
99
+ .description('Alias for "agents:disable"')
100
+ .action(async (agentId) => {
101
+ const { AgentCommands } = require('../../../core/src/rui/commands/AgentCommands');
102
+ const AgentConfigManager = require('../../../core/src/agents/config/AgentConfigManager');
103
+ const AgentLogger = require('../../../core/src/agents/logging/AgentLogger');
104
+ const FileManager = require('../../../core/src/agents/storage/FileManager');
105
+
106
+ const agentCommands = new AgentCommands({
107
+ configManager: new AgentConfigManager(),
108
+ logger: new AgentLogger(),
109
+ fileManager: new FileManager()
110
+ });
111
+
112
+ await agentCommands.disableAgent(agentId);
113
+ });
114
+ }
115
+
116
+ module.exports = {
117
+ setupCommandAliases
118
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Repository management CLI commands
3
+ */
4
+
5
+ const { program } = require('commander');
6
+ const { t } = require('vibecodingmachine-core');
7
+
8
+ /**
9
+ * Setup repository management commands
10
+ * @param {Object} repoCommands - Repository command handlers
11
+ */
12
+ function setupRepoCommands(repoCommands) {
13
+ // Repository management commands
14
+ program
15
+ .command('repo')
16
+ .description(t('cli.repo.manage'))
17
+ .action(() => {
18
+ program.outputHelp();
19
+ });
20
+
21
+ program
22
+ .command('repo:set <path>')
23
+ .description(t('cli.repo.set'))
24
+ .action(repoCommands.setRepo);
25
+
26
+ program
27
+ .command('repo:get')
28
+ .description(t('cli.repo.get'))
29
+ .action(repoCommands.getRepo);
30
+
31
+ program
32
+ .command('repo:init')
33
+ .description(t('cli.repo.init'))
34
+ .action(repoCommands.initRepo);
35
+ }
36
+
37
+ module.exports = {
38
+ setupRepoCommands
39
+ };
@@ -0,0 +1,152 @@
1
+ /**
2
+ * RUI (REST UI) pattern commands
3
+ */
4
+
5
+ const { program } = require('commander');
6
+
7
+ // Helper: print requirements in tree format
8
+ async function printRequirementsTree() {
9
+ const { loadAllSections } = require('../../src/utils/trui-req-tree');
10
+ const sections = await loadAllSections();
11
+
12
+ const total = sections.verified.length + sections.verify.length + sections.todo.length;
13
+ const pct = n => total > 0 ? ` — ${Math.round((n / total) * 100)}%` : '';
14
+
15
+ // Specifications
16
+ try {
17
+ const { getSpecsList } = require('../../src/utils/trui-specifications');
18
+ const specs = await getSpecsList();
19
+ console.log(` ▸ 📋 TODO SPECIFICATIONS (${specs.length})`);
20
+ } catch (_) {
21
+ console.log(' ▸ 📋 TODO SPECIFICATIONS');
22
+ }
23
+
24
+ const printSection = (icon, label, items) => {
25
+ const count = items.length;
26
+ console.log(` ▸ ${icon} ${label} (${count}${pct(count)})`);
27
+ items.forEach(req => console.log(` ${req.title || req}`));
28
+ };
29
+
30
+ printSection('🎉', 'VERIFIED', sections.verified);
31
+ printSection('✅', 'TO VERIFY', sections.verify);
32
+ printSection('⏳', 'TODO REQUIREMENTS', sections.todo);
33
+ }
34
+
35
+ // Helper: print agents list
36
+ async function printAgentsList() {
37
+ const { getProviderDefinitions, getProviderPreferences } = require('../../src/utils/provider-registry');
38
+ const defs = getProviderDefinitions();
39
+ const defMap = new Map(defs.map(d => [d.id, d]));
40
+ const prefs = await getProviderPreferences();
41
+ const order = prefs.order.slice();
42
+ defs.forEach(d => { if (!order.includes(d.id)) order.push(d.id); });
43
+
44
+ console.log(' 🤖 Agents / Providers\n');
45
+ order.forEach((id, idx) => {
46
+ const def = defMap.get(id);
47
+ if (!def) return;
48
+ const isEnabled = prefs.enabled[id] !== false;
49
+ const statusIcon = isEnabled ? '🟢' : '🔴';
50
+ const interfaceIcon = def.type === 'ide' ? '🖥️ ' : '⚡';
51
+ const providerIcon = (def.type === 'direct' && def.category === 'llm' && id === 'ollama') ? '🏠' : '☁️ ';
52
+ console.log(` ${statusIcon} ${interfaceIcon} ${providerIcon} #${idx + 1} ${def.name} (${id})`);
53
+ });
54
+ }
55
+
56
+ // Helper: print settings
57
+ async function printSettingsList() {
58
+ const { getAutoConfig, getRepoPath, getStages } = require('../../src/utils/config');
59
+ const os = require('os');
60
+
61
+ const repoPath = await getRepoPath();
62
+ const autoConfig = await getAutoConfig();
63
+ const stages = await getStages();
64
+
65
+ console.log(' ⚙️ Settings\n');
66
+ console.log(` repo: ${repoPath || '(not set)'}`);
67
+ console.log(` ide: ${autoConfig.ide || autoConfig.agent || 'cline'}`);
68
+ console.log(` maxChats: ${autoConfig.maxChats || '(unlimited)'}`);
69
+ console.log(` neverStop:${autoConfig.neverStop ? ' true' : ' false'}`);
70
+ console.log(` stages: ${stages.join(', ')}`);
71
+ }
72
+
73
+ // Helper: print system info
74
+ async function printSystemInfo() {
75
+ const os = require('os');
76
+ const { getRepoPath } = require('../../src/utils/config');
77
+ const { checkAutoModeStatus } = require('../../src/utils/auto-mode');
78
+
79
+ const repoPath = await getRepoPath();
80
+ let autoStatus = { running: false };
81
+ try { autoStatus = await checkAutoModeStatus(); } catch (_) {}
82
+
83
+ console.log(' 🖥️ System\n');
84
+ console.log(` hostname: ${os.hostname()}`);
85
+ console.log(` platform: ${os.platform()} ${os.release()}`);
86
+ console.log(` node: ${process.version}`);
87
+ console.log(` repo: ${repoPath || '(not set)'}`);
88
+ console.log(` auto mode: ${autoStatus.running ? '🟢 running' : '🔴 stopped'}`);
89
+ }
90
+
91
+ // Dispatch for list/GET resource
92
+ async function dispatchResource(resource, verb) {
93
+ const r = (resource || '').toLowerCase();
94
+ if (r === 'requirements' || r === 'reqs' || r === 'req') {
95
+ await printRequirementsTree();
96
+ } else if (r === 'agents' || r === 'agent' || r === 'providers') {
97
+ await printAgentsList();
98
+ } else if (r === 'settings' || r === 'setting' || r === 'config') {
99
+ await printSettingsList();
100
+ } else if (r === 'system' || r === 'sys' || r === 'info') {
101
+ await printSystemInfo();
102
+ } else {
103
+ console.log(`Usage: vcm ${verb} <resource>`);
104
+ console.log('Resources: requirements, agents, settings, system');
105
+ process.exit(1);
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Setup RUI pattern commands
111
+ */
112
+ function setupRuiCommands() {
113
+ // RUI-compliant app commands for requirements
114
+ program
115
+ .command('list [resource]')
116
+ .description('List resources (RUI pattern): requirements, agents, settings, system')
117
+ .action(async (resource) => dispatchResource(resource, 'list'));
118
+
119
+ program
120
+ .command('get [resource]')
121
+ .description('GET resource (RUI pattern): requirements, agents, settings, system')
122
+ .action(async (resource) => dispatchResource(resource, 'get'));
123
+
124
+ // TRUI interface command
125
+ program
126
+ .command('trui')
127
+ .description('Start interactive TRUI interface for agent management')
128
+ .action(async () => {
129
+ const { TruiInterface } = require('../../src/trui/TruiInterface');
130
+ const AgentConfigManager = require('../../../core/src/agents/config/AgentConfigManager');
131
+ const AgentLogger = require('../../../core/src/agents/logging/AgentLogger');
132
+ const FileManager = require('../../../core/src/agents/storage/FileManager');
133
+
134
+ const truiInterface = new TruiInterface({
135
+ configManager: new AgentConfigManager(),
136
+ logger: new AgentLogger({ fileManager: new FileManager() }),
137
+ fileManager: new FileManager()
138
+ });
139
+
140
+ try {
141
+ await truiInterface.start();
142
+ } catch (error) {
143
+ console.error('Failed to start TRUI interface:', error.message);
144
+ process.exit(1);
145
+ }
146
+ });
147
+ }
148
+
149
+ module.exports = {
150
+ setupRuiCommands,
151
+ dispatchResource
152
+ };
@@ -0,0 +1,394 @@
1
+ /**
2
+ * CLI configuration and program setup
3
+ */
4
+
5
+ const { program } = require('commander');
6
+ const path = require('path');
7
+
8
+ /**
9
+ * Configure the CLI program
10
+ * @param {Object} dependencies - Dependencies for configuration
11
+ */
12
+ function configureCli(dependencies) {
13
+ const { packageJson, t } = dependencies;
14
+
15
+ // Detect which command was used (vcm or vibecodingmachine)
16
+ const commandName = path.basename(process.argv[1], '.js');
17
+ const altCommandName = commandName === 'vcm' ? 'vibecodingmachine' : 'vcm';
18
+
19
+ // Configure CLI
20
+ program
21
+ .name(commandName)
22
+ .usage(`[options] [command]\n\n You can use '${commandName}' or '${altCommandName}'`)
23
+ .description(t('app.name') + ' CLI - Autonomous development')
24
+ .version(packageJson.version, '-v, --version', 'output the current version')
25
+ .helpOption('-h, --help', 'display help for command');
26
+
27
+ return { commandName, altCommandName };
28
+ }
29
+
30
+ /**
31
+ * Setup basic command structure
32
+ * @param {Object} dependencies - Dependencies for setup
33
+ */
34
+ function setupBasicCommands(dependencies) {
35
+ const { t } = dependencies;
36
+
37
+ // Repository management commands
38
+ const repoCommands = require('../../src/commands/repo');
39
+ program
40
+ .command('repo')
41
+ .description(t('cli.repo.manage'))
42
+ .action(() => {
43
+ program.outputHelp();
44
+ });
45
+
46
+ program
47
+ .command('repo:set <path>')
48
+ .description(t('cli.repo.set'))
49
+ .action(repoCommands.setRepo);
50
+
51
+ program
52
+ .command('repo:get')
53
+ .description(t('cli.repo.get'))
54
+ .action(repoCommands.getRepo);
55
+
56
+ program
57
+ .command('repo:init')
58
+ .description(t('cli.repo.init'))
59
+ .action(repoCommands.initRepo);
60
+
61
+ // Auto mode commands
62
+ const autoCommands = require('../../src/commands/auto');
63
+ program
64
+ .command('auto:start')
65
+ .description(t('cli.auto.start'))
66
+ .option('-i, --ide <ide>', 'IDE to use (claude-code, aider, cursor, vscode, windsurf, cline)')
67
+ .option('--ide-model <model>', 'IDE agent/model to use (for IDE sub-agents like Windsurf/Antigravity)')
68
+ .option('--extension <extension>', 'VS Code extension to use (amazon-q, github-copilot, windsurf)')
69
+ .option('-m, --max-chats <number>', 'Maximum number of chat iterations', parseInt)
70
+ .option('-n, --never-stop', 'Run indefinitely without stopping')
71
+ .option('-f, --force-provider-setup', 'Force provider selection even if already configured')
72
+ .option('--adaptive-timeout', 'Enable adaptive timeout calculation based on IDE performance')
73
+ .action(autoCommands.start);
74
+
75
+ // Direct LLM auto mode (new simplified implementation)
76
+ const { handleAutoStart: handleDirectAutoStart } = require('../../src/commands/auto-direct');
77
+ program
78
+ .command('auto:direct')
79
+ .description(t('cli.auto.direct'))
80
+ .option('-m, --max-chats <number>', 'Maximum number of iterations', parseInt)
81
+ .option('--provider <id>', 'Force a specific provider by ID (e.g. groq, anthropic, cursor)')
82
+ .action(handleDirectAutoStart);
83
+
84
+ program
85
+ .command('auto:stop')
86
+ .description(t('cli.auto.stop'))
87
+ .action(autoCommands.stop);
88
+
89
+ program
90
+ .command('auto:status')
91
+ .description(t('cli.auto.status'))
92
+ .action(autoCommands.status);
93
+
94
+ program
95
+ .command('auto:config')
96
+ .description(t('cli.auto.config'))
97
+ .option('--max-chats <number>', 'Set maximum chat iterations', parseInt)
98
+ .option('--never-stop', 'Enable never stop mode')
99
+ .option('--no-never-stop', 'Disable never stop mode')
100
+ .action(autoCommands.config);
101
+
102
+ program
103
+ .command('auto:agents')
104
+ .description(t('cli.auto.agents'))
105
+ .action(autoCommands.listAgents);
106
+
107
+ // Timeout configuration
108
+ const timeoutCommands = require('../../src/commands/timeout');
109
+ program
110
+ .command('config:timeout [action] [key] [value]')
111
+ .description('Manage timeout configuration for adaptive timeouts')
112
+ .action((action, key, value) => {
113
+ timeoutCommands.handleCommand([action, key, value]);
114
+ });
115
+ }
116
+
117
+ /**
118
+ * Setup requirements commands
119
+ * @param {Object} dependencies - Dependencies for setup
120
+ */
121
+ function setupRequirementsCommands(dependencies) {
122
+ const { t } = dependencies;
123
+ const reqCommands = require('../../src/commands/requirements');
124
+
125
+ // Requirements management commands
126
+ program
127
+ .command('req:list')
128
+ .description(t('cli.req.list'))
129
+ .option('-s, --status <status>', 'Filter by status (pending, in-progress, completed)')
130
+ .option('-c, --computer <hostname>', 'Filter by computer hostname')
131
+ .option('-f, --focus <area>', 'Filter by focus area')
132
+ .option('-a, --all-computers', 'Show requirements from all computers with computer tags')
133
+ .option('-d, --detailed', 'Show detailed requirement information')
134
+ .action(reqCommands.list);
135
+
136
+ program
137
+ .command('req:add <requirement>')
138
+ .description(t('cli.req.add'))
139
+ .action(reqCommands.add);
140
+
141
+ program
142
+ .command('req:current')
143
+ .description(t('cli.req.current'))
144
+ .action(reqCommands.current);
145
+
146
+ program
147
+ .command('req:next')
148
+ .description(t('cli.req.next'))
149
+ .action(reqCommands.next);
150
+
151
+ program
152
+ .command('req:edit')
153
+ .description(t('cli.req.edit'))
154
+ .action(reqCommands.edit);
155
+
156
+ program
157
+ .command('req:watch')
158
+ .description(t('cli.req.watch'))
159
+ .action(reqCommands.watch);
160
+
161
+ program
162
+ .command('req:rename <old-title> <new-title> [description...]')
163
+ .description(t('cli.req.rename'))
164
+ .action((oldTitle, newTitle, description) => reqCommands.rename(oldTitle, newTitle, description));
165
+
166
+ program
167
+ .command('req:number-all')
168
+ .description('Number all existing requirements with R1, R2, R3, etc.')
169
+ .action(reqCommands.numberAll);
170
+ }
171
+
172
+ /**
173
+ * Setup feature and IDE commands
174
+ * @param {Object} dependencies - Dependencies for setup
175
+ */
176
+ function setupFeatureAndIdeCommands(dependencies) {
177
+ const { t } = dependencies;
178
+
179
+ // Feature branch management commands
180
+ const featureCommands = require('../../src/commands/feature');
181
+ program
182
+ .command('feature:start <requirement-title>')
183
+ .description('Create and checkout feature branch for requirement (e.g., "R1: Email System")')
184
+ .action(featureCommands.start);
185
+
186
+ program
187
+ .command('feature:finish <requirement-title>')
188
+ .description('Merge feature branch back to parent and delete branch')
189
+ .option('-p, --parent <branch>', 'Parent branch to merge into', 'main')
190
+ .action(featureCommands.finish);
191
+
192
+ program
193
+ .command('feature:remove <requirement-title>')
194
+ .description('Remove a feature by reverting its merge commit')
195
+ .action(featureCommands.remove);
196
+
197
+ program
198
+ .command('feature:list')
199
+ .description('List all requirement feature branches')
200
+ .action(featureCommands.list);
201
+
202
+ // IDE integration commands
203
+ const ideCommands = require('../../src/commands/ide');
204
+ program
205
+ .command('ide:list')
206
+ .description(t('cli.ide.list'))
207
+ .action(ideCommands.list);
208
+
209
+ program
210
+ .command('ide:open <ide>')
211
+ .description(t('cli.ide.open'))
212
+ .action(ideCommands.open);
213
+
214
+ program
215
+ .command('ide:send <message>')
216
+ .description(t('cli.ide.send'))
217
+ .option('-i, --ide <ide>', 'IDE to use (cursor, vscode, windsurf)', 'cursor')
218
+ .action(ideCommands.send);
219
+
220
+ program
221
+ .command('ide:health')
222
+ .description('Test health and connectivity of all configured IDEs')
223
+ .option('-v, --verbose', 'Show detailed health metrics', false)
224
+ .action(ideCommands.health);
225
+ }
226
+
227
+ /**
228
+ * Setup status and system commands
229
+ * @param {Object} dependencies - Dependencies for setup
230
+ */
231
+ function setupStatusCommands(dependencies) {
232
+ const { t } = dependencies;
233
+
234
+ // Status and monitoring commands
235
+ const statusCommands = require('../../src/commands/status');
236
+ program
237
+ .command('status')
238
+ .description(t('cli.status'))
239
+ .action(statusCommands.show);
240
+
241
+ program
242
+ .command('progress')
243
+ .description(t('cli.progress'))
244
+ .action(statusCommands.progress);
245
+
246
+ program
247
+ .command('logs')
248
+ .description(t('cli.logs'))
249
+ .option('-n, --lines <number>', 'Number of log lines to show', '50')
250
+ .action(statusCommands.logs);
251
+
252
+ // Setup command
253
+ program
254
+ .command('setup')
255
+ .description(t('cli.setup'))
256
+ .action(async () => {
257
+ const { setupAlias } = require('../../src/commands/setup');
258
+ await setupAlias();
259
+ });
260
+
261
+ // Interactive mode
262
+ program
263
+ .command('interactive')
264
+ .alias('i')
265
+ .description(t('cli.interactive'))
266
+ .action(async () => {
267
+ const { startInteractive } = require('../../src/utils/interactive');
268
+ await startInteractive();
269
+ });
270
+ }
271
+
272
+ /**
273
+ * Setup authentication commands
274
+ * @param {Object} dependencies - Dependencies for setup
275
+ */
276
+ function setupAuthCommands(dependencies) {
277
+ const { t } = dependencies;
278
+
279
+ // Authentication commands
280
+ const authCommands = require('../../src/commands/auth');
281
+ program
282
+ .command('auth:login')
283
+ .description(t('cli.auth.login'))
284
+ .option('--headless', 'Use headless mode (manual URL paste) for SSH/no-GUI environments')
285
+ .action((options) => authCommands.login(options));
286
+
287
+ program
288
+ .command('auth:logout')
289
+ .description(t('cli.auth.logout'))
290
+ .action(authCommands.logout);
291
+
292
+ program
293
+ .command('auth:status')
294
+ .description(t('cli.auth.status'))
295
+ .action(authCommands.status);
296
+ }
297
+
298
+ /**
299
+ * Setup multi-computer management commands
300
+ * @param {Object} dependencies - Dependencies for setup
301
+ */
302
+ function setupComputerCommands(dependencies) {
303
+ const { t } = dependencies;
304
+
305
+ // Multi-computer management commands
306
+ const computerCommands = require('../../src/commands/computers');
307
+ const remoteReqCommands = require('../../src/commands/requirements-remote');
308
+
309
+ program
310
+ .command('computers')
311
+ .description(t('cli.computers.list'))
312
+ .option('-f, --focus <area>', 'Filter by focus area')
313
+ .option('-s, --status <status>', 'Filter by status (active, idle, error)')
314
+ .action(computerCommands.listComputers);
315
+
316
+ program
317
+ .command('computer:status <computerId>')
318
+ .description(t('cli.computer.status.show'))
319
+ .action(computerCommands.showComputerStatus);
320
+
321
+ program
322
+ .command('computer:register <focusArea>')
323
+ .description(t('cli.computer.register'))
324
+ .action(computerCommands.registerComputer);
325
+
326
+ program
327
+ .command('computer:focus [newFocusArea]')
328
+ .description(t('cli.computer.focus.view'))
329
+ .action((newFocusArea) => {
330
+ if (newFocusArea) {
331
+ computerCommands.updateFocus(newFocusArea);
332
+ } else {
333
+ // Show current focus
334
+ computerCommands.showComputerStatus(require('os').hostname());
335
+ }
336
+ });
337
+
338
+ program
339
+ .command('computer:requirements <computerId>')
340
+ .description(t('cli.computer.requirements.view'))
341
+ .action(remoteReqCommands.listRemoteRequirements);
342
+
343
+ program
344
+ .command('computer:add-requirement <computerId> <requirement>')
345
+ .description(t('cli.computer.requirement.add'))
346
+ .action(remoteReqCommands.addRemoteRequirement);
347
+ }
348
+
349
+ /**
350
+ * Setup sync management commands
351
+ * @param {Object} dependencies - Dependencies for setup
352
+ */
353
+ function setupSyncCommands(dependencies) {
354
+ const { t } = dependencies;
355
+
356
+ // Sync management commands
357
+ const syncCommands = require('../../src/commands/sync');
358
+ program
359
+ .command('sync:now')
360
+ .description(t('cli.sync.trigger'))
361
+ .action(syncCommands.syncNow);
362
+
363
+ program
364
+ .command('sync:status')
365
+ .description(t('cli.sync.status.show'))
366
+ .action(syncCommands.syncStatus);
367
+
368
+ program
369
+ .command('sync:queue')
370
+ .description(t('cli.sync.queue.view'))
371
+ .action(syncCommands.viewQueue);
372
+
373
+ program
374
+ .command('sync:force')
375
+ .description(t('cli.sync.force.sync'))
376
+ .action(syncCommands.forceSync);
377
+
378
+ program
379
+ .command('sync:history')
380
+ .description(t('cli.sync.history.view'))
381
+ .option('-n, --limit <number>', 'Number of history entries to show', '50')
382
+ .action(syncCommands.viewHistory);
383
+ }
384
+
385
+ module.exports = {
386
+ configureCli,
387
+ setupBasicCommands,
388
+ setupRequirementsCommands,
389
+ setupFeatureAndIdeCommands,
390
+ setupStatusCommands,
391
+ setupAuthCommands,
392
+ setupComputerCommands,
393
+ setupSyncCommands
394
+ };