+
Primary navigation

Codex IDE extension

Pair with Codex in your IDE

Codex IDE extension

Codex is OpenAI’s coding agent that can read, modify, and run code. It helps you build faster, squash bugs, and understand unfamiliar code. With the Codex VS Code extension you can use Codex side-by-side in your IDE, or delegate tasks to the cloud.

Set up the extension

The Codex IDE extension works with VS Code forks such as Insiders, Cursor, or Windsurf.

You can get the Codex extension from the Visual Studio Code marketplace, or download it for your IDE:

The Codex VS Code extension is available on macOS and Linux. Windows support is still experimental. For the best Windows experience, use Codex in a WSL workspace and follow our Windows setup guide. You can also reference the Microsoft docs for VS Code + WSL.

After installing, you’ll find the extension in your left sidebar next to other extensions. If you’re using VS Code, you might need to restart VS Code to see the Codex extension on the left sidebar.

If you’re using Cursor, by default this section will be displayed horizontally and Codex might be hidden in the collapsed items, so you can pin it and reorganize the order of the extensions. codex-extension

Adding Codex to the right sidebar

In VS Code you should be able to click and drag the Codex icon to the right of your editor screen to move it to the right sidebar to make it more accessible.

In some IDEs, like Cursor, you will have to first change the display of the activity bar temporarily.

Go into your editor settings and search for “activity bar” (in Workbench settings), then change the orientation to “vertical”. You’ll have to restart your editor to see the changes.

codex-workbench-setting

Now you can drag the Codex icon to the right of your editor screen into the same area as your Cursor chat. Codex will now be displayed as an additional tab in the sidebar.

After moving it you can reset the activity bar orientation to “horizontal” to restore the default behavior.

Sign in

Once you have installed the extension, you will be prompted to sign in with your ChatGPT account, which is the recommended path. You get usage credits with your ChatGPT plan, so you can use Codex without any additional setup. If you wish to use Codex with an API key, you can do so, but this requires additional setup—you can learn more about this and what’s included in each plan in our pricing page.

Update the extension

The extension auto-updates, but you can also open the extension page in your IDE to manually check for updates.

Keyboard shortcuts

Codex offers a series of commands that you can bind as keyboard shortcuts in your IDE settings such as toggling the Codex chat or adding something to the Codex context.

To see all available commands and bind them as keyboard shortcuts, press the Settings icon in the Codex chat and select “Keyboard shortcuts”.

Pair with Codex

Use Codex in your editor to chat, edit, and preview changes seamlessly. With context from opened files and selected code, you can write shorter prompts and get faster, more relevant results.

You can reference any file in your editor by tagging it in your prompt like this:

Use @example.tsx as a reference to add a new page named "Resources" to the app that contains a list of resources defined in @resources.ts

Switch between models

You can use Codex with GPT-5 (default), but we recommend switching to our newest model that is an optimized version of GPT-5 for agentic coding in Codex: GPT-5-Codex.

You can switch between models with the switcher under the extension chat input.

codex-switch-model

Reasoning effort

You can adjust the reasoning effort of Codex to make it think more or less before answering. With high reasoning effort, Codex will take longer to answer, but it can perform more complex tasks. If the tasks are simple and you need speed, you can use a lower reasoning effort.

You can adjust the reasoning effort with the same model switcher shown above, and choose between low, medium, and high for each model.g

Approval modes

We’ve chosen a powerful default for how Codex works on your computer called Agent. In this approval mode, Codex can read files, make edits, and run commands in the working directory automatically. However, Codex will need your approval to work outside the working directory or access the internet network.

When you just want to chat, or if you want to plan before diving in, you can switch to Chat with the switcher under the extension chat input.

codex-approval-modes

If you need Codex to read files, make edits, and run commands with network access, without approval, you can use Agent (Full Access). Exercise caution before doing so.

Detailed docs

The VS Code extension is built around the open source Codex CLI. For more detailed docs covering advanced configuration, MCP, and more, check out the README and docs on the GitHub repository: github.com/openai/codex.

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载