Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ temp_lib/
AGENTS.md
CLAUDE.md
*_TASK.md
.serena/
settings.local.json

# Claude project-specific files
.claude/
76 changes: 66 additions & 10 deletions src-tauri/src/claude_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,16 @@ fn source_preference(installation: &ClaudeInstallation) -> u8 {
"homebrew" => 2,
"system" => 3,
source if source.starts_with("nvm") => 4,
"local-bin" => 5,
"claude-local" => 6,
"npm-global" => 7,
"yarn" | "yarn-global" => 8,
"bun" => 9,
"node-modules" => 10,
"home-bin" => 11,
"PATH" => 12,
_ => 13,
"mise" | source if source.starts_with("mise") => 5,
"local-bin" => 6,
"claude-local" => 7,
"npm-global" => 8,
"yarn" | "yarn-global" => 9,
"bun" => 10,
"node-modules" => 11,
"home-bin" => 12,
"PATH" => 13,
_ => 14,
}
}

Expand All @@ -212,7 +213,10 @@ fn discover_system_installations() -> Vec<ClaudeInstallation> {
// 2. Check NVM paths
installations.extend(find_nvm_installations());

// 3. Check standard paths
// 3. Check mise installations
installations.extend(find_mise_installations());

// 4. Check standard paths
installations.extend(find_standard_installations());

// Remove duplicates by path
Expand Down Expand Up @@ -307,6 +311,54 @@ fn find_nvm_installations() -> Vec<ClaudeInstallation> {
installations
}

/// Check mise installations (both shims and all installed versions)
fn find_mise_installations() -> Vec<ClaudeInstallation> {
let mut installations = Vec::new();

if let Ok(home) = std::env::var("HOME") {
// Check all mise installations
let mise_installs_dir = PathBuf::from(&home).join(".local/share/mise/installs");

if let Ok(tools) = std::fs::read_dir(&mise_installs_dir) {
for tool_entry in tools.flatten() {
if tool_entry.file_type().map(|t| t.is_dir()).unwrap_or(false) {
let tool_name = tool_entry.file_name().to_string_lossy().to_string();

// Check each version of this tool
if let Ok(versions) = std::fs::read_dir(tool_entry.path()) {
for version_entry in versions.flatten() {
// Skip symlinks and hidden files
if version_entry.file_name().to_string_lossy().starts_with('.') {
continue;
}

let claude_path = version_entry.path().join("bin").join("claude");

if claude_path.exists() && claude_path.is_file() {
let path_str = claude_path.to_string_lossy().to_string();
let version_name = version_entry.file_name().to_string_lossy().to_string();

debug!("Found Claude in mise {}/{}: {}", tool_name, version_name, path_str);

// Get Claude version
let version = get_claude_version(&path_str).ok().flatten();

installations.push(ClaudeInstallation {
path: path_str,
version,
source: format!("mise ({}/{})", tool_name, version_name),
});
}
}
}
}
}
}
}

installations
}

/// Check standard installation paths
fn find_standard_installations() -> Vec<ClaudeInstallation> {
let mut installations = Vec::new();
Expand All @@ -333,6 +385,10 @@ fn find_standard_installations() -> Vec<ClaudeInstallation> {
format!("{}/.local/bin/claude", home),
"local-bin".to_string(),
),
(
format!("{}/.local/share/mise/shims/claude", home),
"mise".to_string(),
),
(
format!("{}/.npm-global/bin/claude", home),
"npm-global".to_string(),
Expand Down
5 changes: 3 additions & 2 deletions src/components/ClaudeBinaryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export function ClaudeBinaryDialog({ open, onOpenChange, onSuccess, onError }: C
<AlertCircle className="w-4 h-4 text-muted-foreground" />
<p className="text-sm text-muted-foreground">
<span className="font-medium">Searched locations:</span> PATH, /usr/local/bin,
/opt/homebrew/bin, ~/.nvm/versions/node/*/bin, ~/.claude/local, ~/.local/bin
/opt/homebrew/bin, ~/.nvm/versions/node/*/bin, ~/.claude/local, ~/.local/bin,
~/.local/share/mise/shims, ~/.local/share/mise/installs/*/bin
</p>
</div>
</>
Expand Down Expand Up @@ -137,4 +138,4 @@ export function ClaudeBinaryDialog({ open, onOpenChange, onSuccess, onError }: C
</DialogContent>
</Dialog>
);
}
}