codex in your project folder, and sign in with ChatGPT. The CLI and the code editor extension come with ChatGPT Plus ($20/month) and higher plans, and the Free and Go plans include Codex in the ChatGPT desktop app. To build a native iPhone app without a Mac, connect Vibecode to Codex: Codex directs Vibecode’s agent, which builds and tests the app on cloud Macs.
Codex at a Glance
Where Codex Runs
Codex is one agent with several front ends. On your computer, the CLI, the IDE extension, and the ChatGPT desktop app share one configuration file,~/.codex/config.toml, so your settings and MCP servers follow you between them.
Is Codex Free?
Partly. OpenAI lists Codex on the Free and Go plans only in the ChatGPT desktop app, with the GPT-6 Luna model, and is still rolling it out. For the CLI, the IDE extension, Codex Cloud, and the iPhone app, you need ChatGPT Plus or higher. An OpenAI API key also works for local use.
Enterprise and Edu pricing comes from OpenAI’s sales team. On Plus, OpenAI estimates 15 to 160 local messages every five hours with GPT-6.1 Sol, depending on the task, and weekly limits may also apply. In the CLI,
/status shows what you have left.
Prices and limits are from OpenAI’s Codex pricing page as of October 2026. OpenAI changes plans and models often, so check there before you buy.
How to Install Codex CLI
Open a terminal and run the command for your system:codex --version. To update later, run the same install command again (with Homebrew, brew upgrade --cask codex).
On Windows, run the PowerShell command in a new PowerShell window. Codex runs natively there with its own Windows sandbox. Prefer Linux tools? Run wsl --install in PowerShell as an administrator, open your WSL shell, and use the macOS/Linux command. WSL1 isn’t supported, and projects in your Linux home folder run faster than ones under /mnt/c/.
On Linux and WSL2, Codex’s sandbox needs bubblewrap. Install it first with sudo apt install bubblewrap (Ubuntu, Debian) or sudo dnf install bubblewrap (Fedora).
How to Use Codex
- Open a terminal in your project folder:
cd path/to/your-project - Start it: type
codexand press Enter - Sign in: the first time, choose Sign in with ChatGPT and finish in your browser. To use an API key instead, run
printenv OPENAI_API_KEY | codex login --with-api-keyon macOS, Linux, or WSL, or$env:OPENAI_API_KEY | codex login --with-api-keyin Windows PowerShell. - Ask in plain English: for example,
Tell me about this projectoradd a dark mode toggle to the settings screen - Watch and approve: Codex shows its commands and edits as it works, and asks before it steps outside its sandbox
- Keep going: describe the next change, or type
/reviewto have Codex check what changed
Approval and Sandbox Modes
The sandbox limits which files and network access Codex’s commands get. The approval policy decides when it stops to ask you. Type/permissions to switch during a session.
The desktop app and IDE extension offer Ask for approval, Approve for me, and Full access in the permissions control below the message box.
Commands You’ll Use Most
Give Codex Project Notes with AGENTS.md
Codex readsAGENTS.md files before it starts any work. Run /init to create one, then edit it to say how to run the app, which build and test commands to use, and what “done” means. A personal ~/.codex/AGENTS.md applies to every project. Keep it short: Codex stops reading these files at 32 KiB by default.
How to Use Codex in VS Code or Cursor
- In VS Code (1.96.2 or later), open the Extensions view, search for Codex, and install the extension published by OpenAI. Cursor and Windsurf use the same extension (
openai.chatgpt). - Click the Codex icon. If you don’t see it, open the Command Palette and run Codex: Open Codex Sidebar.
- Select Sign in with ChatGPT, or Use API Key.
- Type your request. Add an open file or a selection as context, and review each change as a diff beside your code.
How to Vibe Code an App with Codex
“Vibe coding” means building by describing what you want and judging the result, instead of writing the code yourself (more in What is vibe coding? and Can I vibe code?). With Codex, this loop works:- Start clean. Make a new folder, run
git init, then runcodex. - Plan first. Turn on
/planand describe the app: what it does, who it’s for, and what “done” looks like. Review the plan, then let it build. - Run it. Ask Codex to start the app and tell you how to open it.
- Change one thing at a time. Say what’s wrong in plain English, and paste a screenshot into the message box when it helps.
- Commit each working step so you can go back when a change goes wrong.
How to Build an iPhone App with Codex
On your own computer, Codex can write a native Swift app, but you need a Mac with Xcode to build and run it, and an Apple Developer account ($99/year) to publish it. With Vibecode connected over MCP, Codex directs Vibecode’s agent, which builds the app on cloud Macs, tests it, and saves it to your Vibecode account. You don’t need a Mac.1
Add Vibecode to Codex
2
Sign in
Codex opens the Vibecode sign-in page. Sign in (or create an account) and select Allow. To sign in again later, run
codex mcp login vibecode.3
Ask for an app
Start
codex and ask in plain English. Type /mcp to check that Vibecode is connected.- “Using Vibecode, build me an iPhone app to track my workouts, with a weekly summary.”
- “Show me my Vibecode apps.”
- “Make the buttons in my workout app blue and add a rest timer.”
- “Why did the last build of my habit tracker fail?”
run_command, it runs a shell command in the app’s cloud workspace, such as a test, and each command stops after 45 seconds.
The CLI, the IDE extension, and the ChatGPT desktop app share ~/.codex/config.toml, so Vibecode appears in all three once you add it. If one asks you to sign in, select Authenticate next to Vibecode in its MCP servers list. Using only the desktop app? Open Settings, then MCP servers, select Add server, choose Streamable HTTP, and enter the server URL above.
Connecting is free. Builds and changes use your Vibecode credits, and Codex’s own messages still count toward your ChatGPT plan. New accounts that sign up with Google or Apple get their first app build free. To disconnect, run
codex mcp remove vibecode. Your apps stay in your account.
Want Codex to write all the code itself? The Vibecode CLI works the other way: your agent writes the code and uses Vibecode’s sandboxes, databases, sign-in, and hosting to run and publish it.
Codex vs Claude Code
For vibe coding, both turn plain-English requests into working code and ask before risky steps. The bigger difference is which subscription you already pay for. With ChatGPT, start with Codex. With Claude, start with Claude Code. Codex has a free way in and an open-source CLI. Claude Code is the agent inside every Vibecode build. Switching later is cheap: Codex’s
/import command brings over supported Claude Code setup and chats.
Frequently Asked Questions
Is Codex free?
Is Codex free?
Partly. On the ChatGPT Free and Go plans, Codex is in the ChatGPT desktop app with GPT-6 Luna, as OpenAI rolls it out. The CLI, the IDE extension, and Codex Cloud need ChatGPT Plus ($20/month) or higher, or you can pay per token with an OpenAI API key for local use.
How much does Codex cost?
How much does Codex cost?
As of October 2026, ChatGPT Plus is $20/month, Pro is $100, $200, or $500/month, and Business is $20 per user per month billed yearly. An API key is billed at OpenAI’s API rates. See OpenAI’s Codex pricing.
How do I install Codex CLI?
How do I install Codex CLI?
On macOS, Linux, or WSL run
curl -fsSL https://chatgpt.com/codex/install.sh | sh. On Windows, use the PowerShell command in How to Install Codex CLI, or install with npm or Homebrew. Then run codex in your project folder and sign in.Is there a Codex desktop app?
Is there a Codex desktop app?
Yes. Codex is part of the ChatGPT desktop app for macOS, Windows, and Linux (in preview). Select Codex from the ChatGPT dropdown. On macOS or Windows,
codex app in the CLI opens the app, or starts its installer.Does Codex work in VS Code and Cursor?
Does Codex work in VS Code and Cursor?
Yes. Install the Codex extension published by OpenAI (VS Code 1.96.2 or later). The same extension works in Cursor and Windsurf. Sign in with ChatGPT or an API key.
Can Codex build iPhone apps?
Can Codex build iPhone apps?
Codex can write the Swift code, but on your own you need a Mac with Xcode to build it and an Apple Developer account to publish it. With Vibecode connected, Codex has Vibecode’s agent build the app on cloud Macs, so you don’t need a Mac.
How do I add an MCP server to Codex?
How do I add an MCP server to Codex?
Run
codex mcp add <name> --url <server-url>, for example codex mcp add vibecode --url https://api.vibecodeapp.com/mcp. Codex may open the server’s sign-in page right away (it does for Vibecode). If it doesn’t, run codex mcp login <name>. Servers live in ~/.codex/config.toml, shared by the CLI, IDE extension, and desktop app.Codex vs Claude Code: which is better for vibe coding?
Codex vs Claude Code: which is better for vibe coding?
Both work. Pick the one that comes with the subscription you already have: Codex with ChatGPT, Claude Code with Claude. Codex has a free way in, and Claude Code needs a paid Claude plan. Either one can build a native iPhone app through Vibecode without a Mac.
Next Steps
Connect Vibecode to Your AI Tool
Steps for Codex, Claude Code, Cursor, and more
How to Use Claude Code
Install, cost, and building apps with Claude Code
How to Use Cursor
Vibe code in Cursor and build apps with Vibecode
How to Use Gemini CLI
Google’s coding agent, and how it builds apps
Build an App with ChatGPT
Build an iPhone app in a ChatGPT chat
Native iOS Apps
Swift apps for iPhone, no Mac needed
