Support bash commands when REPL mode
Resolved 💬 12 comments Opened Apr 17, 2025 by maheshrijal Closed Dec 18, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
Codex doesn't have a bash / shell mode. When in REPL mode, it would enable the user to run commands in the terminal without exiting codex.
Example:
!Image
I have a local implementation of this done mostly by codex itself. If you're open to merging it I can post a PR. Thanks!
12 Comments
Could you share a bit about the implementation first so we can discuss here and then once we feel pretty good about it I would gladly accept a PR!
Sorry I'm not too familiar with typescript to comment on that. I yolo'ed the implementation with codex :D
This would be a great feature addition tho. Couple of use cases I can think about:
cat,awketc to filter data & pipe data to REPL and ask questionsNow one could argue all of this could be done by codex. But, it would be much faster to do it manually whenever required.
I created PR https://github.com/openai/codex/pull/349. This is by no means ready and just meant to be a example.
Hi @maheshrijal, I really like the idea and I’ll look into the effort required to implement it.
+1 I think this is a necessary feature in order to attach context to a codex session. The shell command and output should be visible to codex.
I hope it's OK to mention other tools as reference. Both aider and claude code have the same functionality: if you begin your input with !, everything after it is treated as input to user's standard shell. After this command exits (or user breaks it's execution), all of it's output is added as a message to chat history on user's confirmation.
That's exactly what I would expect, with improvements (probably obvious already) in the order of priority:
isTTYand ANSI-heavy output → reject with explanation ("The tool you ran is a TUI. Its output contains escape sequences and is not useful to the model. Try running it with flags like--no-watchor--plain.")@tibo-openai @fouad-openai Are you open to external PRs attempting to add this behavior? I would be happy to give Codex a try at adding this feature and testing it out 🙏 :)
This is the biggest feature I miss from Claude Code currently
There is codex exec for this isn't it ?
It's not clear to me what this feature request is asking for. It's quite outdated at this point, since it was filed back in April. The entire CLI has been rewritten since then.
I'm going to close this one, but if you think that there's something here that you'd like to see, please open a new feature request with details about the functionality you want.
What does the rewrite in Rust have anything to do with the desire of people to have this functionality? I, for one, would still like to have this functionality