[linux] can't find codex if installed via homebrew #234
Codex provider status
Codex CLI (`codex`) is not installed or not on PATH.
Homebrew installs codex to /home/linuxbrew/.linuxbrew/bin but the program can't find it.
It also doesn't account for ~/.profile and ~/.bashrc for Linux, only for macOS via interactive shell.
Installing Codex elsewhere works.
also linked to #226
@maria-rcks same issue here on MacOS, fish shell (might be an issue with shell)
↪ whereis codex codex: /opt/homebrew/bin/codexsame issue on MacOS:
> whereis codex codex: /opt/homebrew/bin/codexunder settings -> codex app server there's a setting to change codex binary path, does this work?
under settings -> codex app server there's a setting to change codex binary path, does this work?
Thanks! But it does not work
maria-rcks added labelsbug
can you run
echo $PATHon your general shell? orwhereis codexcodex: /home/linuxbrew/.linuxbrew/bin/codexRetracted comments unrelated to this issue (see https://github.com/pingdotgg/t3code/issues/263 instead).
under settings -> codex app server there's a setting to change codex binary path, does this work?
No. Also, the only way to access the settings is via
Ctrl+,. There's no menu or button to the settings screen.I have the same issue. A temporary fix I got from a helpful guy on Discord is to use a symlink:
replace /opt/homebrew/bin/codex with the output of ```whereis codex```Same issue. Even did the symlink and it still fails
I have the same issue. A temporary fix I got from a helpful guy on Discord is to use a symlink:
sudo ln -s /opt/homebrew/bin/codex /usr/local/bin/codexreplace /opt/homebrew/bin/codex with the output ofwhereis codexthis worked for me, thanks! i'm running bazzite dx.
I just installed codex and it is working, without running any other commands. Can you reinstall them again?
Same issue when codex is installed via bun. T3 Code cannot find it, even when the path to codex binary is configured in settings
When confirming symlink solution, make sure you test with a new thread. I was still having the same error on the thread I first discovered this issue and making a new thread confirmed that the symlink fix worked.
I'm on arch.
I'm using Omarchy (Arch) and I had the same issue when using a packaged version from AUR ('yay -S tscode-bin`). I thought I was a bug on my system but I fixed it by implementing the bug fix I put up in #1100. I am not happy with the change requiring changes across 4+ files so not sure if it will be accepted but that is what worked for me.
Link #301
Having the same issue with the latest version but came here to add that reinstalling codex cleanly seems to have fixed it but the error message lingers and will not disappear even if I restart t3code
can y'all try this !!
- uninstall codex from brew, remove the ~/.codex dir too.
- make sure you're on the latest version of t3code.
- fresh install codex.
- keep the binary and home path empty, it should auto recognize.
lmk if this is working !!
I used codex to help debug this issue and this is what it came up with. It solved the issue on my end (Bazzite).
"I tracked this down on Linux/Bazzite and the issue is not that
codexis necessarily missing. The problem is that T3 Code is launched as a GUI AppImage, and GUI apps often do not inherit the samePATHas an interactive shell.What was found:
codexwas installed and worked fine in a terminal.- T3 Code still reported
Codex CLI (codex) is not installed or not executable. - On this setup,
codexwas available through shell startup configuration, but T3 Code did not read that environment when launched from the desktop. - This is especially likely on immutable or desktop-managed Linux setups like Bazzite, where GUI app environment and shell environment can differ.
Temporary workaround:
- Create a launcher script that explicitly sets a PATH including common Linuxbrew and local bin locations before starting T3 Code:
sh mkdir -p "$HOME/.local/bin" cat > "$HOME/.local/bin/t3-code-alpha-launcher" <<'EOF' #!/usr/bin/env sh set -eu export PATH="$HOME/.local/bin:$HOME/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH:-/usr/local/bin:/usr/bin:/bin}" export DESKTOPINTEGRATION=1 exec "$HOME/AppImages/t3_code_alpha.appimage" --no-sandbox "$@" EOF chmod +x "$HOME/.local/bin/t3-code-alpha-launcher"- Update the desktop entry so the app launches through that wrapper instead of directly launching the AppImage:
mkdir -p "$HOME/.local/share/applications" cat > "$HOME/.local/share/applications/t3_code_alpha.desktop" <<'EOF' [Desktop Entry] Type=Application Name=T3 Code (Alpha) Comment=T3 Code desktop build Icon=$HOME/AppImages/.icons/t3_code_alpha TryExec=$HOME/.local/bin/t3-code-alpha-launcher Exec=$HOME/.local/bin/t3-code-alpha-launcher %U Terminal=false Categories=Development; StartupWMClass=T3 Code (Alpha) EOF- Refresh desktop entries if available:
update-desktop-database "$HOME/.local/share/applications" || true- Fully quit T3 Code and relaunch it from the application menu. If using a pinned icon in a taskbar/dock, unpin and re-pin it first, because some desktop environments cache the old Exec= command.
Optional extra hardening:
Add a codex shim in ~/.local/bin so that anything that sees only local user binaries can still resolve codex:
cat > "$HOME/.local/bin/codex" <<'EOF' #!/usr/bin/env sh set -eu for candidate in \ /home/linuxbrew/.linuxbrew/bin/codex \ /var/home/linuxbrew/.linuxbrew/bin/codex do if [ -x "$candidate" ]; then exec "$candidate" "$@" fi done echo "codex wrapper could not find a Homebrew codex binary" >&2 exit 127 EOF chmod +x "$HOME/.local/bin/codex"Suggested upstream fix:
T3 Code should not rely only on inherited PATH when validating or launching codex on Linux desktop builds.
A more robust approach would be:
- Try codex from the inherited PATH.
- If not found, probe a small set of common Linux install locations such as:
- /home/linuxbrew/.linuxbrew/bin/codex
- /var/home/linuxbrew/.linuxbrew/bin/codex
- $HOME/.local/bin/codex
- Fix the codex binary path override option.
- In the AppImage/desktop launcher, prepend a known-safe PATH for common user-level install locations before spawning the backend.
That would avoid false “not installed” errors on systems where GUI apps and shell sessions do not share the same environment."
juliusmarminge closed this
Sign in to join this conversation.
can you run
echo $PATHon your general shell? orwhereis codex