Using voice to code with AI
For over a year now, ChatGPT has a voice mode to interact naturally by just talking to the app. The conversation is smooth, it is not just a speech-to-text effect. ChatGPT responds back with a distinct, realistic human voice. As in any conversation we can mark hesitations, break the flow, add some repetitions and rephrasings: all these are handled smoothly, as they would be when talking to a human.
In the meantime, coding with AI in the terminal has remained very much prompt-based, in writing. But that can change.
Without a big announcement, [on Sept 18] OpenAI has released a new feature to its Codex tool:
“Added experimental /voice conversations with live transcripts and microphone controls on supported builds, enabled through /experimental”
- Codex release 0.155.0
A little detour: what is Codex?
Codex is a tool by OpenAI which just like ChatGPT, allows a user to chat with an AI. The difference is that the interface to type the prompt is a “terminal”, not the familiar browser tab / desktop or mobile app:
It is called a “Terminal User Interface” (TUI) or also a “Command Line Interface” (CLI).
This kind of interface is useful especially when working on servers: their graphical capabilities are very limited, hence the very basic design. In return, this allows to use AI directly on the server, which helps a lot for anything you need to do on the server: configuration, security audits, coding, etc. Codex comes with sophisticated tools to work on a computer which are not included in the ChatGPT version in our browser or on our phone.
Codex is the TUI by OpenAI, and the competitors have the same types of solution:
- Anthropic has “Claude Code in the terminal”
- Google has Antigravity CLI
(except that to my knowledge Anthropic and Google don’t offer voice commands in the terminal, yet.)
Back to voice, with a problem
So, the voice mode offers Codex in the terminal the same vocal capabilities as the one we experience in the ChatGPT app.
Just type /voice in the terminal and the agent starts chatting vocally with you.
This is nice but quite impractical: when Codex runs on a server, this server has no microphone and no audio capabilities. So even if the voice capability is there, the computer can’t “hear” you.
The solution
Fortunately earlier this year (February), OpenAI had also evolved Codex to become a generic platform that can be embedded or interfaced in many different environments: including from a remote machine.
So it is possible to use the microphone and the speaker of your laptop for sound, and Codex on your laptop transports the sound back and forth to Codex on the server for you.
I just tried it, here is the super simple walk-through:
- install Codex both your laptop and on your server.
- forward the port
14500to your laptop with an SSH tunnel (sounds technical but that takes 2 seconds) - connect to your server and launch Codex:
codex app-server --listen ws://127.0.0.1:14500
Nothing more to do on your server, it will stay there in “listening” mode. I suppose you can launch it as a tmux session, and it will persist indefinitely.
- on your laptop, open the terminal (Linux or Mac) or Powershell (Windows) and type:
codex --remote ws://127.0.0.1:14500 --cd /home/my-user
This opens the Codex interface on your laptop. This is where you’ll work.
- Type
/voiceor pressF8and that’s it, you can now speak aloud to the model on your server. Codex handles the connection to your server. It replies, executes commands and performs work for you.
Demo
The demo doesn’t show the terminal because it is a good practice not to share publicly the internals of a server :-)
Here is the audio:
It works, but does it bring additional comfort to the coding experience?
My impressions after an hour:
1️⃣ you need to be in a quiet place. Ideal for working from home, not practical in a shared office.
2️⃣ the voice adds humanity. Feels like working with a colleague, rather than alone.
3️⃣ this shifts work from “typing commands”, to “discussing with a fully dedicated, super smart colleague who is permanently available”.
4️⃣ ergonomic, unobstrusive: F8 to launch or stop, F9 to mute or unmute the mic. It remains possible to type things in the terminal, if that’s convenient. The voice replies when you finish talking, but it doesn’t try to keep the conversation going without a good reason.
Happy to report how it feels after a week or two!
Also, that gives some truth to this meme showing the last keys I need on my keyboard 😁.
Next steps 😱
(this was suggested by a friend when I demo’ed the vocal interaction)
From a previous experiment, I had registered a SIM card on my server to interact with text messaging via Signal. Not so practical, I don’t use it anymore. But the SIM is still there. Wait, could I use the SIM card to setup phone calls (as in voice calls) to discuss with my server?
Imagine: receiving a call from your machine about some activity worth noticing, and discussing with it. Or calling: “is all fine down there”? (or up there, I don’t know).
About Me
I am Clement Levallois and I lead higher-education programs in interactive design and video games at Gobelins Paris. I also develop independent web applications to learn, have fun and be of service if I can.
I created Nocode Functions, SlideLang, poser mes valises and entourages. Try them out and let me know what you think. I’d love your feedback!
The views expressed here are my own and do not necessarily reflect those of my employer or any organization with which I am affiliated.
- Email: analysis@exploreyourdata.com
- Bluesky: @seinecle
- Blog: Read more articles on AI, coding, and higher education.