vmlive 1.0.11 → 1.0.13
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/package.json +1 -1
- package/src/cli.js +43 -10
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -683,21 +683,39 @@ const runLogin = async () => {
|
|
|
683
683
|
const runUpdate = async () => {
|
|
684
684
|
console.log('\x1b[36mUpdating vmlive to the latest version...\x1b[0m');
|
|
685
685
|
const { spawn } = await import('child_process');
|
|
686
|
-
|
|
686
|
+
|
|
687
687
|
const updateProcess = spawn('npm', ['install', 'vmlive@latest'], {
|
|
688
|
-
|
|
688
|
+
stdio: 'inherit'
|
|
689
689
|
});
|
|
690
690
|
|
|
691
691
|
updateProcess.on('exit', (code) => {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
692
|
+
if (code === 0) {
|
|
693
|
+
console.log('\n\x1b[32m✔ vmlive updated successfully!\x1b[0m');
|
|
694
|
+
} else {
|
|
695
|
+
console.error(`\n\x1b[31m❌ Update failed with exit code ${code}\x1b[0m`);
|
|
696
|
+
}
|
|
697
|
+
process.exit(code || 0);
|
|
698
698
|
});
|
|
699
699
|
};
|
|
700
700
|
|
|
701
|
+
const runLlm = async () => {
|
|
702
|
+
const GATEKEEPER_URL = process.env.GATEKEEPER_URL || 'https://api.vm.live';
|
|
703
|
+
console.log('\x1b[36mDownloading AI Context Guide...\x1b[0m');
|
|
704
|
+
try {
|
|
705
|
+
const res = await fetch(`${GATEKEEPER_URL}/vmlive-ai-rules.md`);
|
|
706
|
+
if (!res.ok) {
|
|
707
|
+
console.error('\x1b[31m❌ Failed to download AI rules:\x1b[0m', res.status);
|
|
708
|
+
process.exit(1);
|
|
709
|
+
}
|
|
710
|
+
const markdown = await res.text();
|
|
711
|
+
fs.writeFileSync(path.join(process.cwd(), 'vmlive-ai-rules.md'), markdown);
|
|
712
|
+
console.log('\x1b[32m✔ Successfully wrote vmlive-ai-rules.md to current directory.\x1b[0m');
|
|
713
|
+
console.log('\x1b[90m(Add this to your prompt context so your AI perfectly architect endpoints for you!)\x1b[0m');
|
|
714
|
+
} catch (err) {
|
|
715
|
+
console.error('\x1b[31m❌ Connection Failed:\x1b[0m', err.message);
|
|
716
|
+
process.exit(1);
|
|
717
|
+
}
|
|
718
|
+
};
|
|
701
719
|
const main = async () => {
|
|
702
720
|
const command = process.argv[2];
|
|
703
721
|
if (command === 'init') {
|
|
@@ -712,12 +730,27 @@ const main = async () => {
|
|
|
712
730
|
await runDeploy();
|
|
713
731
|
} else if (command === 'update') {
|
|
714
732
|
await runUpdate();
|
|
733
|
+
} else if (command === 'llm') {
|
|
734
|
+
await runLlm();
|
|
735
|
+
} else if (command === 'help' || !command) {
|
|
736
|
+
console.log('\n\x1b[1m\x1b[36mvm.live\x1b[0m - Serverless Edge Compute Engine');
|
|
737
|
+
console.log('Usage: vmlive <command>\n');
|
|
738
|
+
console.log('Commands:');
|
|
739
|
+
console.log(' \x1b[32minit\x1b[0m Scaffold a new vm.live sandbox in the current directory');
|
|
740
|
+
console.log(' \x1b[32madd\x1b[0m Add a new microservice endpoint to your existing workspace');
|
|
741
|
+
console.log(' \x1b[32mdev\x1b[0m Start the local emulator and dashboard over localhost');
|
|
742
|
+
console.log(' \x1b[32mlogin\x1b[0m Authenticate your local environment securely via Stripe/OAuth');
|
|
743
|
+
console.log(' \x1b[32mdeploy\x1b[0m Upload your footprint to the vm.live edge platform');
|
|
744
|
+
console.log(' \x1b[32mllm\x1b[0m Download the official AI Context Rules for agentic workflows');
|
|
745
|
+
console.log(' \x1b[32mupdate\x1b[0m Upgrade this CLI engine to the latest published version');
|
|
746
|
+
console.log(' \x1b[32mwhich\x1b[0m Display the currently active CLI version');
|
|
747
|
+
console.log('');
|
|
715
748
|
} else if (command === 'which' || command === '-v' || command === '--version' || command === 'v') {
|
|
716
749
|
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
|
|
717
750
|
console.log(`vmlive CLI v${pkg.version}`);
|
|
718
751
|
} else {
|
|
719
|
-
console.error(`\x1b[31m❌ Unknown command: ${command
|
|
720
|
-
console.log('
|
|
752
|
+
console.error(`\x1b[31m❌ Unknown command: ${command}\x1b[0m`);
|
|
753
|
+
console.log('Run \x1b[36mvmlive help\x1b[0m to see available commands.');
|
|
721
754
|
process.exit(1);
|
|
722
755
|
}
|
|
723
756
|
};
|