vortix 1.0.3 → 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.
- package/bin/vortix.js +66 -21
- package/package.json +1 -1
package/bin/vortix.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const os = require('os');
|
|
4
6
|
|
|
5
7
|
const command = process.argv[2];
|
|
6
8
|
|
|
@@ -9,21 +11,70 @@ const packageRoot = path.join(__dirname, '..');
|
|
|
9
11
|
const agentPath = path.join(packageRoot, 'agent', 'agent.js');
|
|
10
12
|
const backendPath = path.join(packageRoot, 'backend', 'server.js');
|
|
11
13
|
|
|
14
|
+
// Check if this is first run
|
|
15
|
+
const configPath = path.join(os.homedir(), '.vortix-config.json');
|
|
16
|
+
const firstRunFlagPath = path.join(os.homedir(), '.vortix-first-run');
|
|
17
|
+
|
|
18
|
+
function showWelcome() {
|
|
19
|
+
const colors = {
|
|
20
|
+
reset: '\x1b[0m',
|
|
21
|
+
bright: '\x1b[1m',
|
|
22
|
+
green: '\x1b[32m',
|
|
23
|
+
cyan: '\x1b[36m',
|
|
24
|
+
yellow: '\x1b[33m',
|
|
25
|
+
magenta: '\x1b[35m',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
console.log('\n');
|
|
29
|
+
console.log(colors.bright + colors.green + ' ╦ ╦┌─┐┬─┐┌┬┐┬─┐ ┬' + colors.reset);
|
|
30
|
+
console.log(colors.bright + colors.green + ' ╚╗╔╝│ │├┬┘ │ │┌┴┬┘' + colors.reset);
|
|
31
|
+
console.log(colors.bright + colors.green + ' ╚╝ └─┘┴└─ ┴ ┴┴ └─' + colors.reset);
|
|
32
|
+
console.log('\n');
|
|
33
|
+
console.log(colors.bright + colors.cyan + ' 🚀 Welcome to Vortix!' + colors.reset);
|
|
34
|
+
console.log(colors.yellow + ' AI-Powered Remote OS Control' + colors.reset);
|
|
35
|
+
console.log('\n');
|
|
36
|
+
console.log(colors.bright + ' 📖 Quick Start:' + colors.reset);
|
|
37
|
+
console.log('');
|
|
38
|
+
console.log(' ' + colors.cyan + '1.' + colors.reset + ' Set device password:');
|
|
39
|
+
console.log(' ' + colors.green + 'vortix login' + colors.reset);
|
|
40
|
+
console.log('');
|
|
41
|
+
console.log(' ' + colors.cyan + '2.' + colors.reset + ' Start the agent:');
|
|
42
|
+
console.log(' ' + colors.green + 'vortix start' + colors.reset);
|
|
43
|
+
console.log('');
|
|
44
|
+
console.log(' ' + colors.cyan + '3.' + colors.reset + ' Open dashboard:');
|
|
45
|
+
console.log(' ' + colors.magenta + colors.bright + 'https://vortixai.vercel.app' + colors.reset);
|
|
46
|
+
console.log('');
|
|
47
|
+
console.log(colors.yellow + ' ⚡ Pro Tip: ' + colors.reset + 'Use AI commands in the dashboard for natural language control!');
|
|
48
|
+
console.log('');
|
|
49
|
+
}
|
|
50
|
+
|
|
12
51
|
function showHelp() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
52
|
+
showWelcome();
|
|
53
|
+
console.log(' 📚 Available Commands:\n');
|
|
54
|
+
console.log(' vortix login Set device password');
|
|
55
|
+
console.log(' vortix start Start the agent');
|
|
56
|
+
console.log(' vortix backend Start backend server (dev only)');
|
|
57
|
+
console.log(' vortix help Show this help message');
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log(' 📖 Documentation:');
|
|
60
|
+
console.log(' https://github.com/Vaibhav262610/vortix');
|
|
61
|
+
console.log('');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Show welcome message on first run or if no command provided
|
|
65
|
+
if (!command || command === 'help' || command === '--help' || command === '-h') {
|
|
66
|
+
if (!fs.existsSync(firstRunFlagPath) && !command) {
|
|
67
|
+
// First run without command
|
|
68
|
+
showWelcome();
|
|
69
|
+
fs.writeFileSync(firstRunFlagPath, Date.now().toString());
|
|
70
|
+
process.exit(0);
|
|
71
|
+
} else if (command === 'help' || command === '--help' || command === '-h') {
|
|
72
|
+
showHelp();
|
|
73
|
+
process.exit(0);
|
|
74
|
+
} else if (!command) {
|
|
75
|
+
showHelp();
|
|
76
|
+
process.exit(0);
|
|
77
|
+
}
|
|
27
78
|
}
|
|
28
79
|
|
|
29
80
|
function runAgent(cmd) {
|
|
@@ -70,12 +121,6 @@ switch (command) {
|
|
|
70
121
|
runBackend();
|
|
71
122
|
break;
|
|
72
123
|
|
|
73
|
-
case 'help':
|
|
74
|
-
case '--help':
|
|
75
|
-
case '-h':
|
|
76
|
-
showHelp();
|
|
77
|
-
break;
|
|
78
|
-
|
|
79
124
|
default:
|
|
80
125
|
console.log('Unknown command:', command);
|
|
81
126
|
showHelp();
|