vibecodingmachine-cli 1.0.5 → 1.0.6

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 (37) hide show
  1. package/.allnightai/REQUIREMENTS.md +11 -11
  2. package/.allnightai/temp/auto-status.json +6 -0
  3. package/.env +7 -0
  4. package/.eslintrc.js +16 -16
  5. package/README.md +85 -85
  6. package/bin/vibecodingmachine.js +274 -274
  7. package/jest.config.js +8 -8
  8. package/logs/audit/2025-11-07.jsonl +2 -2
  9. package/package.json +62 -62
  10. package/scripts/README.md +128 -128
  11. package/scripts/auto-start-wrapper.sh +92 -92
  12. package/scripts/postinstall.js +81 -81
  13. package/src/commands/auth.js +96 -96
  14. package/src/commands/auto-direct.js +1748 -1748
  15. package/src/commands/auto.js +4692 -4692
  16. package/src/commands/auto.js.bak +710 -710
  17. package/src/commands/ide.js +70 -70
  18. package/src/commands/repo.js +159 -159
  19. package/src/commands/requirements.js +161 -161
  20. package/src/commands/setup.js +91 -91
  21. package/src/commands/status.js +88 -88
  22. package/src/index.js +5 -5
  23. package/src/utils/auth.js +571 -577
  24. package/src/utils/auto-mode-ansi-ui.js +238 -238
  25. package/src/utils/auto-mode-simple-ui.js +161 -161
  26. package/src/utils/auto-mode-ui.js.bak.blessed +207 -207
  27. package/src/utils/auto-mode.js +65 -65
  28. package/src/utils/config.js +64 -64
  29. package/src/utils/interactive.js +3616 -3616
  30. package/src/utils/keyboard-handler.js +153 -152
  31. package/src/utils/logger.js +4 -4
  32. package/src/utils/persistent-header.js +116 -116
  33. package/src/utils/provider-registry.js +128 -128
  34. package/src/utils/status-card.js +120 -120
  35. package/src/utils/stdout-interceptor.js +127 -127
  36. package/tests/auto-mode.test.js +37 -37
  37. package/tests/config.test.js +34 -34
