Skip to content

Bug: Codex and Gemini CLI not recognized in NVM/custom PATH environments on macOS #8

@chan-yuu

Description

@chan-yuu

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:

  1. which [agent]
  2. 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

  1. 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.
  2. Expand Fallback Paths: Include common global npm/pnpm bin directories.
  3. Manual Configuration: Allow users to specify custom binary paths in the application settings.

Version Information

  • OS: macOS (Darwin)
  • Termpolis: Latest main branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    release-notifiedOpener has been notified that a release contains the fix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions