Home › Codex course: 3 beginner lessons

Codex course: 3 beginner lessons

Last checked

What it does

Codex is OpenAI's coding agent. It works in ChatGPT, in your terminal (Codex CLI), in your editor and in the cloud, fixing bugs, building features and reviewing pull requests.

Who it's for: Developers, and people learning to code, who want an AI agent to read, change and review code.

Made by OpenAI.

Sign up and log in
  1. Codex is included in ChatGPT plans, so you sign in with your ChatGPT account.
  2. For the terminal, install Codex CLI: curl -fsSL https://chatgpt.com/codex/install.sh | sh (macOS/Linux), or npm install -g @openai/codex, or brew install --cask codex.
  3. On Windows, run the PowerShell installer from the Codex CLI page.
  4. Open a project folder and run codex.
  5. The first time, choose Sign in with ChatGPT (an API key also works, with some features missing).

On openai.com/codex: Plus US$20 (Codex usage for focused sessions each week), Pro US$100 (higher limits), Business US$20 per seat (2+ seats, billed annually).

Lesson 1: Install Codex CLI and run a first task

The quickest way to see what Codex does is to point it at a project you know and ask it to explain the code before changing anything..

  1. Install Codex CLI with one of the commands in Sign up and log in.
  2. cd into a project folder and run codex.
  3. Sign in with ChatGPT.
  4. Ask it to explain the project.
  5. Then ask for one small, focused change and review it before you keep it.

Open lesson 1 →

Lesson 2: Give Codex your rules with AGENTS.md

Codex reads AGENTS.md files before it starts work, so your test commands, tools and boundaries apply to every task without repeating them..

  1. Create ~/.codex/AGENTS.md for preferences that apply to every project.
  2. Add an AGENTS.md at the project root for that repository's rules.
  3. Add more AGENTS.md files in sub-folders when one part of the code needs different rules; the closest file wins.
  4. Check it loaded: codex --ask-for-approval never "Summarize the current instructions."
  5. Keep the files short and specific.

Open lesson 2 →

Lesson 3: Hand off tasks to Codex Cloud

Codex Cloud runs coding tasks on OpenAI's computers, so work keeps going while your laptop is closed, and you review the result as changes or a pull request..

  1. Open ChatGPT on the web or desktop app and sign in.
  2. Choose Work in → Cloud, open Select environment, then Create environment.
  3. Pick your GitHub repositories (connect GitHub if asked) and select Get started; Codex installs dependencies and tests the setup.
  4. Review the setup, then Publish and wait for Environment published.
  5. Start a new task, describe it, then review the changed files and test results and open a pull request when ready.

Open lesson 3 →

Sources

Start Lesson 1 →

Also: All OpenAI products · ChatGPT course · ChatGPT features and prices · All tutorials

Report an error on this page