Vibe Coding for Production
OpenAI Codex

Getting started with OpenAI Codex

Install Codex and choose between its CLI, IDE, desktop, and cloud surfaces.

OpenAI Codex is a coding agent available through a terminal CLI, IDE extension, desktop app, cloud tasks, and SDK. The same project can move between those surfaces, but execution location and security boundaries differ.

Official starting points: Codex overview, CLI, IDE extension, and Codex app.

Install and sign in

npm install --global @openai/codex
codex login
codex

OpenAI also publishes standalone installers:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

On Windows, follow the current installer on the CLI page rather than translating the Unix command.

Pick the right surface

SurfaceBest fit
CLILocal repository work, scripts, CI, and precise sandbox controls.
IDE extensionEditing in VS Code, Cursor, Windsurf, or supported JetBrains IDEs with inline context and diffs.
Desktop appMultiple Local, Worktree, and Cloud threads; browser/computer use; automations; integrated Git review.
CloudBackground tasks in isolated OpenAI-managed containers connected to GitHub.

The desktop app can launch from a terminal:

codex app .

First local task

Start with workspace-only writes and approval when Codex needs to cross the configured boundary:

codex --sandbox workspace-write --ask-for-approval on-request

Then ask:

Read AGENTS.md and the main package or project files. Explain how to install,
run, and test this repository. Do not edit anything yet.

For one non-interactive task:

codex exec --sandbox workspace-write \
  "Run the main test suite, diagnose failures, and make the smallest fix."

Feature maturity matters

OpenAI labels Codex capabilities as Stable, Beta, or Experimental. Stable features are intended for production use; Experimental features can change or be removed. Check the live feature-maturity page before making an exercise depend on a newer command. For example, the cloud service is current while some codex cloud CLI commands may still be marked Experimental.

Where configuration lives

User defaults live in ~/.codex/config.toml; a repository can add trusted project configuration under .codex/config.toml. Keep durable coding instructions in AGENTS.md, not in an ever-growing config file.

On this page