Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(npm): skip fallback self shims

cyh432968aef89a
diff --git a/npm/avibe/bin/avibe.js b/npm/avibe/bin/avibe.js
index 3c844e4f4..501e6b287 100755
--- a/npm/avibe/bin/avibe.js
+++ b/npm/avibe/bin/avibe.js
@@ -168,7 +168,7 @@ function findVibeBinary() {
for (const dir of candidateBinDirs()) {
for (const executableName of executableNames("vibe")) {
const candidate = path.join(dir, executableName);
- if (isExecutable(candidate)) {
+ if (isExecutable(candidate) && !isSelfWrapperCandidate(candidate)) {
return candidate;
}
}
diff --git a/npm/avibe/test/cli.test.js b/npm/avibe/test/cli.test.js
index 646966b5e..ad1650030 100644
--- a/npm/avibe/test/cli.test.js
+++ b/npm/avibe/test/cli.test.js
@@ -51,6 +51,7 @@ function runCli(args, envOverrides = {}, binPath = cliPath) {
return childProcess.spawnSync(process.execPath, [binPath, ...args], {
encoding: "utf8",
env,
+ timeout: 5000,
});
}
@@ -177,6 +178,33 @@ test("skips its own npm vibe shim before delegating", () => {
assert.match(result.stdout, /runtime-vibe status/);
});
+test("skips its own npm vibe shim in fallback bin dirs before installing", () => {
+ const temp = makeTempEnv();
+ const fallbackBin = path.join(temp.home, ".local", "bin");
+ fs.mkdirSync(fallbackBin, { recursive: true });
+ writeSelfNpmVibeShim(fallbackBin);
+
+ const installCommand =
+ process.platform === "win32"
+ ? `echo @echo off> "${path.join(temp.bin, "vibe.cmd")}" && echo echo installed-vibe %*>> "${path.join(temp.bin, "vibe.cmd")}"`
+ : `/bin/mkdir -p "${temp.bin}" && /usr/bin/printf '#!/bin/sh\\necho installed-vibe "$@"\\n' > "${path.join(
+ temp.bin,
+ "vibe"
+ )}" && /bin/chmod +x "${path.join(temp.bin, "vibe")}"`;
+
+ const result = runCli(["doctor"], {
+ HOME: temp.home,
+ USERPROFILE: temp.home,
+ PATH: temp.bin,
+ AVIBE_INSTALL_COMMAND: installCommand,
+ });
+
+ assert.equal(result.error, undefined);
+ assert.equal(result.status, 0);
+ assert.match(result.stdout, /Installing Vibe Remote/);
+ assert.match(result.stdout, /installed-vibe doctor/);
+});
+
test("installs vibe when missing, then delegates", () => {
const temp = makeTempEnv();
const installCommand =