OpenAI has released Codex CLI, an open-source command-line interface tool designed to bring AI-assisted coding directly into a developer’s terminal.
Highlights
Operating within a sandboxed local environment, Codex CLI is built to help with a broad range of development tasks while prioritizing user privacy and offline usability.
The tool functions as an AI agent capable of reading, modifying, and executing code locally. It is intended as a lightweight assistant that merges agent-like autonomy with the convenience of local execution.
Developers can use Codex CLI to edit code, navigate project files, and run shell commands—all from the terminal. OpenAI notes that the project remains under active development and may not yet be fully stable.
Offline Execution with Selective Online Integration
Codex CLI runs entirely on the user’s machine and is compatible with macOS and Linux. Windows support is currently experimental and requires Windows Subsystem for Linux (WSL).
While the tool executes code locally, it does send certain elements—such as prompts, high-level context, and optional diff summaries—to OpenAI’s servers for processing. An API key is required to use these features, meaning the tool is not entirely offline or free.
By default, Codex CLI uses OpenAI’s o4-mini model, but users can switch between models depending on performance needs. This offers a hybrid approach—combining cloud-connected AI capabilities with local execution and code security.
Multi-Level Execution Modes for User Control
Codex CLI provides three execution modes, enabling varying degrees of automation:
- Suggest Mode: The AI reads files and suggests code edits or shell commands, requiring user approval before executing any actions.
- Auto Edit Mode: The AI is permitted to edit code automatically but still asks for user confirmation before executing commands.
- Full Auto Mode: The AI operates independently, reading, writing, and executing tasks within a network-disabled, sandboxed directory—ideal for trusted, speed-focused workflows.
Mode | Automation Level | Required Confirmations | Ideal Use Cases |
---|---|---|---|
Suggest |
• Reads files and proposes edits • Suggests shell commands |
• User must approve every file write/patch • User must approve any shell command |
• Safe exploration • Code reviews • Learning a new codebase |
Auto Edit | • Reads and applies code patches automatically | • User must approve before executing any shell commands |
• Refactoring • Repetitive edits • Enforcing consistent code style |
Full Auto |
• Reads, writes, and executes commands autonomously • Runs in a network-disabled sandbox |
• No confirmations for edits or commands (network disabled) |
• Long-running tasks (e.g., fixing builds) • Rapid prototyping • Fully automated workflows |
Multimodal Input Support
Beyond text commands, Codex CLI supports multimodal inputs, allowing developers to provide visual content such as screenshots or diagrams.
This feature enables the AI to interpret visual information and translate it into functional code, streamlining tasks that traditionally require manual interpretation of visual design elements.
Security and Sandboxing Features
Codex CLI emphasizes local control and sandboxed execution. In Full Auto mode, the tool operates in a secure, network-disabled environment limited to the working directory.
On macOS, it uses Apple’s sandbox-exec
for file access control. On Linux, it runs in a Docker container configured with iptables
rules to prevent external network communication. These measures are designed to safeguard sensitive code and system resources.
Contextual Awareness and Memory Integration
The tool can improve its contextual understanding by reading from global (~/.codex/instructions.md
) and local (codex.md
) instruction files.
This allows Codex CLI to adapt its behavior based on project-specific conventions, improving the accuracy and relevance of its suggestions.
An experimental Full-Context Mode is also available, enabling the tool to cache and analyze the entire project directory. This provides a broader view of dependencies and architecture, which can enhance the quality of generated code and reduce integration errors.
Seamless Installation and Open-Source Access
Codex CLI is available via a simple installation command:
bashCopyEditnpm install -g @openai/codex
The tool is fully open-source and hosted on OpenAI’s GitHub repository. Developers can inspect, modify, or contribute to the codebase, supporting transparency and encouraging community involvement.
API Grant Program to Foster Adoption
To promote adoption and experimentation, OpenAI has launched a $1 million API grant initiative. Selected software development projects can receive up to $25,000 in API credits, with the goal of encouraging deeper integration of Codex CLI into real-world workflows.
Codex CLI represents a step toward blending the advantages of AI-driven development with the control and privacy of local tooling.
It offers a middle ground between cloud-based platforms and offline development environments, enabling developers to benefit from AI support without compromising the integrity of their codebases.