Skip to main content
toolsSource-backedReview first Safety Privacy

OpenAI Codex CLI

Lightweight, open-source coding agent from OpenAI that runs in your terminal, edits and runs code locally with configurable sandbox and approval modes, and authenticates with a ChatGPT plan or API key.

by OpenAI·added 2026-06-05·
CLI
HarnessCLI
Review first review before installing

Open the source and read safety notes before installing.

Safety notes

  • Codex CLI runs as a local agent that can edit files and execute commands on your machine.
  • It supports configurable sandbox and approval modes; keep approvals enabled and review proposed actions before allowing them.
  • Lowering approval or sandbox restrictions lets the agent act more autonomously, increasing the risk of unintended changes.
  • Review generated code and commands before running them against important repositories or systems.

Privacy notes

  • Code and prompts are sent to OpenAI to power the agent under your ChatGPT plan or API key.
  • Data handling follows OpenAI's policies for the plan or API you authenticate with; review them before processing sensitive code.
  • API keys and account credentials should be stored securely and never committed to source control.

Prerequisites

  • A ChatGPT plan (Plus, Pro, Business, Edu, or Enterprise) for plan-based sign-in, or an OpenAI API key.
  • Node.js and npm for the npm install, or Homebrew for the cask install.
  • A terminal on macOS, Linux, or Windows.

Schema details

Install type
copy
Troubleshooting
No
Source repository stats
Scope
Source repo
Tool listing metadata
Pricing
open-source
Disclosure
editorial
Application category
DeveloperApplication
Operating system
macOS, Windows, Linux
Full copyable content
# npm
npm install -g @openai/codex

# Homebrew
brew install --cask codex

About this resource

Overview

OpenAI Codex CLI is a lightweight coding agent that runs in your terminal. It is a local agent from OpenAI that helps with coding tasks on your computer across macOS, Linux, and Windows, and is also available as an IDE integration and a web experience.

It is released under the Apache-2.0 license and written primarily in Rust. The CLI itself is free and open source; inference is billed through your ChatGPT plan or OpenAI API usage.

Features

  • Runs locally in the terminal as a coding agent.
  • Configurable sandbox and approval modes for controlling autonomy.
  • Authenticates with a ChatGPT plan or an OpenAI API key.
  • Also available as IDE integrations (VS Code, Cursor, Windsurf) and on the web.

Use Cases

  • Drive an AI coding agent from the terminal on a local repository.
  • Use an existing ChatGPT plan for coding assistance without separate billing.
  • Run code edits and commands under explicit approval and sandbox controls.

Installation

# npm
npm install -g @openai/codex

# Homebrew
brew install --cask codex

Disclosure

Editorial listing. No paid placement or affiliate relationship. Codex CLI is open source under Apache-2.0; using it requires a paid ChatGPT plan or OpenAI API usage.

#ai-coding#cli#terminal#openai#open-source#developer-tools

Source citations

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.