@@ -1,81 +1,81 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Post-install script to check if 'ana' command exists
5
- * and warn users if there's a conflict
6
- */
7
-
8
- const { execSync } = require('child_process');
9
- const chalk = require('chalk');
10
- const path = require('path');
11
- const fs = require('fs');
12
-
13
- function checkForExistingAna() {
14
- try {
15
- // Check if 'ana' command exists in PATH before installation
16
- // We need to check the actual binary, not symlinks
17
- const result = execSync('which ana 2>/dev/null || true', { encoding: 'utf8' });
18
- const anaPath = result.trim();
19
-
20
- if (!anaPath) {
21
- // No ana found - safe to install
22
- console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
23
- console.log(chalk.gray(' You can use either:'));
24
- console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
25
- console.log();
26
- return;
27
- }
28
-
29
- // Check if it's a real file (not a broken symlink from previous install)
30
- try {
31
- fs.accessSync(anaPath, fs.constants.X_OK);
32
-
33
- // Read the file to see if it's ours
34
- const content = fs.readFileSync(anaPath, 'utf8');
35
-
36
- // Check if this is our VibeCodingMachine binary
37
- if (content.includes('VibeCodingMachine CLI') || content.includes('allnightai')) {
38
- // It's ours, all good
39
- console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
40
- console.log(chalk.gray(' You can use either:'));
41
- console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
42
- console.log();
43
- return;
44
- }
45
-
46
- // It's NOT ours - there's a conflict
47
- console.log(chalk.yellow('\n⚠️ Warning: An existing "vcm" command was detected at:'));
48
- console.log(chalk.yellow(` ${anaPath}`));
49
- console.log(chalk.yellow('\n The "vcm" shortcut will NOT be installed to avoid conflicts.'));
50
- console.log(chalk.cyan(' You can still use the full command: ') + chalk.bold('vibecodingmachine'));
51
- console.log();
52
-
53
- // Remove ana from bin to prevent conflict
54
- const packageJsonPath = path.join(__dirname, '..', 'package.json');
55
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
56
-
57
- if (packageJson.bin && packageJson.bin.ana) {
58
- delete packageJson.bin.ana;
59
- fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
60
- console.log(chalk.gray(' ✓ Removed "ana" from bin configuration to prevent conflict\n'));
61
- }
62
- } catch (err) {
63
- // File doesn't exist or can't be read - probably safe to install
64
- console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
65
- console.log(chalk.gray(' You can use either:'));
66
- console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
67
- console.log();
68
- }
69
- } catch (error) {
70
- // Error running which - assume no ana exists
71
- console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
72
- console.log(chalk.gray(' You can use either:'));
73
- console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
74
- console.log();
75
- }
76
- }
77
-
78
- // Only run if not being installed as a dependency
79
- if (process.env.npm_config_global || process.env.npm_config_prefix) {
80
- checkForExistingAna();
81
- }
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install script to check if 'ana' command exists
5
+ * and warn users if there's a conflict
6
+ */
7
+
8
+ const { execSync } = require('child_process');
9
+ const chalk = require('chalk');
10
+ const path = require('path');
11
+ const fs = require('fs');
12
+
13
+ function checkForExistingAna() {
14
+ try {
15
+ // Check if 'ana' command exists in PATH before installation
16
+ // We need to check the actual binary, not symlinks
17
+ const result = execSync('which ana 2>/dev/null || true', { encoding: 'utf8' });
18
+ const anaPath = result.trim();
19
+
20
+ if (!anaPath) {
21
+ // No ana found - safe to install
22
+ console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
23
+ console.log(chalk.gray(' You can use either:'));
24
+ console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
25
+ console.log();
26
+ return;
27
+ }
28
+
29
+ // Check if it's a real file (not a broken symlink from previous install)
30
+ try {
31
+ fs.accessSync(anaPath, fs.constants.X_OK);
32
+
33
+ // Read the file to see if it's ours
34
+ const content = fs.readFileSync(anaPath, 'utf8');
35
+
36
+ // Check if this is our VibeCodingMachine binary
37
+ if (content.includes('VibeCodingMachine CLI') || content.includes('allnightai')) {
38
+ // It's ours, all good
39
+ console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
40
+ console.log(chalk.gray(' You can use either:'));
41
+ console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
42
+ console.log();
43
+ return;
44
+ }
45
+
46
+ // It's NOT ours - there's a conflict
47
+ console.log(chalk.yellow('\n⚠️ Warning: An existing "vcm" command was detected at:'));
48
+ console.log(chalk.yellow(` ${anaPath}`));
49
+ console.log(chalk.yellow('\n The "vcm" shortcut will NOT be installed to avoid conflicts.'));
50
+ console.log(chalk.cyan(' You can still use the full command: ') + chalk.bold('vibecodingmachine'));
51
+ console.log();
52
+
53
+ // Remove ana from bin to prevent conflict
54
+ const packageJsonPath = path.join(__dirname, '..', 'package.json');
55
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
56
+
57
+ if (packageJson.bin && packageJson.bin.ana) {
58
+ delete packageJson.bin.ana;
59
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
60
+ console.log(chalk.gray(' ✓ Removed "ana" from bin configuration to prevent conflict\n'));
61
+ }
62
+ } catch (err) {
63
+ // File doesn't exist or can't be read - probably safe to install
64
+ console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
65
+ console.log(chalk.gray(' You can use either:'));
66
+ console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
67
+ console.log();
68
+ }
69
+ } catch (error) {
70
+ // Error running which - assume no ana exists
71
+ console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
72
+ console.log(chalk.gray(' You can use either:'));
73
+ console.log(chalk.cyan(' vibecodingmachine') + chalk.gray(' or ') + chalk.cyan('vcm'));
74
+ console.log();
75
+ }
76
+ }
77
+
78
+ // Only run if not being installed as a dependency
79
+ if (process.env.npm_config_global || process.env.npm_config_prefix) {
80
+ checkForExistingAna();
81
+ }
@@ -1,96 +1,96 @@
1
- const chalk = require('chalk');
2
- const auth = require('../utils/auth');
3
-
4
- /**
5
- * Login command
6
- * @param {Object} options - Command options
7
- * @param {boolean} options.headless - Force headless mode (manual URL paste)
8
- */
9
- async function login(options = {}) {
10
- try {
11
- // Check if already authenticated
12
- const isAuth = await auth.isAuthenticated();
13
- if (isAuth) {
14
- const profile = await auth.getUserProfile();
15
- console.log(chalk.green(`\n✓ Already authenticated as ${chalk.bold(profile.email)}`));
16
- return;
17
- }
18
-
19
- // Start login flow (auto-detects headless or use explicit flag)
20
- const result = await auth.login({ headless: options.headless });
21
-
22
- // After successful authentication, start interactive mode
23
- if (result) {
24
- console.log(chalk.cyan('\n🚀 Starting interactive mode...\n'));
25
- const { startInteractive } = require('../utils/interactive');
26
- await startInteractive();
27
- }
28
- } catch (error) {
29
- console.error(chalk.red('\n✗ Login failed:'), error.message);
30
- process.exit(1);
31
- }
32
- }
33
-
34
- /**
35
- * Logout command
36
- */
37
- async function logout() {
38
- try {
39
- await auth.logout();
40
- console.log(chalk.green('\n✓ Logged out successfully'));
41
- } catch (error) {
42
- console.error(chalk.red('\n✗ Logout failed:'), error.message);
43
- process.exit(1);
44
- }
45
- }
46
-
47
- /**
48
- * Status command
49
- */
50
- async function status() {
51
- try {
52
- const isAuth = await auth.isAuthenticated();
53
-
54
- if (!isAuth) {
55
- console.log(chalk.yellow('\nNot authenticated'));
56
- console.log(`Run ${chalk.cyan('vcm auth:login')} to sign in`);
57
- return;
58
- }
59
-
60
- const profile = await auth.getUserProfile();
61
- const token = await auth.getToken();
62
-
63
- // Get usage stats
64
- const canRun = await auth.canRunAutoMode();
65
-
66
- console.log(chalk.bold('\n👤 User Profile:'));
67
- console.log(` Name: ${profile.name}`);
68
- console.log(` Email: ${profile.email}`);
69
- console.log(` Tier: ${profile.tier === 'premium' ? chalk.green('Premium 🌟') : 'Free'}`);
70
-
71
- console.log(chalk.bold('\n📊 Usage:'));
72
- if (canRun.features && canRun.features.unlimitedIterations) {
73
- console.log(` Daily Usage: ${canRun.todayUsage} iterations`);
74
- console.log(` Limit: ${chalk.green('Unlimited')} 🚀`);
75
- } else {
76
- const limitColor = canRun.todayUsage >= canRun.maxIterations ? chalk.red : chalk.green;
77
- console.log(` Daily Usage: ${limitColor(`${canRun.todayUsage}/${canRun.maxIterations}`)} iterations`);
78
- }
79
-
80
- if (!canRun.canRun) {
81
- console.log(chalk.red(`\n⚠️ ${canRun.reason}`));
82
- if (profile.tier !== 'premium') {
83
- console.log(chalk.gray('Upgrade to Premium for unlimited usage.'));
84
- }
85
- }
86
-
87
- } catch (error) {
88
- console.error(chalk.red('\n✗ Failed to check status:'), error.message);
89
- }
90
- }
91
-
92
- module.exports = {
93
- login,
94
- logout,
95
- status
96
- };
1
+ const chalk = require('chalk');
2
+ const auth = require('../utils/auth');
3
+
4
+ /**
5
+ * Login command
6
+ * @param {Object} options - Command options
7
+ * @param {boolean} options.headless - Force headless mode (manual URL paste)
8
+ */
9
+ async function login(options = {}) {
10
+ try {
11
+ // Check if already authenticated
12
+ const isAuth = await auth.isAuthenticated();
13
+ if (isAuth) {
14
+ const profile = await auth.getUserProfile();
15
+ console.log(chalk.green(`\n✓ Already authenticated as ${chalk.bold(profile.email)}`));
16
+ return;
17
+ }
18
+
19
+ // Start login flow (auto-detects headless or use explicit flag)
20
+ const result = await auth.login({ headless: options.headless });
21
+
22
+ // After successful authentication, start interactive mode
23
+ if (result) {
24
+ console.log(chalk.cyan('\n🚀 Starting interactive mode...\n'));
25
+ const { startInteractive } = require('../utils/interactive');
26
+ await startInteractive();
27
+ }
28
+ } catch (error) {
29
+ console.error(chalk.red('\n✗ Login failed:'), error.message);
30
+ process.exit(1);
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Logout command
36
+ */
37
+ async function logout() {
38
+ try {
39
+ await auth.logout();
40
+ console.log(chalk.green('\n✓ Logged out successfully'));
41
+ } catch (error) {
42
+ console.error(chalk.red('\n✗ Logout failed:'), error.message);
43
+ process.exit(1);
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Status command
49
+ */
50
+ async function status() {
51
+ try {
52
+ const isAuth = await auth.isAuthenticated();
53
+
54
+ if (!isAuth) {
55
+ console.log(chalk.yellow('\nNot authenticated'));
56
+ console.log(`Run ${chalk.cyan('vcm auth:login')} to sign in`);
57
+ return;
58
+ }
59
+
60
+ const profile = await auth.getUserProfile();
61
+ const token = await auth.getToken();
62
+
63
+ // Get usage stats
64
+ const canRun = await auth.canRunAutoMode();
65
+
66
+ console.log(chalk.bold('\n👤 User Profile:'));
67
+ console.log(` Name: ${profile.name}`);
68
+ console.log(` Email: ${profile.email}`);
69
+ console.log(` Tier: ${profile.tier === 'premium' ? chalk.green('Premium 🌟') : 'Free'}`);
70
+
71
+ console.log(chalk.bold('\n📊 Usage:'));
72
+ if (canRun.features && canRun.features.unlimitedIterations) {
73
+ console.log(` Daily Usage: ${canRun.todayUsage} iterations`);
74
+ console.log(` Limit: ${chalk.green('Unlimited')} 🚀`);
75
+ } else {
76
+ const limitColor = canRun.todayUsage >= canRun.maxIterations ? chalk.red : chalk.green;
77
+ console.log(` Daily Usage: ${limitColor(`${canRun.todayUsage}/${canRun.maxIterations}`)} iterations`);
78
+ }
79
+
80
+ if (!canRun.canRun) {
81
+ console.log(chalk.red(`\n⚠️ ${canRun.reason}`));
82
+ if (profile.tier !== 'premium') {
83
+ console.log(chalk.gray('Upgrade to Premium for unlimited usage.'));
84
+ }
85
+ }
86
+
87
+ } catch (error) {
88
+ console.error(chalk.red('\n✗ Failed to check status:'), error.message);
89
+ }
90
+ }
91
+
92
+ module.exports = {
93
+ login,
94
+ logout,
95
+ status
96
+ };