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(upgrade): detect install method to target correct environment

cyhhaod2746261e65b
diff --git a/vibe/api.py b/vibe/api.py
index c61a596f4..2300c8edb 100644
--- a/vibe/api.py
+++ b/vibe/api.py
@@ -354,16 +354,21 @@ def do_upgrade(auto_restart: bool = True) -> dict:
Returns:
{"ok": bool, "message": str, "output": str | None, "restarting": bool}
"""
- # Determine upgrade method
+ import sys
+
+ # Determine upgrade method based on how vibe was installed
+ # Check if running from uv tool environment
+ exe_path = sys.executable
+ is_uv_tool = ".local/share/uv/tools/" in exe_path or "/uv/tools/" in exe_path
+
uv_path = shutil.which("uv")
- pip_path = shutil.which("pip")
- if uv_path:
+ if is_uv_tool and uv_path:
+ # Installed via uv tool, upgrade with uv
cmd = [uv_path, "tool", "install", "vibe-remote", "--force"]
- elif pip_path:
- cmd = [pip_path, "install", "--upgrade", "vibe-remote"]
else:
- return {"ok": False, "message": "Neither uv nor pip found", "output": None, "restarting": False}
+ # Installed via pip or other method, use current Python's pip
+ cmd = [sys.executable, "-m", "pip", "install", "--upgrade", "vibe-remote"]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=120)
diff --git a/vibe/cli.py b/vibe/cli.py
index beab36625..c7f23334b 100644
--- a/vibe/cli.py
+++ b/vibe/cli.py
@@ -531,20 +531,21 @@ def cmd_upgrade():
print("\nUpgrading...")
- # Determine upgrade method
+ # Determine upgrade method based on how vibe was installed
+ # Check if running from uv tool environment
+ exe_path = sys.executable
+ is_uv_tool = ".local/share/uv/tools/" in exe_path or "/uv/tools/" in exe_path
+
uv_path = shutil.which("uv")
- pip_path = shutil.which("pip")
- if uv_path:
- # Prefer uv for upgrade
+ if is_uv_tool and uv_path:
+ # Installed via uv tool, upgrade with uv
cmd = [uv_path, "tool", "install", "vibe-remote", "--force"]
print(f"Using uv: {' '.join(cmd)}")
- elif pip_path:
- cmd = [pip_path, "install", "--upgrade", "vibe-remote"]
- print(f"Using pip: {' '.join(cmd)}")
else:
- print("\033[31mError: Neither uv nor pip found. Cannot upgrade.\033[0m")
- return 1
+ # Installed via pip or other method, use current Python's pip
+ cmd = [sys.executable, "-m", "pip", "install", "--upgrade", "vibe-remote"]
+ print(f"Using pip: {' '.join(cmd)}")
try:
result = subprocess.run(cmd, capture_output=True, text=True)