Codex IDE Extension

The Codex IDE extension lets you use Codex directly in your familiar development environment, seamlessly integrating into your daily coding workflow.


Supported IDEs

Codex officially supports the following IDEs:

IDEExtension IDInstallation method
VS Codeopenai.chatgptvscode:extension/openai.chatgpt
VS Code Insidersopenai.chatgptExtension Marketplace
Cursoropenai.chatgptcursor:extension/openai.chatgpt
Windsurfopenai.chatgptwindsurf:extension/openai.chatgpt

Install Extension

VS Code Installation

VS Code Installation

# Method 1: Command line installation
code --install-extension openai.chatgpt

# Method 2: In VS Code
# 1. Open the extension panel (Cmd+Shift+X)
# 2. Search for "Codex" or "ChatGPT"
# 3. Click Install

Cursor Installation

Cursor Installation

# Method 1: Command line
cursor --install-extension openai.chatgpt

# Method 2: In Cursor
# 1. Open the extension panel
# 2. Search for "Codex"
# 3. Click Install

After installation, you need to log in with a ChatGPT account or OpenAI API Key to use it.


Core functionality

Automatic Context

The IDE extension automatically passes the following content to Codex as context:

  • Currently open file list
  • The text range selected in the editor
  • Current working directory info

AI Chat

Chat directly with Codex in the IDE:

  • Open the Codex panel (via shortcut key or sidebar)
  • Enter a question or task description
  • Codex analyzes the current file and project, then replies.

Code Actions

After selecting code, right-click to execute:

OperationFeatures
ExplanationCodex explains the functionality of the selected code.
RewriteRewrite the selected code as required
ReviewCheck code issues and improvement suggestions
Generate TestsGenerate unit tests for the selected code

Slash Commands

Use slash commands in the Codex panel:

CommandFeatures
/explainExplain selected code
/fixFix issues in the selected code
/testGenerate tests for the selected code
/reviewReview selected code
/planPlan first, then execute

Slash command examples

# Explain code
/explain

# Fix Bugs
/fix this function throws error for null input

# Plan New Features
/plan implement user authentication with JWT

Model Selection

Below the input box, you can switch models:

ModelFeatures
GPT-5.4Flagship model, suitable for complex tasks
GPT-5.4-miniLightweight and fast, suitable for simple tasks
GPT-5.3-CodexProfessional coding model

Shortcuts

ShortcutsFeatures
Cmd+Shift+COpen the Codex panel
Cmd+Shift+EnterCode Completion
Cmd+Shift+RRewrite selected code
Cmd+Shift+EExplain selected code

Shortcut keys can be customized in IDE settings to avoid conflicts with other extensions.


Cloud task delegation

Start cloud tasks from the IDE extension:

  • Select Cloud mode to create a thread.
  • Tasks run in an isolated cloud environment
  • After completion, view results via notification or PR

Applicable scenarios

  • Need to process multiple tasks in parallel
  • Delegate large tasks from low-configuration devices
  • Cross-device collaboration

IDE Configuration

Set file opening method

Configuration file opened

# ~/.codex/config.toml

# Specify the editor for opening files
file_opener = "vscode"
# Optional values: vscode, vscode-insiders, windsurf, cursor, none

Set default model

Configure default model

# ~/.codex/config.toml

model = "gpt-5.4"

Usage Tips

Select code as context

After selecting code, Codex automatically uses it as context.

The more code you select, the more accurate Codex's replies will be.

Multi-file Operations

When multiple files are open, Codex can handle them simultaneously.

Simply describe the file you need to modify in the panel.

Use built-in terminal

The IDE built-in terminal can directly run Codex CLI.

This way, you can enjoy the full functionality of the CLI.


FAQ

Q: Extension cannot connect?

Make sure you are logged in to your Codex account, and check the network connection and proxy settings.

Q: Keyboard shortcuts conflict with other extensions?

Search for "Codex" in the IDE settings and customize the keyboard shortcuts.

Q: How to update the extension?

The extension updates automatically with Codex, or you can manually update it in the IDE extensions panel.

Q: What is the difference between IDE extensions and App?

The IDE extension deeply integrates with the development environment and automatically reads file context; the App offers full functionality and multi-project management.

other extensions