xkat-cli 2.0.14 → 2.0.15
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/checksums.json +5 -5
- package/bin/xkat-cli.js +24 -6
- package/package.json +1 -1
package/bin/checksums.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"xkat-agent-macos-aarch64": "
|
|
3
|
-
"xkat-agent-macos-x64": "
|
|
4
|
-
"xkat-agent-linux-x64": "
|
|
5
|
-
"xkat-agent-linux-aarch64": "
|
|
6
|
-
"xkat-agent-win-x64.exe": "
|
|
2
|
+
"xkat-agent-macos-aarch64": "e1b15cbea556bf1b7f1ec56e05a089eb5b1239a482eb195bef247fa65d233649",
|
|
3
|
+
"xkat-agent-macos-x64": "0c8041d95b3d7911ad9572cba9cc68ce86d5621d0040d516bbce40a23cf80544",
|
|
4
|
+
"xkat-agent-linux-x64": "581d35363debeff79b71b73d2d7d55c8273d8a0dadb5929c05532fa6d2004f8c",
|
|
5
|
+
"xkat-agent-linux-aarch64": "05aaff56d74dd66c50b9ddd848123c918660bee761da42973c22fd6bdc8000ca",
|
|
6
|
+
"xkat-agent-win-x64.exe": "ee568b3796c21558e1f483e43dfa810c0bca5354046b03a5b259ede0980df027"
|
|
7
7
|
}
|
package/bin/xkat-cli.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
process.env.NODE_NO_WARNINGS = '1';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* xkat-cli.js
|
|
5
7
|
* Lightweight CLI entry point for `npx -y xkat-cli@latest`.
|
|
6
|
-
* Launches the live local agent bridge in the
|
|
8
|
+
* Launches the live local agent bridge in the background by default,
|
|
7
9
|
* connecting your browser to your local environment with zero manual configuration.
|
|
8
10
|
*/
|
|
9
11
|
const { spawnSync } = require('child_process');
|
|
@@ -66,18 +68,34 @@ if (subCmd === 'down' || subCmd === 'stop' || subCmd === 'kill' || subCmd === 'c
|
|
|
66
68
|
process.exit(0);
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
function getMultipassCmd() {
|
|
72
|
+
if (os.platform() === 'win32') {
|
|
73
|
+
const candidates = [
|
|
74
|
+
'multipass',
|
|
75
|
+
path.join(process.env.ProgramFiles || 'C:\\Program Files', 'Multipass', 'bin', 'multipass.exe'),
|
|
76
|
+
path.join(process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)', 'Multipass', 'bin', 'multipass.exe'),
|
|
77
|
+
path.join(process.env.LOCALAPPDATA || '', 'Programs', 'Multipass', 'bin', 'multipass.exe'),
|
|
78
|
+
];
|
|
79
|
+
for (const c of candidates) {
|
|
80
|
+
if (c === 'multipass' || fs.existsSync(c)) return c;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return 'multipass';
|
|
84
|
+
}
|
|
85
|
+
|
|
69
86
|
// ── 2. Fallback for Lab VM commands when native agent is not built ──
|
|
70
87
|
if (!binaryPath) {
|
|
88
|
+
const mp = getMultipassCmd();
|
|
71
89
|
if (subCmd === 'lab shell') {
|
|
72
|
-
const result = spawnSync(
|
|
90
|
+
const result = spawnSync(mp, ['shell', LAB_NAME], { stdio: 'inherit', shell: os.platform() === 'win32' });
|
|
73
91
|
process.exit(result.status || 0);
|
|
74
92
|
}
|
|
75
93
|
|
|
76
94
|
if (subCmd === 'lab reset') {
|
|
77
95
|
console.log('🔄 Resetting Lab VM...');
|
|
78
|
-
spawnSync(
|
|
96
|
+
spawnSync(mp, ['delete', LAB_NAME, '--purge'], { stdio: 'inherit', shell: os.platform() === 'win32' });
|
|
79
97
|
console.log('🚀 Launching fresh Lab VM...');
|
|
80
|
-
const launch = spawnSync(
|
|
98
|
+
const launch = spawnSync(mp, ['launch', '--name', LAB_NAME, '24.04', '--cpus', '2', '--memory', '2G', '--disk', '10G'], { stdio: 'inherit', shell: os.platform() === 'win32' });
|
|
81
99
|
if (launch.status === 0) {
|
|
82
100
|
console.log('✅ Lab reset complete.');
|
|
83
101
|
console.log(' Enter: npx -y xkat-cli@latest lab shell');
|
|
@@ -88,10 +106,10 @@ if (!binaryPath) {
|
|
|
88
106
|
}
|
|
89
107
|
|
|
90
108
|
if (subCmd === 'lab up' || subCmd === 'lab install') {
|
|
91
|
-
const info = spawnSync(
|
|
109
|
+
const info = spawnSync(mp, ['info', LAB_NAME], { encoding: 'utf8', shell: os.platform() === 'win32' });
|
|
92
110
|
if (info.status !== 0) {
|
|
93
111
|
console.log('🚀 Creating Lab VM...');
|
|
94
|
-
const launch = spawnSync(
|
|
112
|
+
const launch = spawnSync(mp, ['launch', '--name', LAB_NAME, '24.04', '--cpus', '2', '--memory', '2G', '--disk', '10G'], { stdio: 'inherit', shell: os.platform() === 'win32' });
|
|
95
113
|
process.exit(launch.status || 0);
|
|
96
114
|
} else {
|
|
97
115
|
console.log(`✅ Lab VM '${LAB_NAME}' already exists.`);
|