OpenAI Codex

OpenAI Codex CLI is a terminal-based coding agent and developer toolkit developed by OpenAI. It enables engineers to invoke LLM-assisted code generation, refactoring, and automated repository workflows directly from the command line and scriptable environments. In day-to-day development, the tool functions as an interactive terminal interface and scriptable CLI that connects to OpenAI's coding models. It integrates tightly with repository contexts, tool orchestration protocols such as the Model Context Protocol (MCP), and multi-package monorepo environments powered by Rust and TypeScript toolchains. Developers can prompt the agent to inspect files, execute tasks, generate diffs, and automate complex code maintenance tasks. What sets this project apart is its tight integration with standard developer infrastructure—including Bazel, Dev Containers, and native Model Context Protocol (MCP) conformance. It supports structured skills, encrypted session histories, and local API proxying to fit into enterprise and production development pipelines. The repository is hosted openly by OpenAI, providing a CLI binary, TypeScript SDK, and backend proxy integrations for building and running terminal agent workflows.

Tags: ai agent, cli, code assistant, coding agent, terminal

Visit OpenAI Codex

Key features

  • Terminal & CLI Interface — Run automated coding sessions, tasks, and repository edits directly from the command line. - Model Context Protocol (MCP) Support — Conforms to MCP standards to connect local context, external tool sets, and data sources. - TypeScript SDK & Tooling — Provides programmatic access alongside the CLI binary for custom developer automation. - Skill & Workflow Automation — Extensible agent architecture designed to handle issue triage, test runs, and multi-step CI tasks. - Encrypted Session History — Encrypts session notes, tool execution arguments, and local interaction history for security. - High-Performance Monorepo Architecture — Built on a hybrid Rust and TypeScript core with Bazel build support for high-throughput execution.

Use cases

Use Case: Automated Repository Refactoring Developers can execute the CLI to analyze source files across a monorepo, apply structural refactoring rules, and verify changes against local test suites.

Use Case: MCP Tool Orchestration Engineers building custom internal tooling can link the agent to external context providers and APIs using Model Context Protocol integrations to perform cross-service tasks.

Use Case: Scripted CI/CD Code Maintenance Teams can integrate the CLI into automated build pipelines to generate changelogs, triage repository issues, and automate routine code health checks.

Who it is for

This tool is designed for software engineers, DevOps specialists, and automation engineers who prefer terminal-native AI workflows and need deep integration with MCP and CI pipelines. It is less suitable for non-technical users or developers who only want basic graphical editor autocompletion without terminal configuration.

Install guide

Installation Install the CLI tooling using pnpm or npm (standard method for the Node/TypeScript distribution): bash pnpm install -g @openai/codex Alternatively, build the native Rust binary from source in a cloned workspace: bash git clone https://github.com/openai/codex.git cd codex cargo build --release

First Run Set your OpenAI API key in your environment: bash export OPENAI_API_KEY="your-api-key-here" Verify the CLI installation: bash codex --help

Example Session Run an interactive coding task against your current project: bash codex run "Review src/index.ts and add unit tests for all exported functions"

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • Claude Code — Claude Code is an official terminal-based agentic coding tool developed by Anthropic. Executed via the `claude` CLI command, it provides…
  • Cursor CLI — Cursor CLI is a terminal-based autonomous coding agent developed by Anysphere, the team behind the Cursor editor. It brings Cursor's…
  • ZAP — ZAP is an open-source, terminal-based AI coding agent implemented in Rust by the zap-coding-agent project. It provides an autonomous command-line…
  • Junie — Junie is an autonomous terminal-based AI coding agent developed by JetBrains. Built on top of the IntelliJ IDEA engine, it…
  • FetchCoder — FetchCoder is a terminal-based AI coding assistant developed under the Fetch.ai organization. Built specifically for command-line workflows, the tool provides…
  • Kolega Code — Kolega Code (kolega-code) is an open-source Python-based terminal coding agent developed by the Kolega AI team. It is built to…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories