limbo-ai 1.17.0 → 1.17.1
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/cli.js +30 -0
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1001,6 +1001,34 @@ function ensureVolumePermissions() {
|
|
|
1001
1001
|
], { stdio: 'pipe' });
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
|
+
function installGlobalAlias() {
|
|
1005
|
+
// Create a `limbo` shell wrapper so users don't have to type `npx limbo-ai` every time.
|
|
1006
|
+
// Tries /usr/local/bin first (macOS, Linux with sudo), falls back to ~/.local/bin (no sudo).
|
|
1007
|
+
const wrapper = '#!/bin/sh\nexec npx limbo-ai "$@"\n';
|
|
1008
|
+
const candidates = [
|
|
1009
|
+
path.join(os.homedir(), '.local', 'bin', 'limbo'),
|
|
1010
|
+
'/usr/local/bin/limbo',
|
|
1011
|
+
];
|
|
1012
|
+
|
|
1013
|
+
for (const target of candidates) {
|
|
1014
|
+
try {
|
|
1015
|
+
// Skip if already installed and current
|
|
1016
|
+
if (fs.existsSync(target)) {
|
|
1017
|
+
const existing = fs.readFileSync(target, 'utf8');
|
|
1018
|
+
if (existing.includes('limbo-ai')) return;
|
|
1019
|
+
}
|
|
1020
|
+
const dir = path.dirname(target);
|
|
1021
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
1022
|
+
fs.writeFileSync(target, wrapper, { mode: 0o755 });
|
|
1023
|
+
log(`Installed ${c.bold}limbo${c.reset} command → ${target}`);
|
|
1024
|
+
return;
|
|
1025
|
+
} catch {
|
|
1026
|
+
// Permission denied — try next candidate
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
// Silent failure — not critical, user can still use npx limbo-ai
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1004
1032
|
function isOomError(stderr) {
|
|
1005
1033
|
return typeof stderr === 'string' && (
|
|
1006
1034
|
stderr.includes('heap out of memory') ||
|
|
@@ -1623,6 +1651,8 @@ async function startContainerWithConfig(cfg, existingEnv, alreadyHasEnv) {
|
|
|
1623
1651
|
|
|
1624
1652
|
console.log(`\n ${c.yellow}⚠ ${t(cfg.language, 'securityNotice')}${c.reset}\n`);
|
|
1625
1653
|
|
|
1654
|
+
installGlobalAlias();
|
|
1655
|
+
|
|
1626
1656
|
printSuccess({
|
|
1627
1657
|
language: cfg.language,
|
|
1628
1658
|
telegramEnabled: mergedEnv.TELEGRAM_ENABLED || cfg.telegramEnabled || 'false',
|