vibecodingmachine-cli 1.0.4 → 1.0.5

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/.eslintrc.js +16 -16
  3. package/README.md +85 -85
  4. package/bin/vibecodingmachine.js +274 -274
  5. package/jest.config.js +8 -8
  6. package/logs/audit/2025-11-07.jsonl +2 -2
  7. package/package.json +62 -66
  8. package/scripts/README.md +128 -128
  9. package/scripts/auto-start-wrapper.sh +92 -92
  10. package/scripts/postinstall.js +81 -81
  11. package/src/commands/auth.js +96 -96
  12. package/src/commands/auto-direct.js +1748 -1748
  13. package/src/commands/auto.js +4692 -4692
  14. package/src/commands/auto.js.bak +710 -710
  15. package/src/commands/ide.js +70 -70
  16. package/src/commands/repo.js +159 -159
  17. package/src/commands/requirements.js +161 -161
  18. package/src/commands/setup.js +91 -91
  19. package/src/commands/status.js +88 -88
  20. package/src/index.js +5 -5
  21. package/src/utils/auth.js +577 -577
  22. package/src/utils/auto-mode-ansi-ui.js +238 -238
  23. package/src/utils/auto-mode-simple-ui.js +161 -161
  24. package/src/utils/auto-mode-ui.js.bak.blessed +207 -207
  25. package/src/utils/auto-mode.js +65 -65
  26. package/src/utils/config.js +64 -64
  27. package/src/utils/interactive.js +3616 -3616
  28. package/src/utils/keyboard-handler.js +152 -152
  29. package/src/utils/logger.js +4 -4
  30. package/src/utils/persistent-header.js +116 -116
  31. package/src/utils/provider-registry.js +128 -128
  32. package/src/utils/status-card.js +120 -120
  33. package/src/utils/stdout-interceptor.js +127 -127
  34. package/tests/auto-mode.test.js +37 -37
  35. package/tests/config.test.js +34 -34
  36. package/.allnightai/temp/auto-status.json +0 -6
  37. package/.env +0 -7
