OpenAI debuts new AI coding agent that writes, edits, and executes commands locally

OpenAI debuts new AI coding agent that writes, edits, and executes commands locally

Technology


OpenAI has launched a new AI coding agent designed to carry out local code and computing tasks autonomously on a user’s terminal.

Codex CLI is said to be an open-source coding agent capable of reading, modifying, and running code locally on a user’s terminal. The Microsoft-backed AI startup announced the new AI programming tool alongside its latest, most advanced AI reasoning models, o3 and o4-mini, on Wednesday, April 16.

“OpenAI Codex CLI is an open‑source command‑line tool that brings the power of our latest reasoning models directly to your terminal,” the company said in a blog post. The coding agent integrates the company’s AI models with the client’s command-line interface (CLI) used to run programmes, manage files, and more.

Story continues below this ad

Codex CLI is powered by OpenAI’s latest o4-mini model by default, according to the company. However, users can choose the AI model they prefer via the Responses API option. While the AI coding agent can run on macOS and Linux systems, OpenAI said that Windows support is still in the experimental stage and might require users to set up Windows Subsystem for Linux (WSL).

Codex CLI is OpenAI’s latest efforts in moving towards its broader vision of agentic AI. Earlier this year, the company introduced its Operator tool that is meant to assist users in creating to-do lists and vacation planning by autonomously browsing the web and interacting with on-screen buttons, menus and text fields.

With Codex CLI, OpenAI is also positioned to take on AI coding assistants such as Claude Code from rival Anthropic.

Key features of Codex CLI

The AI coding agent is capable of processing multimodal inputs as user prompts. This includes text, screenshots, and diagrams that helps the agent generate or modify the code accordingly.

Story continues below this ad

“You can get the benefits of multimodal reasoning from the command line by passing screenshots or low fidelity sketches to the model, combined with access to your code locally,” OpenAI said.

It also appears that users can choose how independently the AI coding agent should work with three distinct ‘approval modes’. In Suggest mode, Codex CLI can read files, suggest edits, and make changes to the code or execute commands pending approval from the user. This is meant for code reviews or learning a codebase.

In Auto Edit mode, the agent will read and modify files on its own. However, it will require user approval before running the code. This mode is most suitable for carrying out repetitive edits where users may still want to keep an eye on the process, as per OpenAI.

The third mode called Full Auto is longer tasks like fixing a broken build or prototyping features. In this case, Codex CLI can read, write, and execute commands autonomously inside a sandboxed, network‑disabled environment scoped to the current directory. “If using Full Auto mode, confirm that the sandbox has permission to access required directories,” OpenAI said.

Story continues below this ad

Codex warns users before entering Auto Edit or Full Auto if code revision tracking is not enabled in the directory. To switch between approval modes, OpenAI said, “Start Codex with the appropriate flag (–suggest, –auto-edit, –full-auto) or use the in‑session shortcut /mode to toggle.”

How to access Codex CLI?

Since it has been rolled out as an open-source AI tool, Codex CLI is freely available for download on GitHub. Follow the steps below to install Codex CLI on your terminal:

– Install npm install -g @openai/codex from GitHub
– Export your OpenAI API key (export OPENAI_API_KEY=”gt;”).
– Type codex from your project root
– Run the coding agent in Suggest mode
– Ask for example: “Explain this repo to me”
– Switch modes by inputting codex –auto-edit and codex –full-auto
– Review outputs

In terms of privacy and security, OpenAI claimed that the source code of software developed by users will never leave their environment. “All file reads, writes, and command executions happen locally. Only your prompt, high‑level context, and optional diff summaries are sent to the model for generation,” the company said.





Source link

Leave a Reply

Your email address will not be published. Required fields are marked *