vibecodingmachine-cli 1.0.12 → 1.0.14

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 CHANGED
@@ -72,7 +72,7 @@ vcm interactive
72
72
 
73
73
  ## Configuration
74
74
  - Stored at `~/.config/vibecodingmachine/config.json` by default
75
- - Override for testing with env var `ALLNIGHTAI_CONFIG_PATH=/tmp/your-test-config.json`
75
+ - Override for testing with env var `VIBECODINGMACHINE_CONFIG_PATH=/tmp/your-test-config.json`
76
76
 
77
77
  ## Development
78
78
  ```bash
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "vibecodingmachine-cli",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Command-line interface for Vibe Coding Machine - Autonomous development",
5
5
  "main": "src/index.js",
6
6
  "bin": {
7
- "vibecodingmachine": "./bin/vibecodingmachine.js",
8
- "vcm": "./bin/vibecodingmachine.js"
7
+ "vibecodingmachine": "./bin/vibecodingmachine.js"
9
8
  },
10
9
  "scripts": {
11
10
  "postinstall": "node scripts/postinstall.js",
@@ -34,7 +34,7 @@ function checkForExistingAna() {
34
34
  const content = fs.readFileSync(vcmPath, 'utf8');
35
35
 
36
36
  // Check if this is our VibeCodingMachine binary
37
- if (content.includes('VibeCodingMachine CLI') || content.includes('allnightai')) {
37
+ if (content.includes('VibeCodingMachine CLI') || content.includes('vibecodingmachine')) {
38
38
  // It's ours, all good
39
39
  console.log(chalk.green('\n✓ Vibe Coding Machine CLI installed successfully!'));
40
40
  console.log(chalk.gray(' You can use either:'));
package/src/utils/auth.js CHANGED
@@ -3,12 +3,13 @@ const http = require('http');
3
3
  const crypto = require('crypto');
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
+ const net = require('net');
6
7
  const sharedAuth = require('vibecodingmachine-core/src/auth/shared-auth-storage');
7
8
 
8
9
  // AWS Cognito configuration
9
- const COGNITO_DOMAIN = process.env.COGNITO_DOMAIN || 'allnightai-auth-1763598779.auth.us-east-1.amazoncognito.com';
10
+ const COGNITO_DOMAIN = process.env.COGNITO_DOMAIN || 'vibecodingmachine-auth-1763598779.auth.us-east-1.amazoncognito.com';
10
11
  const CLIENT_ID = process.env.COGNITO_APP_CLIENT_ID || '3tbe1i2g36uqule92iuk6snuo3'; // Public client (no secret)
11
- const PORT = 3000;
12
+ const PREFERRED_PORT = 3000; // Preferred port, will auto-detect if unavailable
12
13
 
13
14
  // Load shared access denied HTML
14
15
  function getAccessDeniedHTML() {
@@ -237,10 +238,38 @@ class CLIAuth {
237
238
  return this._loginHeadless();
238
239
  }
239
240
 
241
+ // Check if port 3000 is available (required for OAuth callback)
242
+ const PORT = PREFERRED_PORT;
243
+ const portAvailable = await new Promise((resolve) => {
244
+ const testServer = net.createServer();
245
+ testServer.once('error', (err) => {
246
+ if (err.code === 'EADDRINUSE') {
247
+ resolve(false);
248
+ } else {
249
+ resolve(true);
250
+ }
251
+ });
252
+ testServer.once('listening', () => {
253
+ testServer.close(() => resolve(true));
254
+ });
255
+ testServer.listen(PORT);
256
+ });
257
+
258
+ if (!portAvailable) {
259
+ console.log(chalk.red(`\n❌ Port ${PORT} is already in use!\n`));
260
+ console.log(chalk.yellow('Port 3000 is required for authentication (OAuth callback).\n'));
261
+ console.log(chalk.white('To fix this, find and stop the process using port 3000:\n'));
262
+ console.log(chalk.gray(' 1. Find the process: ') + chalk.cyan(`lsof -i :${PORT}`));
263
+ console.log(chalk.gray(' 2. Stop it: ') + chalk.cyan('kill <PID>'));
264
+ console.log(chalk.gray('\nOr if you\'re running the web dev server:'));
265
+ console.log(chalk.gray(' ') + chalk.cyan('cd packages/web && npm stop\n'));
266
+ throw new Error(`Port ${PORT} is already in use. Please free up this port and try again.`);
267
+ }
268
+
240
269
  // VS Code Remote SSH - use optimized flow with instructions
241
270
  if (isVSCodeRemote && !options.headless) {
242
271
  console.log(chalk.cyan('\n🔐 VS Code Remote SSH Detected!\n'));
243
- console.log(chalk.yellow('⚠️ IMPORTANT: VS Code will show "Port 3000 is now available"'));
272
+ console.log(chalk.yellow(`⚠️ IMPORTANT: VS Code will show "Port ${PORT} is now available"`));
244
273
  console.log(chalk.yellow(' → DO NOT click that notification!'));
245
274
  console.log(chalk.yellow(' → Instead, Ctrl+Click the authentication URL shown below\n'));
246
275
  }
@@ -6,7 +6,7 @@ const DEFAULT_CONFIG_DIR = path.join(os.homedir(), '.config', 'vibecodingmachine
6
6
  const DEFAULT_CONFIG_PATH = path.join(DEFAULT_CONFIG_DIR, 'config.json');
7
7
 
8
8
  function getConfigPath() {
9
- const override = process.env.ALLNIGHTAI_CONFIG_PATH;
9
+ const override = process.env.VIBECODINGMACHINE_CONFIG_PATH;
10
10
  if (override) return override;
11
11
  return DEFAULT_CONFIG_PATH;
12
12
  }
@@ -7,14 +7,14 @@ describe('auto-mode utils', () => {
7
7
  const tmpRepo = path.join(os.tmpdir(), `vibecodingmachine_test_repo_${Date.now()}`);
8
8
 
9
9
  beforeAll(async () => {
10
- process.env.ALLNIGHTAI_CONFIG_PATH = tmpConfig;
10
+ process.env.VIBECODINGMACHINE_CONFIG_PATH = tmpConfig;
11
11
  await fs.ensureDir(path.join(tmpRepo, '.vibecodingmachine', 'temp'));
12
12
  const { setRepoPath } = require('../src/utils/config');
13
13
  await setRepoPath(tmpRepo);
14
14
  });
15
15
 
16
16
  afterAll(async () => {
17
- delete process.env.ALLNIGHTAI_CONFIG_PATH;
17
+ delete process.env.VIBECODINGMACHINE_CONFIG_PATH;
18
18
  await fs.remove(tmpConfig).catch(() => {});
19
19
  await fs.remove(tmpRepo).catch(() => {});
20
20
  });
@@ -6,11 +6,11 @@ describe('config utils', () => {
6
6
  const tmpConfig = path.join(os.tmpdir(), `vibecodingmachine_test_config_${Date.now()}.json`);
7
7
 
8
8
  beforeAll(() => {
9
- process.env.ALLNIGHTAI_CONFIG_PATH = tmpConfig;
9
+ process.env.VIBECODINGMACHINE_CONFIG_PATH = tmpConfig;
10
10
  });
11
11
 
12
12
  afterAll(async () => {
13
- delete process.env.ALLNIGHTAI_CONFIG_PATH;
13
+ delete process.env.VIBECODINGMACHINE_CONFIG_PATH;
14
14
  await fs.remove(tmpConfig).catch(() => {});
15
15
  });
16
16