Connect to Codex CLI from the ChatGPT desktop app
What feature would you like to see?
What
Enable the ChatGPT desktop app (Win/macOS) to detect and connect to a locally running Codex CLI instance, exposing it as a selectable model (e.g., "Codex CLI @ my-computer/my-directory"). All functionality from the ChatGPT app (searchable history, nice font/formatting, refined scroll behaviour, dictation, drag-and-drop file attachments) remains available, but responses are powered by the user’s local Codex.
Why
Better developer experience. The TUI is good, but developers miss out on all the nice affordances that have been added to the ChatGPT app over the years.
This might also save the codex-cli team re-inventing a whole bunch of features from the ChatGPT app one by one.
How (some rough ideas)
(I'm aware this involves changes across two repos, but only the codex CLI repo is public so I'm logging this here.)
MVP
- ChatGPT app probes 127.0.0.1 on a particular port listened to by Codex.
- Shows **“Codex CLI @ ... ” in the model selector if found.
- Connect via WebSocket.
- History persistence with Codex-tagged sessions.
- Basic error handling (e.g. when viewing conversation on phone, the model isn't available).
Later phases
- File/image forwarding.
- WSL-aware port forwarding on Windows (if it doesn't just work out of the box)
- Remote connection if local codex is exposed (maybe a terrible idea!)
Some inspiration could be taken from how Chrome Dev Tools allows access to local folders in the Sources tab. Perhaps the ChatGPT App could have something similar where you define in the app UI which folders you want to be able to access with Codex (and ultimately, there's no reason that the app itself couldn't manage the install and launching of Codex).
Open Questions
- Should local Codex chats sync to cloud search?
- Should tool-calls (e.g., Drive search) be proxied by the app or Codex?
- How would it work with projects?
- Would it require a different system prompt?
- Should the ChatGPT UI show multiple codex instances (for multiple directories) if they're running? What if there's two instances for the same directory?
- Should the ChatGPT UI allow viewing/changing sandbox and approval options?
- Should the user have to manually run a Codex instance, or would this involve a background process.
- How to handle codex-only interactions like interrupting (or is that basically the same as hitting the stop button in the app?) or running commands like
!git status - Should this only be in the ChatGPT App, or also chatgpt.com (there's certainly something 'odd' about a website connecting to a local process, but I don't think there's any technical blocker)
- I think there's this view that developers love being in the terminal; and maybe that's true for others, but for me I'd much prefer the well designed interface of the ChatGPT App. So the big question is: would a reasonable portion of developers prefer to interact with Codex through a more feature-rich UI? Maybe an internal OpenAI survey would provide an interesting insight.
Are you interested in implementing this feature?
_No response_
Additional information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