-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
80 lines (70 loc) · 1.77 KB
/
index.js
File metadata and controls
80 lines (70 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env node
/**
* Everything opencode - Main Entry Point
*
* This file serves as the main entry point for the npm package.
* It provides a CLI interface for installation verification and
* integration with opencode.
*/
const path = require('path');
const fs = require('fs');
const { execSync } = require('child_process');
function showHelp() {
console.log(`
Everything opencode - Comprehensive plugin for opencode AI coding agent
Usage:
everything-opencode <command>
Commands:
verify Verify installation and configuration
test Run the test suite
help Show this help message
Examples:
npx everything-opencode verify
npx everything-opencode test
For more information, see:
https://github.com/yourusername/everything-opencode
`);
}
function runVerification() {
console.log('Running installation verification...\n');
try {
require('./scripts/verify-installation.js');
} catch (err) {
console.error('Verification failed:', err.message);
process.exit(1);
}
}
function runTests() {
console.log('Running test suite...\n');
try {
require('./tests/run-all.js');
} catch (err) {
console.error('Tests failed:', err.message);
process.exit(1);
}
}
// Main CLI logic
const args = process.argv.slice(2);
const command = args[0] || 'help';
switch (command) {
case 'verify':
runVerification();
break;
case 'test':
runTests();
break;
case 'help':
case '--help':
case '-h':
showHelp();
break;
case '--version':
case '-v':
const pkg = require('./package.json');
console.log(`everything-opencode v${pkg.version}`);
break;
default:
console.error(`Unknown command: ${command}`);
console.error('Use "everything-opencode help" for available commands.');
process.exit(1);
}