How to Add and Use a Project in Codex: CLI, VS Code and Desktop App (2026 Guide)

How to add and use a project in Codex: open a folder in the CLI, install the Codex extension in VS Code, or use the ChatGPT desktop app. Step-by-step, with safety tips.

How to Add and Use a Project in Codex: CLI, VS Code and Desktop App (2026 Guide)
Quick answer: how to add and use a project in Codex. To add a project to Codex, point it at your project folder. In the CLI, open a terminal in the project directory and run codex (or start it from anywhere with codex --cd /path/to/project). In VS Code, install the Codex extension (openai.chatgpt), open the project with File → Open Folder and open the Codex sidebar. In the ChatGPT desktop app, choose “create a project” or “open a folder”. Then describe a task, review the changes and commit them with Git.
How to add and use a project in Codex: CLI, VS Code and desktop app

Contents

Before you start

  • A ChatGPT account. Codex is included in the Free, Go, Plus, Pro, Business, Enterprise and Edu plans, so you sign in with ChatGPT; an API key also works in the CLI, SDK and IDE extension.
  • A project folder. A Git repository is best, because OpenAI recommends creating Git checkpoints before and after each Codex task so you can undo changes. If the project is not under Git yet, run git init and make a first commit.
1. Open project folder2. Start Codex there3. Review diff in Git
How to add and use a project in Codex: the three steps are the same in every app.

Method 1: how to add a project to Codex in the CLI

  1. Install the CLI. On macOS and Linux, OpenAI’s page gives curl -fsSL https://chatgpt.com/codex/install.sh | sh.
  2. Go to your project. In a terminal run cd /path/to/your-project.
  3. Start Codex. Run codex. The first time, choose “Sign in with ChatGPT” (or another sign-in method).
  4. Or set the project without changing directory. Run codex --cd /path/to/your-project. The --cd flag sets the working directory before the session starts.
  5. Give access to a second folder if needed. Use --add-dir to grant write access to extra directories, for example a shared library next to your project.

Method 2: how to add a project to Codex in VS Code

This is the route most people want: you stay inside the editor, and Codex works on the folder you have open.

1. Install extension2. Open folder3. Open Codex sidebar4. Sign in
How to add a project to Codex in VS Code in four steps.

Step 1: install the Codex extension

  1. Open VS Code and click the Extensions icon (or press Ctrl+Shift+X on Windows/Linux, Cmd+Shift+X on Mac).
  2. Search for Codex by OpenAI (Marketplace item ID openai.chatgpt) and click Install.

Step 2: open your project folder

Choose File → Open Folder and select your project. Codex treats the folder you opened as the project, so open the repository root rather than a single file.

Step 3: open the Codex sidebar

Click the Codex icon in the sidebar. If you do not see it, press Ctrl+Shift+P (Cmd+Shift+P on Mac) and run Codex: Open Codex Sidebar.

Step 4: sign in

Sign in with your ChatGPT account when asked. The IDE extension can also use an API key billed at API pricing.

Step 5: run your first task in VS Code

  1. Start with something small, such as “explain how this project is structured”.
  2. Then ask for a real change, for example “add a unit test for the login function”.
  3. Read the proposed changes, accept only what you understand and commit.

Does the extension work in Cursor, Windsurf and other editors?

Per OpenAI’s docs, the extension works in VS Code, Cursor, Windsurf and VS Code Insiders, so the same steps apply there. Xcode and JetBrains IDEs have separate Codex integrations rather than this extension.

Method 3: add a project in the ChatGPT desktop app

OpenAI’s desktop app (macOS, Windows and Linux) lets you “choose where to work”: start a chat, create a project, or open a folder. To add an existing codebase, open its folder; to start fresh, create a project. The exact buttons change between releases, so follow the on-screen prompts in your version.

Which method should you pick?

MethodBest forNeeds a terminal?
CLIDevelopers who live in the terminal; scripting and extra folders with --add-dirYes
VS Code extensionWorking inside your editor (also Cursor, Windsurf, VS Code Insiders)No
Desktop appA chat-style workspace without editor setupNo

How to use a project in Codex once it is added

  1. Make a Git checkpoint (a commit) so you can revert.
  2. Ask for a small, specific task, for example “add input validation to the signup form and update its tests”.
  3. Optionally plan first. The /plan slash command is listed in OpenAI’s docs.
  4. Review the diff before accepting anything.
  5. Run your tests, then commit.
  6. Come back later with codex resume to reopen a recent conversation in the CLI.

Safety settings worth knowing

SettingWhat it does
/permissionsControls when Codex can edit files or run commands without asking
--sandbox read-onlyCodex can read but not change files; a safe first run
--sandbox workspace-writeCodex can edit files in the workspace
--ask-for-approvalControls when Codex pauses for your OK

If Codex does not show up in VS Code

  • Reload the window: Command Palette → Developer: Reload Window.
  • Check that the extension is enabled and published by OpenAI.
  • Make sure you opened a folder, not an empty window.
  • Update VS Code to a recent version, then reinstall the extension.

How to add and use a project in Codex: the short version

If you only remember one thing about how to add and use a project in Codex, remember this: open the project folder first, start Codex inside it, and review every change with Git. Whether you add a project in the CLI, in VS Code or in the desktop app, the way to use a project in Codex is the same: make a checkpoint, ask for a small task, review the diff, run your tests and commit.

That routine is all there is to how to add and use a project in Codex safely, and it keeps your work easy to undo if an agent makes a mistake.

Related guides: How good is Codex? 2026 review · CodexBar usage tracker

Sources, as read in November 2026: OpenAI’s Codex docs for the CLI, IDE extension and desktop app, plus the OpenAI Codex listing on the VS Code Marketplace.

Add and use a project in Codex: FAQ

How to add and use a project in Codex for the first time?

Install your preferred Codex app (CLI, VS Code extension or desktop app), open your project folder, start Codex inside it and begin with a small, specific task. Commit before and after so you can review and revert.

How do I add a project to Codex?

Open the project folder in your Codex app: run codex inside the folder in the CLI, open the folder in VS Code and use the Codex sidebar, or choose “open a folder” in the desktop app.

How do I add a project to Codex in VS Code?

Install the OpenAI Codex extension, open your project folder with File → Open Folder, open the Codex sidebar and sign in with ChatGPT.

How do I add a project to use Codex without the terminal?

Use the VS Code extension or the ChatGPT desktop app. Both let you open a folder and work from a chat panel.

Is the Codex extension free?

The extension is free to install. Usage is covered by your ChatGPT plan (including Free, with limits) or billed at API pricing if you use an API key.

Which editors does the Codex extension support?

VS Code, Cursor, Windsurf and VS Code Insiders, according to OpenAI’s docs.

How do I open the Codex sidebar if the icon is missing?

Run “Codex: Open Codex Sidebar” from the Command Palette.

Do I need Git to use Codex on a project?

Not strictly, but OpenAI recommends Git checkpoints before and after tasks so you can revert any change.

Can Codex work on more than one folder?

Yes. In the CLI, --add-dir grants write access to additional directories.

How do I reopen a past Codex session in a project?

Run codex resume in the CLI to pick up a recent conversation.

Get new guides in your inbox
One email. No noise.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.