vibecodingmachine-cli 2026.1.29-1711 โ 2026.2.20-423
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/bin/vibecodingmachine.js +124 -0
- package/package.json +2 -2
- package/src/commands/agents-check.js +69 -0
- package/src/commands/auto-direct.js +930 -145
- package/src/commands/auto.js +26 -4
- package/src/commands/ide.js +2 -1
- package/src/commands/requirements.js +23 -27
- package/src/utils/auto-mode.js +4 -1
- package/src/utils/cline-js-handler.js +218 -0
- package/src/utils/config.js +22 -0
- package/src/utils/display-formatters-complete.js +229 -0
- package/src/utils/display-formatters-extracted.js +219 -0
- package/src/utils/display-formatters.js +157 -0
- package/src/utils/feedback-handler.js +143 -0
- package/src/utils/ide-detection-complete.js +126 -0
- package/src/utils/ide-detection-extracted.js +116 -0
- package/src/utils/ide-detection.js +124 -0
- package/src/utils/interactive-backup.js +5664 -0
- package/src/utils/interactive-broken.js +280 -0
- package/src/utils/interactive.js +31 -5534
- package/src/utils/provider-checker.js +410 -0
- package/src/utils/provider-manager.js +251 -0
- package/src/utils/provider-registry.js +18 -9
- package/src/utils/requirement-actions.js +884 -0
- package/src/utils/requirements-navigator.js +585 -0
- package/src/utils/rui-trui-adapter.js +311 -0
- package/src/utils/simple-trui.js +204 -0
- package/src/utils/status-helpers-extracted.js +125 -0
- package/src/utils/status-helpers.js +107 -0
- package/src/utils/trui-debug.js +261 -0
- package/src/utils/trui-feedback.js +133 -0
- package/src/utils/trui-nav-agents.js +119 -0
- package/src/utils/trui-nav-requirements.js +268 -0
- package/src/utils/trui-nav-settings.js +157 -0
- package/src/utils/trui-nav-specifications.js +139 -0
- package/src/utils/trui-navigation.js +303 -0
- package/src/utils/trui-provider-manager.js +182 -0
- package/src/utils/trui-quick-menu.js +365 -0
- package/src/utils/trui-req-actions.js +372 -0
- package/src/utils/trui-req-tree.js +534 -0
- package/src/utils/trui-specifications.js +359 -0
- package/src/utils/trui-text-editor.js +350 -0
- package/src/utils/trui-windsurf.js +336 -0
- package/src/utils/welcome-screen-extracted.js +135 -0
- package/src/utils/welcome-screen.js +134 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
const inquirer = require('inquirer');
|
|
2
|
+
const chalk = require('chalk');
|
|
3
|
+
const boxen = require('boxen');
|
|
4
|
+
const readline = require('readline');
|
|
5
|
+
const { t, getHostname, requirementsExists, isGitRepo, getCurrentBranch, hasUncommittedChanges, getRepoPath, getRequirementsPath, parseRequirementsFromContent, bootstrapProjectIfInHomeDir } = require('vibecodingmachine-core');
|
|
6
|
+
const { checkAutoModeStatus } = require('./auto-mode');
|
|
7
|
+
|
|
8
|
+
// Import all the refactored modules
|
|
9
|
+
const { checkVSCodeExtension, checkAppOrBinary } = require('./ide-detection');
|
|
10
|
+
const { formatIDEName, getAgentDisplayName, formatPath } = require('./display-formatters');
|
|
11
|
+
const { countRequirements, getSyncStatus, getCurrentProgress } = require('./status-helpers');
|
|
12
|
+
const { showWelcomeScreen } = require('./welcome-screen');
|
|
13
|
+
const { showRequirementsTree } = require('./requirements-navigator');
|
|
14
|
+
const { handleFeedbackSubmission } = require('./feedback-handler');
|
|
15
|
+
const { confirmAndExit, showGoodbyeMessage } = require('./requirement-actions');
|
|
16
|
+
const { showProviderManagerMenu } = require('./provider-manager');
|
|
17
|
+
|
|
18
|
+
// Import other required modules
|
|
19
|
+
const { getAutoConfig, getProviderCache, setProviderCache } = require('./config');
|
|
20
|
+
const { stopAutoMode } = require('./auto-mode');
|
|
21
|
+
const repo = require('../commands/repo');
|
|
22
|
+
const auto = require('../commands/auto');
|
|
23
|
+
const status = require('../commands/status');
|
|
24
|
+
const requirements = require('../commands/requirements');
|
|
25
|
+
const { getProviderPreferences, saveProviderPreferences, getProviderDefinitions } = require('../utils/provider-registry');
|
|
26
|
+
const { promptWithDefaultsOnce } = require('./prompt-helper');
|
|
27
|
+
const { formatResetsAtLabel } = require('./date-formatter');
|
|
28
|
+
|
|
29
|
+
// Initialize locale detection for interactive mode
|
|
30
|
+
const { detectLocale, setLocale } = require('vibecodingmachine-core');
|
|
31
|
+
const detectedLocale = detectLocale();
|
|
32
|
+
setLocale(detectedLocale);
|
|
33
|
+
|
|
34
|
+
const pkg = require('../../package.json');
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Main interactive CLI entry point
|
|
38
|
+
*/
|
|
39
|
+
async function startInteractive() {
|
|
40
|
+
// STRICT AUTH CHECK (only if enabled)
|
|
41
|
+
const authEnabled = process.env.AUTH_ENABLED === 'true';
|
|
42
|
+
|
|
43
|
+
if (authEnabled) {
|
|
44
|
+
const auth = require('./auth');
|
|
45
|
+
const isAuth = await auth.isAuthenticated();
|
|
46
|
+
|
|
47
|
+
if (!isAuth) {
|
|
48
|
+
console.clear();
|
|
49
|
+
console.log(chalk.bold.cyan('\nVibe Coding Machine CLI'));
|
|
50
|
+
console.log(chalk.cyan('\n๐ Authentication Required'));
|
|
51
|
+
console.log(chalk.gray('Opening browser for Google authentication...\n'));
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
await auth.login();
|
|
55
|
+
console.log(chalk.green('\nโ Authentication successful!\n'));
|
|
56
|
+
// Continue to interactive mode after successful login
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error(chalk.red('\nโ Login failed:'), error.message);
|
|
59
|
+
if (error.message && error.message.includes('redirect_uri_mismatch')) {
|
|
60
|
+
console.log(chalk.yellow('\nโ ๏ธ Troubleshooting:'));
|
|
61
|
+
console.log(chalk.gray('This error usually means the redirect URI is not whitelisted in Google Cloud Console.'));
|
|
62
|
+
console.log(chalk.gray('Ensure "https://<your-cognito-domain>/oauth2/idpresponse" is added to "Authorized redirect URIs".'));
|
|
63
|
+
}
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
// Auth disabled - show warning
|
|
69
|
+
console.log(chalk.yellow('\nโ ๏ธ Authentication is currently disabled'));
|
|
70
|
+
console.log(chalk.gray('Set AUTH_ENABLED=true to enable authentication\n'));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Ensure Auto Mode is stopped when CLI starts
|
|
74
|
+
await stopAutoMode('startup');
|
|
75
|
+
|
|
76
|
+
await showWelcomeScreen();
|
|
77
|
+
|
|
78
|
+
if (process.env.VCM_OPEN_PROVIDER_MENU === '1' || process.env.VCM_OPEN_PROVIDER_MENU === 'true') {
|
|
79
|
+
await showProviderManagerMenu();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
let exit = false;
|
|
84
|
+
let lastSelectedIndex = 0; // Track last selected menu item
|
|
85
|
+
while (!exit) {
|
|
86
|
+
try {
|
|
87
|
+
const autoStatus = await checkAutoModeStatus();
|
|
88
|
+
const hostname = getHostname();
|
|
89
|
+
|
|
90
|
+
// Get current IDE from config
|
|
91
|
+
const autoConfig = await getAutoConfig();
|
|
92
|
+
|
|
93
|
+
// Check for requirements file
|
|
94
|
+
const hasRequirements = await requirementsExists();
|
|
95
|
+
|
|
96
|
+
// Count requirements if file exists
|
|
97
|
+
const counts = hasRequirements ? await countRequirements() : null;
|
|
98
|
+
|
|
99
|
+
// Clear the screen using console.clear() for better cross-platform compatibility
|
|
100
|
+
console.clear();
|
|
101
|
+
|
|
102
|
+
// Display welcome banner with version
|
|
103
|
+
console.log('\n' + boxen(
|
|
104
|
+
chalk.bold.cyan('Vibe Coding Machine!') + '\n' +
|
|
105
|
+
chalk.gray(`v${pkg.version}`) + '\n' +
|
|
106
|
+
chalk.gray(t('banner.tagline')),
|
|
107
|
+
{
|
|
108
|
+
padding: 1,
|
|
109
|
+
margin: 0,
|
|
110
|
+
borderStyle: 'round',
|
|
111
|
+
borderColor: 'cyan'
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
|
|
115
|
+
// Display feedback hint at the top of every screen
|
|
116
|
+
console.log(chalk.gray('๐ก Press F for feedback - Share your thoughts anytime'));
|
|
117
|
+
|
|
118
|
+
// Display repository and system info
|
|
119
|
+
console.log();
|
|
120
|
+
const repoPath = process.cwd();
|
|
121
|
+
console.log(chalk.gray(t('system.repo').padEnd(25)), formatPath(repoPath));
|
|
122
|
+
|
|
123
|
+
// Display git branch if in a git repo
|
|
124
|
+
try {
|
|
125
|
+
if (isGitRepo(repoPath)) {
|
|
126
|
+
const branch = getCurrentBranch(repoPath);
|
|
127
|
+
if (branch) {
|
|
128
|
+
const isDirty = hasUncommittedChanges(repoPath);
|
|
129
|
+
const branchDisplay = isDirty ? `${chalk.cyan(branch)} ${chalk.yellow(t('system.git.status.dirty'))}` : chalk.cyan(branch);
|
|
130
|
+
console.log(chalk.gray(t('system.git.branch').padEnd(25)), branchDisplay);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
} catch (error) {
|
|
134
|
+
// Ignore git display errors
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
console.log(chalk.gray(t('system.computer.name').padEnd(25)), chalk.cyan(hostname));
|
|
138
|
+
|
|
139
|
+
// Display auto mode progress if running
|
|
140
|
+
if (autoStatus.running) {
|
|
141
|
+
console.log(chalk.gray('Chats: '), chalk.cyan(autoStatus.chatCount || 0));
|
|
142
|
+
|
|
143
|
+
// Get current status and requirement from REQUIREMENTS file
|
|
144
|
+
const progress = await getCurrentProgress();
|
|
145
|
+
if (progress) {
|
|
146
|
+
console.log();
|
|
147
|
+
// Display progress in a purple/magenta box similar to UI
|
|
148
|
+
const stageIcons = {
|
|
149
|
+
'PREPARE': '๐',
|
|
150
|
+
'ACT': 'โก',
|
|
151
|
+
'CLEAN UP': '๐งน',
|
|
152
|
+
'VERIFY': 'โ
',
|
|
153
|
+
'DONE': '๐'
|
|
154
|
+
};
|
|
155
|
+
const icon = stageIcons[progress.status] || 'โณ';
|
|
156
|
+
const statusColor = progress.status === 'DONE' ? chalk.green : chalk.magenta;
|
|
157
|
+
|
|
158
|
+
// Truncate requirement text first, THEN apply color to fix box alignment
|
|
159
|
+
const requirementText = progress.requirement ? progress.requirement.substring(0, 60) + (progress.requirement.length > 60 ? '...' : '') : 'No requirement';
|
|
160
|
+
|
|
161
|
+
console.log(boxen(
|
|
162
|
+
statusColor.bold(`${icon} ${progress.status}`) + '\n' +
|
|
163
|
+
chalk.gray(requirementText),
|
|
164
|
+
{
|
|
165
|
+
padding: { left: 1, right: 1, top: 0, bottom: 0 },
|
|
166
|
+
margin: 0,
|
|
167
|
+
borderStyle: 'round',
|
|
168
|
+
borderColor: 'magenta',
|
|
169
|
+
width: 70
|
|
170
|
+
}
|
|
171
|
+
));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Display sync status
|
|
176
|
+
const syncStatus = await getSyncStatus();
|
|
177
|
+
console.log(chalk.gray('Sync: '), syncStatus);
|
|
178
|
+
|
|
179
|
+
// Display requirements summary if available
|
|
180
|
+
if (counts && counts.total > 0) {
|
|
181
|
+
console.log(chalk.gray('Requirements: '), `${chalk.cyan(counts.total)} total (${chalk.green(counts.verifiedCount)} verified, ${chalk.yellow(counts.toVerifyCount)} to verify, ${chalk.red(counts.todoCount)} todo)`);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
console.log();
|
|
185
|
+
|
|
186
|
+
// Build menu options
|
|
187
|
+
const menuOptions = [
|
|
188
|
+
{ name: '๐ Requirements', value: 'requirements' },
|
|
189
|
+
{ name: '๐ Start Auto Mode', value: 'start-auto' },
|
|
190
|
+
{ name: 'โ๏ธ Configure Providers', value: 'providers' },
|
|
191
|
+
{ name: '๐ Status', value: 'status' },
|
|
192
|
+
{ name: '๐ Sync', value: 'sync' },
|
|
193
|
+
{ name: '๐ Requirements (CLI)', value: 'requirements-cli' },
|
|
194
|
+
{ name: '๐ Repo Issues', value: 'repo' },
|
|
195
|
+
{ name: 'โ Exit', value: 'exit' }
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
// Add feedback option
|
|
199
|
+
menuOptions.splice(-1, 0, { name: '๐ฃ Feedback', value: 'feedback' });
|
|
200
|
+
|
|
201
|
+
// Use last selected index as default
|
|
202
|
+
const defaultIndex = Math.min(lastSelectedIndex, menuOptions.length - 1);
|
|
203
|
+
|
|
204
|
+
const { choice } = await inquirer.prompt([{
|
|
205
|
+
type: 'list',
|
|
206
|
+
name: 'choice',
|
|
207
|
+
message: 'What would you like to do?',
|
|
208
|
+
choices: menuOptions,
|
|
209
|
+
default: defaultIndex
|
|
210
|
+
}]);
|
|
211
|
+
|
|
212
|
+
// Update last selected index
|
|
213
|
+
lastSelectedIndex = menuOptions.findIndex(option => option.value === choice);
|
|
214
|
+
|
|
215
|
+
// Handle menu choice
|
|
216
|
+
switch (choice) {
|
|
217
|
+
case 'requirements':
|
|
218
|
+
await showRequirementsTree();
|
|
219
|
+
break;
|
|
220
|
+
|
|
221
|
+
case 'start-auto':
|
|
222
|
+
await auto.start({ interactive: true });
|
|
223
|
+
break;
|
|
224
|
+
|
|
225
|
+
case 'providers':
|
|
226
|
+
await showProviderManagerMenu();
|
|
227
|
+
break;
|
|
228
|
+
|
|
229
|
+
case 'status':
|
|
230
|
+
await status.show();
|
|
231
|
+
break;
|
|
232
|
+
|
|
233
|
+
case 'sync':
|
|
234
|
+
const { sync } = require('../commands/sync');
|
|
235
|
+
await sync.start();
|
|
236
|
+
break;
|
|
237
|
+
|
|
238
|
+
case 'requirements-cli':
|
|
239
|
+
await requirements.show();
|
|
240
|
+
break;
|
|
241
|
+
|
|
242
|
+
case 'repo':
|
|
243
|
+
await repo.show();
|
|
244
|
+
break;
|
|
245
|
+
|
|
246
|
+
case 'feedback':
|
|
247
|
+
await handleFeedbackSubmission();
|
|
248
|
+
break;
|
|
249
|
+
|
|
250
|
+
case 'exit':
|
|
251
|
+
exit = true;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
} catch (error) {
|
|
256
|
+
console.error(chalk.red('Error:'), error.message);
|
|
257
|
+
console.log(chalk.gray('\nPress Enter to continue...'));
|
|
258
|
+
await new Promise(resolve => {
|
|
259
|
+
const rl = readline.createInterface({
|
|
260
|
+
input: process.stdin,
|
|
261
|
+
output: process.stdout
|
|
262
|
+
});
|
|
263
|
+
rl.question('', () => {
|
|
264
|
+
rl.close();
|
|
265
|
+
resolve();
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
showGoodbyeMessage();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
module.exports = {
|
|
275
|
+
startInteractive,
|
|
276
|
+
showProviderManagerMenu,
|
|
277
|
+
/* exported for tests */
|
|
278
|
+
parseRequirementsFromContent,
|
|
279
|
+
bootstrapProjectIfInHomeDir
|
|
280
|
+
};
|