Description
Termpolis fails to recognize installed AI agents like Codex and Gemini CLI in environments where binaries are managed by version managers (like NVM) or located in custom directories not covered by the current hardcoded fallbacks.
Problem Analysis
In src/main/index.ts, the findAgentInstalled function checks for binaries using:
which [agent]
- Hardcoded paths:
~/.local/bin, /usr/local/bin, /opt/homebrew/bin (on macOS/Linux).
However, on macOS, GUI applications often do not inherit the full shell PATH (e.g., configurations from .zshrc or .bash_profile). This causes which to fail if the binary is in a path managed by NVM (e.g., ~/.nvm/versions/node/v24.15.0/bin).
Environment Context
In my specific environment:
- Gemini CLI is installed via npm/nvm:
/Users/mac/.nvm/versions/node/v24.15.0/bin/gemini
- Codex is also present but not detected.
The current fallback paths do not include NVM-managed directories or generic global npm prefix paths.
Suggested Solutions
- Inherit Shell PATH: Use a library like
fix-path or shell-path in the main process to ensure the Electron environment has the same PATH as the user's interactive shell.
- Expand Fallback Paths: Include common global npm/pnpm bin directories.
- Manual Configuration: Allow users to specify custom binary paths in the application settings.
Version Information
- OS: macOS (Darwin)
- Termpolis: Latest main branch
Description
Termpolis fails to recognize installed AI agents like Codex and Gemini CLI in environments where binaries are managed by version managers (like NVM) or located in custom directories not covered by the current hardcoded fallbacks.
Problem Analysis
In
src/main/index.ts, thefindAgentInstalledfunction checks for binaries using:which [agent]~/.local/bin,/usr/local/bin,/opt/homebrew/bin(on macOS/Linux).However, on macOS, GUI applications often do not inherit the full shell PATH (e.g., configurations from
.zshrcor.bash_profile). This causeswhichto fail if the binary is in a path managed by NVM (e.g.,~/.nvm/versions/node/v24.15.0/bin).Environment Context
In my specific environment:
/Users/mac/.nvm/versions/node/v24.15.0/bin/geminiThe current fallback paths do not include NVM-managed directories or generic global npm prefix paths.
Suggested Solutions
fix-pathorshell-pathin the main process to ensure the Electron environment has the samePATHas the user's interactive shell.Version Information