OpenAI Codex CLI ![rw-book-cover](https://i.ytimg.com/vi/FUq9qRwrDrI/maxresdefault.jpg) ## Metadata - Author: [[OpenAI]] - Full Title: OpenAI Codex CLI - Category: #articles - Summary: Meet Codex CLI—an open-source local coding agent that turns natural language into working code. Tell Codex CLI what to build, fix, or explain, then watch it bring your ideas to life. In this video, Fouad Matin from Agents Research and Romain Huet from Developer Experience give you a first look and show how you can securely use Codex CLI locally to quickly build apps, fix bugs, and understand codebases faster. Codex CLI works with all OpenAI models, including o3, o4-mini, and GPT–4.1. Get started: https://github.com/openai/codex. - URL: https://youtube.com/watch?v=FUq9qRwrDrI&si=hY4qs60pFHCiheLb So, what I'm thinking is maybe I canstart introducing Codecs from here, Fuad.As always, it's like coding away in thebackground, and then he can join me forthe live demos. What do you think? Thatsounds great. Cool! Let's do it. Take one, Mark. Hey everyone, I’m Roma andI work on developer experience at OpenAI.What I love most is making suredevelopers like you feel delighted andinspired by the tools we build. Well,today, we’re excited to give you a quicklook at something new we’ve beenexperimenting with: the Codex CLI. Codexis a lightweight coding agent that canrun directly from your command line. Itcan read and edit files, it can runcommands securely, and you can really useit to build features or complete appsfrom scratch. But enough talk; to see thatin action, I’m gonna bring Fouad over forsome live demos. Hey, hey, hey! How’s it going? Great! Hey,everyone, I’m Philad. I’m on the agentsresearch team, and I’m so excited toshare Codex with you all. Why don’t youkick us off with maybe like a projectthat people might have seen before? Let’ssay like open.fm that we use as a quickdemo lab for our voice models. Yeah, let’sLet me go and pull up the website open. Ithink it's an open-source repository, right? SoI can just go ahead and clone thatlocally and fire up Codex. So herewe have Codex just running on mymachine. The cool part is that it runswith any of our public models. SinceI'm not that familiar with the codebase,I'm just going to go and start off byasking it to explain this codebase to me. So what I'm looking at here on thescreen is that you're using 0.3 that wejust launched today. Yeah, you canactually use anything from 4.1 from afew days ago to 0.3 and 0.4 mini today.I think one really cool thing is, as it'sactually calling these tools, it'srunning commands, and you can see it run thecommands directly on your machine. So nowwe can see it put together this wholedescription. I can see that it describedwhat OpenAI Codex is, it shows me the codearchitecture, that it's an X.jsapplication, and finally, here’s how I canactually run it. So I'm going to go aheadand run the development server. Um,did you have a use case in mind? Yeah, Imean, why don't we do something simple,like dark mode, for instance? Like, I knowdevelopers always love dark mode. Maybe we can do something on top of that.Sure, let me go ahead and Codex this.This time, I'm going to run it in full automode. So, what does that mean exactly? Fullauto? Now we can also edit and runcommands automatically. Got it? Animportant point there is to make sure itstill stays safe and secure. Is that whenyou run it in full auto mode, it'sactually running with the network disabled andsandboxed in the directory that you ran it in.So, it's perfectly safe for you to justbe able to walk away. But it's reallyimportant for us to make sure that ourusers stay in control when you'reactually running this on your owncomputer. That's great, it sounds likewhat we're talking about is changing all theTailwind CSS, and making thechanges we want. Yeah, so one of the nicethings is that while I got this highlevel overview, in one step I can alsogo in and make very specific changes without actually having thecontext of where it's making thosechanges. So, I think the nice part is thatyou know, you as a developer can actuallyuse this to both understand the code andactually make edits to it prettyseamlessly. Now that it's done, I'm goingTo go ahead and open up the Open FM, Ican open it up locally, and boom, we cansee it in dark mode. That's amazing! Youknow, that's one example where it's anexisting codebase, but maybe trysomething new. Well, now that we've gotfamiliar with this one example, I thought, whydon't we create something a bit more fun,uh, from scratch this time? A little bitlike vibe coding, complete app fromnothing. Sure, uh, is there one that youlike in particular on Mac OS? Forinstance, okay, yeah, um, you know when Iwas a kid, I used to go to the Applestore and, you know, play with Photo Booth. I don't know, I don't often do this, butum, so yeah, let's actually pull out maybeone of the filters in Photo Booth. Okay?Yeah, how about this page offilters? Yeah, so are you able to likescreenshot the app and just tell Codexthat you want it, like, put on the web?Exactly, so I'm going to grab ascreenshot of Photo Booth, and I'm justgoing to pass itin. So this time I'm going to put it infull automode, and it is a first reason about theimage. It's going to understand what whatIs it even looking at? Okay, great. Itunderstands that it's a screenshot ofMac OS. Yeah, um, and now I’m going to tellit to reimplement this in a single pageHTML, and maybe I want to say, um, use theweb camera API, and make sure it's inlandscapemode. And so now it'll just go off andgiven that context about the screenshotof what I wanted. You know, this could bea screenshot of Photo Booth; itcould be a screenshot of, uh, Figma design. It could be a lot of different things.I’ve used it in different contexts whereI’ve drawn very low fidelity mock-ups, um,and then just kind of give in Codex, uh,here’s this context that I want, and thengo off and make the changes. I don’t haveto give it any additional context, anyadditional direction; it'll just go offand think for a while. You can see its chainof thought reasoning as it's thinkingthrough the problem, both what commandsit's running and also what its thoughtsare. And now finally, here we see the page.Now if I go ahead and open that page inmy browser, I can go ahead and see thatit created this Photo Booth, and boom! Wehave—oh my God, look how cool that is!It's exactly the same. Is that amazing? That's so cool, and I'm sure you couldhave prompted your way to get such aresult. But just like one screenshot,the model understood exactly what youwanted to build. We didn't have to open acode editor this entire time; it was justall in our terminal. Sometimes I'llkick off multiple of these in paralleland just let them, you know, oneexplaining the codebase to me, one makingsome changes, and it's just prettymagical to see it all come together. That's amazing! So it was just a quicklook at some of the features that wehave in Codex. We've seen how it canread and edit files directly. It can runcommands very securely, and you havedifferent knobs in order to pickthe mode that you're the mostcomfortable with. But my personalfavorite feature is really that one, likethe multimodal reasoning. That's reallythe true magic of those reasoning models.You just feed it a piece of paper, asketch or something, and boom, you havecode being written for you. Do you wantto share anything about, like, one morething about this? Yeah, there's always onemore thing: we're really excited toactually share Codex with you fully. Open source! You can go to our GitHub,and you can see the Codex repo. You can exploreit. You can actually use Codex tounderstand more about the repo, and we'resuper excited to hear what you think.Yeah, and Codex works with GPT-4.1,which launched on Monday, and with 03 and 04 mini,launching today. So we really can't waitto see what you build. Thank you.Thanks! Okay, that was very good. Cool., OpenAI Codex CLI, OpenAI, 01js0j402xyt1s3jfmajzk5bww.