From b109f8c23187aec720a6b8fcf9b811a49b46e897 Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Wed, 1 Apr 2026 10:43:29 -0600 Subject: [PATCH] initial commit --- .../spec-forest/src/generate/claude_runner.rs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/crates/spec-forest/src/generate/claude_runner.rs b/crates/spec-forest/src/generate/claude_runner.rs index 1374a78..27f5bf0 100644 --- a/crates/spec-forest/src/generate/claude_runner.rs +++ b/crates/spec-forest/src/generate/claude_runner.rs @@ -64,6 +64,40 @@ pub(super) async fn run_claude_in_dir( "Invoking claude CLI" ); let mut cmd = tokio::process::Command::new("claude"); + + // macOS GUI apps (e.g. .dmg/.app bundles) inherit a minimal PATH that + // doesn't include user-installed tool locations. Append common paths so + // the `claude` CLI can be found when launched from Finder / Spotlight. + if let Ok(current_path) = std::env::var("PATH") { + let extra = [ + "/usr/local/bin", + "/opt/homebrew/bin", + // npm global installs + &format!( + "{}/.npm-global/bin", + std::env::var("HOME").unwrap_or_default() + ), + // nvm default + &format!( + "{}/.nvm/versions/node/default/bin", + std::env::var("HOME").unwrap_or_default() + ), + // volta + &format!( + "{}/.volta/bin", + std::env::var("HOME").unwrap_or_default() + ), + ]; + let mut new_path = current_path.clone(); + for p in &extra { + if !current_path.contains(p) { + new_path.push(':'); + new_path.push_str(p); + } + } + cmd.env("PATH", new_path); + } + cmd.arg("--print") .arg("--output-format") .arg("text")