vibecodingmachine-cli 2026.2.20-436 → 2026.2.26-1642

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,126 @@
1
+ /**
2
+ * Authentication and compliance checking
3
+ */
4
+
5
+ const chalk = require('chalk');
6
+
7
+ /**
8
+ * Check authentication and handle login if needed
9
+ * @param {Object} dependencies - Dependencies for authentication
10
+ * @param {boolean} skipAuthCheck - Whether to skip authentication check
11
+ */
12
+ async function checkAuthentication(dependencies, skipAuthCheck = false) {
13
+ const { t, errorReporter } = dependencies;
14
+ const auth = require('../../src/utils/auth');
15
+
16
+ if (!skipAuthCheck) {
17
+ const isAuth = await auth.isAuthenticated();
18
+
19
+ if (!isAuth) {
20
+ console.log(chalk.cyan(`\n🔐 ${t('cli.auth.opening.browser')}\n`));
21
+ try {
22
+ await auth.login();
23
+ console.log(chalk.green(`\n✓ ${t('cli.auth.success')}\n`));
24
+
25
+ // Initialize error reporter with auth token
26
+ const token = await auth.getAuthToken();
27
+ if (token) {
28
+ errorReporter.setAuthToken(token);
29
+ }
30
+ } catch (error) {
31
+ console.log(chalk.red(`\n✗ ${t('cli.auth.failed')}:`), error.message);
32
+ process.exit(1);
33
+ }
34
+ } else {
35
+ // Initialize error reporter with existing auth token
36
+ const token = await auth.getAuthToken();
37
+ if (token) {
38
+ errorReporter.setAuthToken(token);
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Check compliance and handle failure
46
+ * @param {Object} dependencies - Dependencies for compliance checking
47
+ * @param {boolean} skipComplianceCheck - Whether to skip compliance check
48
+ */
49
+ async function checkCompliance(dependencies, skipComplianceCheck = false) {
50
+ const { t } = dependencies;
51
+
52
+ if (!skipComplianceCheck) {
53
+ const { checkCompliance } = require('../../src/utils/compliance-check');
54
+ const isCompliant = await checkCompliance();
55
+
56
+ if (!isCompliant) {
57
+ console.log(chalk.red(`\n✗ ${t('cli.compliance.failed')}\n`));
58
+ process.exit(1);
59
+ }
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Track CLI activity
65
+ * @param {string} activity - Activity type
66
+ * @param {Object} metadata - Additional metadata
67
+ */
68
+ async function trackActivity(activity, metadata = {}) {
69
+ const auth = require('../../src/utils/auth');
70
+ try {
71
+ await auth.trackCLIActivity(activity, metadata);
72
+ } catch (error) {
73
+ // Don't block CLI if tracking fails
74
+ console.warn('Warning: Failed to track activity:', error.message);
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Handle first run experience
80
+ * @param {Object} dependencies - Dependencies for first run
81
+ */
82
+ async function handleFirstRun(dependencies) {
83
+ const { checkFirstRun } = require('../../src/utils/first-run');
84
+ await checkFirstRun();
85
+ }
86
+
87
+ /**
88
+ * Setup authentication and compliance for interactive mode
89
+ * @param {Object} dependencies - Dependencies for setup
90
+ */
91
+ async function setupInteractiveAuth(dependencies) {
92
+ await checkAuthentication(dependencies);
93
+ await checkCompliance(dependencies);
94
+ await handleFirstRun(dependencies);
95
+ await trackActivity('interactive_mode_started');
96
+ }
97
+
98
+ /**
99
+ * Setup authentication and compliance for command execution
100
+ * @param {Object} dependencies - Dependencies for setup
101
+ * @param {string} command - Command being executed
102
+ * @param {Array} args - Command arguments
103
+ */
104
+ async function setupCommandAuth(dependencies, command, args) {
105
+ const authCommands = ['auth:login', 'auth:logout', 'auth:status'];
106
+ const skipAuthCheck = authCommands.includes(command);
107
+
108
+ await checkAuthentication(dependencies, skipAuthCheck);
109
+ await checkCompliance(dependencies, skipAuthCheck);
110
+
111
+ if (!skipAuthCheck) {
112
+ await trackActivity('command_executed', {
113
+ command,
114
+ args: args.filter(arg => !arg.includes('password') && !arg.includes('token'))
115
+ });
116
+ }
117
+ }
118
+
119
+ module.exports = {
120
+ checkAuthentication,
121
+ checkCompliance,
122
+ trackActivity,
123
+ handleFirstRun,
124
+ setupInteractiveAuth,
125
+ setupCommandAuth
126
+ };
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Main CLI program setup and configuration
3
+ */
4
+
5
+ const { program } = require('commander');
6
+ const path = require('path');
7
+ const chalk = require('chalk');
8
+ const { t, detectLocale, setLocale } = require('vibecodingmachine-core');
9
+ const { promptWithDefaultsOnce } = require('../src/utils/prompt-helper');
10
+
11
+ /**
12
+ * Setup main program configuration
13
+ */
14
+ function setupProgram() {
15
+ // Detect which command was used (vcm or vibecodingmachine)
16
+ const commandName = path.basename(process.argv[1], '.js');
17
+ const packageJson = require('../package.json');
18
+
19
+ // Initialize locale detection
20
+ const detectedLocale = detectLocale();
21
+ setLocale(detectedLocale);
22
+
23
+ program
24
+ .name(commandName)
25
+ .usage(`[options] [command]\n\n You can use '${commandName}' or '${altCommandName}'`)
26
+ .description(t('app.name') + ' CLI - Autonomous development')
27
+ .version(packageJson.version, '-v, --version', 'output the current version')
28
+ .helpOption('-h, --help', 'display help for command');
29
+
30
+ return { commandName, packageJson };
31
+ }
32
+
33
+ /**
34
+ * Setup remaining CLI commands (requirements, features, IDE, status)
35
+ */
36
+ function setupOtherCommands() {
37
+ const reqCommands = require('../src/commands/requirements');
38
+ const featureCommands = require('../src/commands/feature');
39
+ const ideCommands = require('../src/commands/ide');
40
+ const statusCommands = require('../src/commands/status');
41
+
42
+ // Requirements commands
43
+ program
44
+ .command('requirements:add <requirement>')
45
+ .description('Add a new requirement')
46
+ .action(reqCommands.add);
47
+
48
+ program
49
+ .command('requirements:list')
50
+ .description('List all requirements')
51
+ .action(reqCommands.list);
52
+
53
+ program
54
+ .command('requirements:complete <requirement>')
55
+ .description('Mark requirement as complete')
56
+ .action(reqCommands.complete);
57
+
58
+ // Feature commands
59
+ program
60
+ .command('feature:create <name>')
61
+ .description('Create a new feature')
62
+ .action(featureCommands.create);
63
+
64
+ program
65
+ .command('feature:list')
66
+ .description('List all features')
67
+ .action(featureCommands.list);
68
+
69
+ // IDE commands
70
+ program
71
+ .command('ide:install <ide>')
72
+ .description('Install an IDE')
73
+ .action(ideCommands.install);
74
+
75
+ program
76
+ .command('ide:list')
77
+ .description('List available IDEs')
78
+ .action(ideCommands.list);
79
+
80
+ // Status commands
81
+ program
82
+ .command('status:show')
83
+ .description('Show current status')
84
+ .action(statusCommands.show);
85
+
86
+ program
87
+ .command('status:health')
88
+ .description('Check system health')
89
+ .action(statusCommands.health);
90
+ }
91
+
92
+ /**
93
+ * Parse and execute CLI arguments
94
+ */
95
+ function runCLI() {
96
+ // Parse command line arguments
97
+ program.parse();
98
+ }
99
+
100
+ module.exports = {
101
+ setupProgram,
102
+ setupOtherCommands,
103
+ runCLI
104
+ };
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+
6
+ /**
7
+ * CLI environment setup and initialization
8
+ */
9
+
10
+ /**
11
+ * Auto-load .env.cognito from root
12
+ */
13
+ function loadEnvironment() {
14
+ const rootDir = path.join(__dirname, '..', '..', '..');
15
+ const envCognitoPath = path.join(rootDir, '.env.cognito');
16
+
17
+ if (fs.existsSync(envCognitoPath)) {
18
+ const envContent = fs.readFileSync(envCognitoPath, 'utf8');
19
+ envContent.split('\n').forEach(line => {
20
+ const trimmed = line.trim();
21
+ if (trimmed && !trimmed.startsWith('#')) {
22
+ const [key, ...valueParts] = trimmed.split('=');
23
+ if (key && valueParts.length > 0) {
24
+ process.env[key.trim()] = valueParts.join('=').trim();
25
+ }
26
+ }
27
+ });
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Setup CLI dependencies and cleanup
33
+ */
34
+ async function setupCLI() {
35
+ // mitigate broken assets issue
36
+ const { cleanupBrokenAssets } = require('../src/utils/asset-cleanup');
37
+ await cleanupBrokenAssets();
38
+ }
39
+
40
+ /**
41
+ * Initialize CLI environment
42
+ */
43
+ async function initializeCLI() {
44
+ loadEnvironment();
45
+ await setupCLI();
46
+ }
47
+
48
+ module.exports = {
49
+ loadEnvironment,
50
+ setupCLI,
51
+ initializeCLI
52
+ };
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Agent management CLI commands
3
+ */
4
+
5
+ const { program } = require('commander');
6
+ const chalk = require('chalk');
7
+
8
+ /**
9
+ * Create agent commands instance with required dependencies
10
+ * @returns {Object} Agent commands instance
11
+ */
12
+ function createAgentCommands() {
13
+ const { AgentCommands } = require('../../../core/src/rui/commands/AgentCommands');
14
+ const AgentResponseFormatter = require('../../../core/src/rui/commands/AgentResponseFormatter');
15
+ const AgentConfigManager = require('../../../core/src/agents/config/AgentConfigManager');
16
+ const AgentLogger = require('../../../core/src/agents/logging/AgentLogger');
17
+ const FileManager = require('../../../core/src/agents/storage/FileManager');
18
+
19
+ const agentCommands = new AgentCommands({
20
+ configManager: new AgentConfigManager(),
21
+ logger: new AgentLogger({ fileManager: new FileManager() }),
22
+ fileManager: new FileManager()
23
+ });
24
+
25
+ const responseFormatter = new AgentResponseFormatter({
26
+ defaultFormat: 'json',
27
+ includeTimestamp: true,
28
+ prettyPrint: true
29
+ });
30
+
31
+ return { agentCommands, responseFormatter };
32
+ }
33
+
34
+ /**
35
+ * Setup agent management commands
36
+ */
37
+ function setupAgentCommands() {
38
+ // List agents command
39
+ program
40
+ .command('list agents')
41
+ .description('List all available agents')
42
+ .option('--format <format>', 'Output format (table, json, csv)')
43
+ .option('--include-disabled', 'Include disabled agents in list')
44
+ .option('--include-status', 'Include agent status information')
45
+ .option('--sort <field>', 'Sort by field (name, status, type)')
46
+ .option('--status <status>', 'Filter by agent status')
47
+ .action(async (options) => {
48
+ const { ListAgentsCommand } = require('../../src/commands/agents/list');
49
+ const listCommand = new ListAgentsCommand(options);
50
+ await listCommand.execute();
51
+ });
52
+
53
+ // Get agent details command
54
+ program
55
+ .command('get agents <agent-id>')
56
+ .description('Get detailed information about a specific agent')
57
+ .option('--include-status', 'Include agent status information')
58
+ .option('--include-logs', 'Include agent logs')
59
+ .action(async (agentId, options) => {
60
+ const { agentCommands, responseFormatter } = createAgentCommands();
61
+
62
+ try {
63
+ const result = await agentCommands.executeCommand('GET', agentId, options);
64
+ const formattedResponse = responseFormatter.format(result, 'cli', options);
65
+
66
+ if (options.format === 'json') {
67
+ console.log(JSON.stringify(formattedResponse.data || formattedResponse, null, 2));
68
+ } else {
69
+ console.log(JSON.stringify(formattedResponse.data || formattedResponse, null, 2));
70
+ }
71
+ } catch (error) {
72
+ console.error(`Error getting agent ${agentId}:`, error.message);
73
+ process.exit(1);
74
+ }
75
+ });
76
+
77
+ // Enable agent command
78
+ program
79
+ .command('enable agents <agent-id>')
80
+ .description('Enable a specific agent')
81
+ .action(async (agentId) => {
82
+ const { agentCommands } = createAgentCommands();
83
+
84
+ try {
85
+ const result = await agentCommands.executeCommand('PUT', agentId, { enabled: true });
86
+ console.log(`Agent ${agentId} enabled successfully`);
87
+
88
+ if (!result.success) {
89
+ console.error('Error:', result.error);
90
+ }
91
+ } catch (error) {
92
+ console.error(`Error enabling agent ${agentId}:`, error.message);
93
+ process.exit(1);
94
+ }
95
+ });
96
+
97
+ // Disable agent command
98
+ program
99
+ .command('disable agents <agent-id>')
100
+ .description('Disable a specific agent')
101
+ .action(async (agentId) => {
102
+ const { agentCommands } = createAgentCommands();
103
+
104
+ try {
105
+ const result = await agentCommands.executeCommand('PUT', agentId, { enabled: false });
106
+ console.log(`Agent ${agentId} disabled successfully`);
107
+
108
+ if (!result.success) {
109
+ console.error('Error:', result.error);
110
+ }
111
+ } catch (error) {
112
+ console.error(`Error disabling agent ${agentId}:`, error.message);
113
+ process.exit(1);
114
+ }
115
+ });
116
+
117
+ // Remove agent command
118
+ program
119
+ .command('remove agents <agent-id>')
120
+ .description('Remove a specific agent')
121
+ .option('--confirm', 'Confirm removal without prompting')
122
+ .action(async (agentId, options) => {
123
+ const { agentCommands } = createAgentCommands();
124
+
125
+ try {
126
+ const result = await agentCommands.executeCommand('DELETE', agentId, { confirm: options.confirm });
127
+ console.log(`Agent ${agentId} removed successfully`);
128
+
129
+ if (!result.success) {
130
+ console.error('Error:', result.error);
131
+ }
132
+ } catch (error) {
133
+ console.error(`Error removing agent ${agentId}:`, error.message);
134
+ process.exit(1);
135
+ }
136
+ });
137
+
138
+ // View agent logs command
139
+ program
140
+ .command('logs agents <agent-id>')
141
+ .description('View logs for a specific agent')
142
+ .option('--limit <number>', 'Limit number of log entries')
143
+ .action(async (agentId, options) => {
144
+ const { agentCommands } = createAgentCommands();
145
+
146
+ try {
147
+ const result = await agentCommands.executeCommand('GET', agentId, { includeLogs: true, limit: options.limit });
148
+
149
+ if (result.success && result.data && result.data.logs) {
150
+ console.log(`Logs for agent ${agentId}:`);
151
+ result.data.logs.forEach(log => {
152
+ console.log(`${log.timestamp} [${log.level.toUpperCase()}] ${log.message}`);
153
+ });
154
+ } else {
155
+ console.log(`No logs found for agent ${agentId}`);
156
+ }
157
+ } catch (error) {
158
+ console.error(`Error getting logs for agent ${agentId}:`, error.message);
159
+ process.exit(1);
160
+ }
161
+ });
162
+
163
+ // Check agents command
164
+ program
165
+ .command('check agents')
166
+ .description('Ping all agents and show connection status')
167
+ .option('--provider <id>', 'Check a specific provider by ID')
168
+ .action(async (options) => {
169
+ const { checkAgents } = require('../../src/commands/agents-check');
170
+ await checkAgents(options);
171
+ });
172
+ }
173
+
174
+ /**
175
+ * Setup agent command aliases
176
+ */
177
+ function setupAgentAliases() {
178
+ // List aliases
179
+ program
180
+ .command('la')
181
+ .description('Alias for "list agents"')
182
+ .action(async (options) => {
183
+ const { ListAgentsCommand } = require('../../src/commands/agents/list');
184
+ const listCommand = new ListAgentsCommand(options);
185
+ await listCommand.execute();
186
+ });
187
+
188
+ program
189
+ .command('li')
190
+ .description('Alias for "list agents"')
191
+ .action(async (options) => {
192
+ const { ListAgentsCommand } = require('../../src/commands/agents/list');
193
+ const listCommand = new ListAgentsCommand(options);
194
+ await listCommand.execute();
195
+ });
196
+
197
+ // Check aliases
198
+ program
199
+ .command('ch')
200
+ .description('Alias for "check agents"')
201
+ .action(async (options) => {
202
+ const { checkAgents } = require('../../src/commands/agents-check');
203
+ await checkAgents(options);
204
+ });
205
+
206
+ program
207
+ .command('ca')
208
+ .description('Alias for "check agents"')
209
+ .action(async (options) => {
210
+ const { checkAgents } = require('../../src/commands/agents-check');
211
+ await checkAgents(options);
212
+ });
213
+
214
+ program
215
+ .command('!/1')
216
+ .description('Check agents (shortcut for first agent)')
217
+ .action(async (options) => {
218
+ const { checkAgents } = require('../../src/commands/agents-check');
219
+ await checkAgents(options);
220
+ });
221
+
222
+ // Get alias
223
+ program
224
+ .command('ge <agent-id>')
225
+ .description('Alias for "get agents"')
226
+ .action(async (agentId, options) => {
227
+ const { agentCommands, responseFormatter } = createAgentCommands();
228
+
229
+ try {
230
+ const result = await agentCommands.executeCommand('GET', agentId, options);
231
+ const formattedResponse = responseFormatter.format(result, 'cli', options);
232
+
233
+ if (options.format === 'json') {
234
+ console.log(JSON.stringify(formattedResponse.data || formattedResponse, null, 2));
235
+ } else {
236
+ console.log(JSON.stringify(formattedResponse.data || formattedResponse, null, 2));
237
+ }
238
+ } catch (error) {
239
+ console.error(`Error getting agent ${agentId}:`, error.message);
240
+ process.exit(1);
241
+ }
242
+ });
243
+
244
+ // Enable alias
245
+ program
246
+ .command('en <agent-id>')
247
+ .description('Alias for "enable agents"')
248
+ .action(async (agentId) => {
249
+ const { agentCommands } = createAgentCommands();
250
+
251
+ try {
252
+ const result = await agentCommands.executeCommand('PUT', agentId, { enabled: true });
253
+ console.log(`Agent ${agentId} enabled successfully`);
254
+
255
+ if (!result.success) {
256
+ console.error('Error:', result.error);
257
+ }
258
+ } catch (error) {
259
+ console.error(`Error enabling agent ${agentId}:`, error.message);
260
+ process.exit(1);
261
+ }
262
+ });
263
+
264
+ // Disable alias
265
+ program
266
+ .command('di <agent-id>')
267
+ .description('Alias for "disable agents"')
268
+ .action(async (agentId) => {
269
+ const { agentCommands } = createAgentCommands();
270
+
271
+ try {
272
+ const result = await agentCommands.executeCommand('PUT', agentId, { enabled: false });
273
+ console.log(`Agent ${agentId} disabled successfully`);
274
+
275
+ if (!result.success) {
276
+ console.error('Error:', result.error);
277
+ }
278
+ } catch (error) {
279
+ console.error(`Error disabling agent ${agentId}:`, error.message);
280
+ process.exit(1);
281
+ }
282
+ });
283
+
284
+ // Remove alias
285
+ program
286
+ .command('re <agent-id>')
287
+ .description('Alias for "remove agents"')
288
+ .option('--confirm', 'Confirm removal without prompting')
289
+ .action(async (agentId, options) => {
290
+ const { agentCommands } = createAgentCommands();
291
+
292
+ try {
293
+ const result = await agentCommands.executeCommand('DELETE', agentId, { confirm: options.confirm });
294
+ console.log(`Agent ${agentId} removed successfully`);
295
+
296
+ if (!result.success) {
297
+ console.error('Error:', result.error);
298
+ }
299
+ } catch (error) {
300
+ console.error(`Error removing agent ${agentId}:`, error.message);
301
+ process.exit(1);
302
+ }
303
+ });
304
+ }
305
+
306
+ module.exports = {
307
+ setupAgentCommands,
308
+ setupAgentAliases,
309
+ createAgentCommands
310
+ };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Auto mode CLI commands
3
+ */
4
+
5
+ const { program } = require('commander');
6
+ const { t } = require('vibecodingmachine-core');
7
+
8
+ /**
9
+ * Setup auto mode commands
10
+ * @param {Object} autoCommands - Auto command handlers
11
+ */
12
+ function setupAutoCommands(autoCommands) {
13
+ // Auto mode commands
14
+ program
15
+ .command('auto:start')
16
+ .description(t('cli.auto.start'))
17
+ .option('-i, --ide <ide>', 'IDE to use (claude-code, aider, cursor, vscode, windsurf, cline)')
18
+ .option('--ide-model <model>', 'IDE agent/model to use (for IDE sub-agents like Windsurf/Antigravity)')
19
+ .option('--extension <extension>', 'VS Code extension to use (amazon-q, github-copilot, windsurf)')
20
+ .option('-m, --max-chats <number>', 'Maximum number of iterations', parseInt)
21
+ .option('-p, --provider <provider>', 'AI provider to use (claude, openai, groq, anthropic)')
22
+ .option('-n, --never-stop', 'Run indefinitely without stopping')
23
+ .option('-f, --force-provider-setup', 'Force provider selection even if already configured')
24
+ .option('--adaptive-timeout', 'Enable adaptive timeout calculation based on IDE performance')
25
+ .action(autoCommands.start);
26
+
27
+ // Direct LLM auto mode (new simplified implementation)
28
+ const { handleAutoStart: handleDirectAutoStart } = require('../../src/commands/auto-direct');
29
+ program
30
+ .command('auto:direct')
31
+ .description(t('cli.auto.direct'))
32
+ .option('-m, --max-chats <number>', 'Maximum number of iterations', parseInt)
33
+ .option('--provider <id>', 'Force a specific provider by ID (e.g. groq, anthropic, cursor)')
34
+ .action(handleDirectAutoStart);
35
+
36
+ program
37
+ .command('auto:stop')
38
+ .description(t('cli.auto.stop'))
39
+ .action(autoCommands.stop);
40
+
41
+ program
42
+ .command('auto:status')
43
+ .description(t('cli.auto.status'))
44
+ .action(autoCommands.status);
45
+
46
+ program
47
+ .command('auto:config')
48
+ .description(t('cli.auto.config'))
49
+ .option('--max-chats <number>', 'Set maximum chat iterations', parseInt)
50
+ .option('--never-stop', 'Enable never stop mode')
51
+ .option('--no-never-stop', 'Disable never stop mode')
52
+ .action(autoCommands.config);
53
+
54
+ program
55
+ .command('config:timeout [action] [key] [value]')
56
+ .description('Manage timeout configuration for adaptive timeouts')
57
+ .action((action, key, value) => {
58
+ const timeoutCommands = require('../../src/commands/timeout');
59
+ timeoutCommands.handleCommand([action, key, value]);
60
+ });
61
+
62
+ program
63
+ .command('auto:agents')
64
+ .description(t('cli.auto.agents'))
65
+ .action(autoCommands.listAgents);
66
+ }
67
+
68
+ module.exports = {
69
+ setupAutoCommands
70
+ };