@@ -1,70 +1,70 @@
1
- const chalk = require('chalk');
2
- const path = require('path');
3
- const ora = require('ora');
4
- const { AppleScriptManager } = require('vibecodingmachine-core');
5
- const { getRepoPath } = require('../utils/config');
6
-
7
- const IDES = ['cursor', 'vscode', 'windsurf', 'antigravity', 'cline'];
8
-
9
- async function list() {
10
- console.log(chalk.bold('\nAvailable IDEs'));
11
- for (const ide of IDES) console.log('-', chalk.cyan(ide));
12
- console.log();
13
- }
14
-
15
- async function open(ide) {
16
- const repoPath = await getRepoPath();
17
- if (!repoPath) {
18
- console.log(chalk.yellow('No repository path configured'));
19
- console.log(chalk.gray('Use'), chalk.cyan('vcm repo:init'), chalk.gray('or'), chalk.cyan('vcm repo:set <path>'));
20
- process.exit(1);
21
- }
22
- const ideKey = String(ide || '').toLowerCase();
23
- if (!IDES.includes(ideKey)) {
24
- console.log(chalk.red('Unknown IDE:'), ide);
25
- await list();
26
- process.exit(1);
27
- }
28
-
29
- const spinner = ora(`Opening ${ideKey}...`).start();
30
-
31
- try {
32
- const appleScriptManager = new AppleScriptManager();
33
-
34
- // Use AppleScriptManager to open IDE with repo path
35
- await appleScriptManager.openIDE(ideKey, repoPath);
36
-
37
- spinner.succeed(chalk.green(`Opened ${ideKey} at ${path.basename(repoPath)}`));
38
- } catch (error) {
39
- spinner.fail(chalk.red('Failed to open IDE'));
40
- console.error(chalk.red('Error:'), error.message);
41
- process.exit(1);
42
- }
43
- }
44
-
45
- async function send(message, options) {
46
- const ide = (options && options.ide) || 'cline';
47
- const spinner = ora(`Sending message to ${ide}...`).start();
48
-
49
- try {
50
- const appleScriptManager = new AppleScriptManager();
51
-
52
- // Use AppleScriptManager to send text to IDE AI chat
53
- await appleScriptManager.sendTextToIDE(ide, message);
54
-
55
- spinner.succeed(chalk.green(`Sent message to ${ide} AI chat`));
56
- } catch (error) {
57
- spinner.fail(chalk.red('Failed to send message'));
58
- console.error(chalk.red('Error:'), error.message);
59
- process.exit(1);
60
- }
61
- }
62
-
63
- module.exports = {
64
- list,
65
- open,
66
- send
67
- };
68
-
69
-
70
-
1
+ const chalk = require('chalk');
2
+ const path = require('path');
3
+ const ora = require('ora');
4
+ const { AppleScriptManager } = require('vibecodingmachine-core');
5
+ const { getRepoPath } = require('../utils/config');
6
+
7
+ const IDES = ['cursor', 'vscode', 'windsurf', 'antigravity', 'cline'];
8
+
9
+ async function list() {
10
+ console.log(chalk.bold('\nAvailable IDEs'));
11
+ for (const ide of IDES) console.log('-', chalk.cyan(ide));
12
+ console.log();
13
+ }
14
+
15
+ async function open(ide) {
16
+ const repoPath = await getRepoPath();
17
+ if (!repoPath) {
18
+ console.log(chalk.yellow('No repository path configured'));
19
+ console.log(chalk.gray('Use'), chalk.cyan('vcm repo:init'), chalk.gray('or'), chalk.cyan('vcm repo:set <path>'));
20
+ process.exit(1);
21
+ }
22
+ const ideKey = String(ide || '').toLowerCase();
23
+ if (!IDES.includes(ideKey)) {
24
+ console.log(chalk.red('Unknown IDE:'), ide);
25
+ await list();
26
+ process.exit(1);
27
+ }
28
+
29
+ const spinner = ora(`Opening ${ideKey}...`).start();
30
+
31
+ try {
32
+ const appleScriptManager = new AppleScriptManager();
33
+
34
+ // Use AppleScriptManager to open IDE with repo path
35
+ await appleScriptManager.openIDE(ideKey, repoPath);
36
+
37
+ spinner.succeed(chalk.green(`Opened ${ideKey} at ${path.basename(repoPath)}`));
38
+ } catch (error) {
39
+ spinner.fail(chalk.red('Failed to open IDE'));
40
+ console.error(chalk.red('Error:'), error.message);
41
+ process.exit(1);
42
+ }
43
+ }
44
+
45
+ async function send(message, options) {
46
+ const ide = (options && options.ide) || 'cline';
47
+ const spinner = ora(`Sending message to ${ide}...`).start();
48
+
49
+ try {
50
+ const appleScriptManager = new AppleScriptManager();
51
+
52
+ // Use AppleScriptManager to send text to IDE AI chat
53
+ await appleScriptManager.sendTextToIDE(ide, message);
54
+
55
+ spinner.succeed(chalk.green(`Sent message to ${ide} AI chat`));
56
+ } catch (error) {
57
+ spinner.fail(chalk.red('Failed to send message'));
58
+ console.error(chalk.red('Error:'), error.message);
59
+ process.exit(1);
60
+ }
61
+ }
62
+
63
+ module.exports = {
64
+ list,
65
+ open,
66
+ send
67
+ };
68
+
69
+
70
+
@@ -1,159 +1,159 @@
1
- const path = require('path');
2
- const fs = require('fs-extra');
3
- const chalk = require('chalk');
4
- const inquirer = require('inquirer');
5
- const { getRepoPath, setRepoPath } = require('../utils/config');
6
- const {
7
- checkVibeCodingMachineExists,
8
- getHostname,
9
- getRequirementsFilename,
10
- isComputerNameEnabled
11
- } = require('vibecodingmachine-core');
12
-
13
- async function setRepo(repoPath) {
14
- try {
15
- const absolutePath = path.resolve(repoPath);
16
-
17
- if (!await fs.pathExists(absolutePath)) {
18
- console.error(chalk.red(`Error: Directory does not exist: ${absolutePath}`));
19
- process.exit(1);
20
- }
21
-
22
- await setRepoPath(absolutePath);
23
- console.log(chalk.green('āœ“'), `Repository path set to: ${chalk.cyan(absolutePath)}`);
24
- } catch (error) {
25
- console.error(chalk.red('Error setting repository path:'), error.message);
26
- process.exit(1);
27
- }
28
- }
29
-
30
- async function getRepo() {
31
- try {
32
- const repoPath = await getRepoPath();
33
-
34
- if (!repoPath) {
35
- console.log(chalk.yellow('No repository path configured'));
36
- console.log(chalk.gray('Use'), chalk.cyan('vcm repo:set <path>'), chalk.gray('to set repository path'));
37
- return;
38
- }
39
-
40
- console.log(chalk.cyan(repoPath));
41
- } catch (error) {
42
- console.error(chalk.red('Error getting repository path:'), error.message);
43
- process.exit(1);
44
- }
45
- }
46
-
47
- async function initRepo() {
48
- try {
49
- const cwd = process.cwd();
50
- const repoName = path.basename(cwd);
51
- const insideDir = path.join(cwd, '.vibecodingmachine');
52
- const siblingDir = path.join(path.dirname(cwd), `.vibecodingmachine-${repoName}`);
53
-
54
- // Ask user where to create the directory
55
- const { location } = await inquirer.prompt([
56
- {
57
- type: 'list',
58
- name: 'location',
59
- message: 'Where would you like to create the VibeCodingMachine directory?',
60
- choices: [
61
- {
62
- name: `Inside this repository (${chalk.cyan('.vibecodingmachine')}) - suggested`,
63
- value: 'inside',
64
- short: 'Inside repository'
65
- },
66
- {
67
- name: `As a sibling directory (${chalk.cyan(`../.vibecodingmachine-${repoName}`)}) - keeps configs separate from code`,
68
- value: 'sibling',
69
- short: 'Sibling directory'
70
- }
71
- ],
72
- default: 'inside'
73
- }
74
- ]);
75
-
76
- const allnightDir = location === 'inside' ? insideDir : siblingDir;
77
-
78
- console.log(chalk.blue('\nInitializing VibeCodingMachine in:'), chalk.cyan(allnightDir));
79
-
80
- await fs.ensureDir(allnightDir);
81
- await fs.ensureDir(path.join(allnightDir, 'temp'));
82
- await fs.ensureDir(path.join(allnightDir, 'temp', 'screenshots'));
83
-
84
- // Check if computer name is enabled and use appropriate filename
85
- const useHostname = await isComputerNameEnabled();
86
- const hostname = getHostname();
87
- const requirementsFilename = await getRequirementsFilename();
88
- const requirementsPath = path.join(allnightDir, requirementsFilename);
89
-
90
- if (!await fs.pathExists(requirementsPath)) {
91
- const titleSuffix = useHostname ? ` (${hostname})` : '';
92
- const requirementsTemplate = `# VibeCodingMachine Requirements${titleSuffix}
93
-
94
- ## 🚦 Current Status
95
- PREPARE
96
-
97
- ## ā³ Requirements not yet completed
98
-
99
- ### Example Requirement
100
- Add your requirements here...
101
-
102
- ## āœ… Verified by AI
103
-
104
- ## āš ļø Issues Found
105
- `;
106
- await fs.writeFile(requirementsPath, requirementsTemplate);
107
- console.log(chalk.green('āœ“'), `Created ${requirementsFilename}`);
108
- }
109
-
110
- const instructionsPath = path.join(allnightDir, 'INSTRUCTIONS.md');
111
- if (!await fs.pathExists(instructionsPath)) {
112
- const fileNote = useHostname
113
- ? `**ALWAYS** use the hostname-specific requirements file:
114
- - File: \`${requirementsFilename}\`
115
- - This ensures each computer has its own requirements and progress tracking`
116
- : `**Requirements file:** \`REQUIREMENTS.md\``;
117
-
118
- const instructionsTemplate = `# Development Instructions
119
-
120
- ## Important: Requirements File
121
-
122
- ${fileNote}
123
-
124
- ## Guidelines
125
- - Follow the status progression: PREPARE → ACT → CLEAN UP → VERIFY → DONE
126
- - Update status in ${requirementsFilename} at each stage
127
- - Take screenshots during VERIFY phase
128
- - Mark requirement as DONE when complete
129
-
130
- ## Code Standards
131
- - Keep files under 250 lines
132
- - Follow DRY principles
133
- - Keep it simple (KISS)
134
- - No placeholder code
135
- - Prefix temporary files with TEMP_
136
- `;
137
- await fs.writeFile(instructionsPath, instructionsTemplate);
138
- console.log(chalk.green('āœ“'), 'Created INSTRUCTIONS.md');
139
- }
140
-
141
- await setRepoPath(cwd);
142
- console.log(chalk.green('āœ“'), 'Set repository path to current directory');
143
-
144
- console.log(chalk.green('\nāœ“ VibeCodingMachine initialized successfully!'));
145
- console.log(chalk.gray('\nNext steps:'));
146
- const configPath = location === 'inside' ? `.vibecodingmachine/${requirementsFilename}` : `../.vibecodingmachine-${repoName}/${requirementsFilename}`;
147
- console.log(chalk.gray(' 1. Edit'), chalk.cyan(configPath), chalk.gray('with your requirements'));
148
- console.log(chalk.gray(' 2. Run'), chalk.cyan('vcm auto:start'), chalk.gray('to begin autonomous development'));
149
- } catch (error) {
150
- console.error(chalk.red('Error initializing repository:'), error.message);
151
- process.exit(1);
152
- }
153
- }
154
-
155
- module.exports = {
156
- setRepo,
157
- getRepo,
158
- initRepo
159
- };
1
+ const path = require('path');
2
+ const fs = require('fs-extra');
3
+ const chalk = require('chalk');
4
+ const inquirer = require('inquirer');
5
+ const { getRepoPath, setRepoPath } = require('../utils/config');
6
+ const {
7
+ checkVibeCodingMachineExists,
8
+ getHostname,
9
+ getRequirementsFilename,
10
+ isComputerNameEnabled
11
+ } = require('vibecodingmachine-core');
12
+
13
+ async function setRepo(repoPath) {
14
+ try {
15
+ const absolutePath = path.resolve(repoPath);
16
+
17
+ if (!await fs.pathExists(absolutePath)) {
18
+ console.error(chalk.red(`Error: Directory does not exist: ${absolutePath}`));
19
+ process.exit(1);
20
+ }
21
+
22
+ await setRepoPath(absolutePath);
23
+ console.log(chalk.green('āœ“'), `Repository path set to: ${chalk.cyan(absolutePath)}`);
24
+ } catch (error) {
25
+ console.error(chalk.red('Error setting repository path:'), error.message);
26
+ process.exit(1);
27
+ }
28
+ }
29
+
30
+ async function getRepo() {
31
+ try {
32
+ const repoPath = await getRepoPath();
33
+
34
+ if (!repoPath) {
35
+ console.log(chalk.yellow('No repository path configured'));
36
+ console.log(chalk.gray('Use'), chalk.cyan('vcm repo:set <path>'), chalk.gray('to set repository path'));
37
+ return;
38
+ }
39
+
40
+ console.log(chalk.cyan(repoPath));
41
+ } catch (error) {
42
+ console.error(chalk.red('Error getting repository path:'), error.message);
43
+ process.exit(1);
44
+ }
45
+ }
46
+
47
+ async function initRepo() {
48
+ try {
49
+ const cwd = process.cwd();
50
+ const repoName = path.basename(cwd);
51
+ const insideDir = path.join(cwd, '.vibecodingmachine');
52
+ const siblingDir = path.join(path.dirname(cwd), `.vibecodingmachine-${repoName}`);
53
+
54
+ // Ask user where to create the directory
55
+ const { location } = await inquirer.prompt([
56
+ {
57
+ type: 'list',
58
+ name: 'location',
59
+ message: 'Where would you like to create the VibeCodingMachine directory?',
60
+ choices: [
61
+ {
62
+ name: `Inside this repository (${chalk.cyan('.vibecodingmachine')}) - suggested`,
63
+ value: 'inside',
64
+ short: 'Inside repository'
65
+ },
66
+ {
67
+ name: `As a sibling directory (${chalk.cyan(`../.vibecodingmachine-${repoName}`)}) - keeps configs separate from code`,
68
+ value: 'sibling',
69
+ short: 'Sibling directory'
70
+ }
71
+ ],
72
+ default: 'inside'
73
+ }
74
+ ]);
75
+
76
+ const allnightDir = location === 'inside' ? insideDir : siblingDir;
77
+
78
+ console.log(chalk.blue('\nInitializing VibeCodingMachine in:'), chalk.cyan(allnightDir));
79
+
80
+ await fs.ensureDir(allnightDir);
81
+ await fs.ensureDir(path.join(allnightDir, 'temp'));
82
+ await fs.ensureDir(path.join(allnightDir, 'temp', 'screenshots'));
83
+
84
+ // Check if computer name is enabled and use appropriate filename
85
+ const useHostname = await isComputerNameEnabled();
86
+ const hostname = getHostname();
87
+ const requirementsFilename = await getRequirementsFilename();
88
+ const requirementsPath = path.join(allnightDir, requirementsFilename);
89
+
90
+ if (!await fs.pathExists(requirementsPath)) {
91
+ const titleSuffix = useHostname ? ` (${hostname})` : '';
92
+ const requirementsTemplate = `# VibeCodingMachine Requirements${titleSuffix}
93
+
94
+ ## 🚦 Current Status
95
+ PREPARE
96
+
97
+ ## ā³ Requirements not yet completed
98
+
99
+ ### Example Requirement
100
+ Add your requirements here...
101
+
102
+ ## āœ… Verified by AI
103
+
104
+ ## āš ļø Issues Found
105
+ `;
106
+ await fs.writeFile(requirementsPath, requirementsTemplate);
107
+ console.log(chalk.green('āœ“'), `Created ${requirementsFilename}`);
108
+ }
109
+
110
+ const instructionsPath = path.join(allnightDir, 'INSTRUCTIONS.md');
111
+ if (!await fs.pathExists(instructionsPath)) {
112
+ const fileNote = useHostname
113
+ ? `**ALWAYS** use the hostname-specific requirements file:
114
+ - File: \`${requirementsFilename}\`
115
+ - This ensures each computer has its own requirements and progress tracking`
116
+ : `**Requirements file:** \`REQUIREMENTS.md\``;
117
+
118
+ const instructionsTemplate = `# Development Instructions
119
+
120
+ ## Important: Requirements File
121
+
122
+ ${fileNote}
123
+
124
+ ## Guidelines
125
+ - Follow the status progression: PREPARE → ACT → CLEAN UP → VERIFY → DONE
126
+ - Update status in ${requirementsFilename} at each stage
127
+ - Take screenshots during VERIFY phase
128
+ - Mark requirement as DONE when complete
129
+
130
+ ## Code Standards
131
+ - Keep files under 250 lines
132
+ - Follow DRY principles
133
+ - Keep it simple (KISS)
134
+ - No placeholder code
135
+ - Prefix temporary files with TEMP_
136
+ `;
137
+ await fs.writeFile(instructionsPath, instructionsTemplate);
138
+ console.log(chalk.green('āœ“'), 'Created INSTRUCTIONS.md');
139
+ }
140
+
141
+ await setRepoPath(cwd);
142
+ console.log(chalk.green('āœ“'), 'Set repository path to current directory');
143
+
144
+ console.log(chalk.green('\nāœ“ VibeCodingMachine initialized successfully!'));
145
+ console.log(chalk.gray('\nNext steps:'));
146
+ const configPath = location === 'inside' ? `.vibecodingmachine/${requirementsFilename}` : `../.vibecodingmachine-${repoName}/${requirementsFilename}`;
147
+ console.log(chalk.gray(' 1. Edit'), chalk.cyan(configPath), chalk.gray('with your requirements'));
148
+ console.log(chalk.gray(' 2. Run'), chalk.cyan('vcm auto:start'), chalk.gray('to begin autonomous development'));
149
+ } catch (error) {
150
+ console.error(chalk.red('Error initializing repository:'), error.message);
151
+ process.exit(1);
152
+ }
153
+ }
154
+
155
+ module.exports = {
156
+ setRepo,
157
+ getRepo,
158
+ initRepo
159
+ };