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