fix: pass augmented env to Claude CLI validation on macOS (#640)

When Electron apps launch from Finder/Dock on macOS, they don't inherit
the user's shell PATH. This causes Claude CLI detection to fail because
the `claude` script (which uses `#!/usr/bin/env node`) cannot find the
Node.js binary.

The fix passes `getAugmentedEnv()` to `execFileSync` in `validateClaude()`,
which includes `/opt/homebrew/bin` and other common binary locations in
the PATH. This allows `env node` to find Node.js when validating the
Claude CLI.

Fixes an issue where Auto Claude would report "Claude CLI not found"
even though it was properly installed via npm.

Signed-off-by: Tallinn Terlich <tallinn1022@gmail.com>
Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>
This commit is contained in:
tallinn102
2026-01-06 20:39:14 +10:00
committed by GitHub
parent 09aa4f4f71
commit 574cd117b2
+2 -1
View File
@@ -25,7 +25,7 @@ import { existsSync, readdirSync } from 'fs';
import path from 'path';
import os from 'os';
import { app } from 'electron';
import { findExecutable } from './env-utils';
import { findExecutable, getAugmentedEnv } from './env-utils';
import type { ToolDetectionResult } from '../shared/types';
import { findHomebrewPython as findHomebrewPythonUtil } from './utils/homebrew-python';
import {
@@ -841,6 +841,7 @@ class CLIToolManager {
timeout: 5000,
windowsHide: true,
shell: needsShell,
env: getAugmentedEnv(),
}).trim();
// Claude CLI version output format: "claude-code version X.Y.Z" or similar