Skip to content
Courses/Codex for programmers/Install Codex and understand its surfaces

Install Codex and understand its surfaces

Set up Codex CLI, sign in, and choose the right surface before touching a real repository.

What you will learn

  • Install and verify Codex CLI.
  • Choose between the CLI, IDE extension, app, and cloud tasks.
  • Open a first session inside a repository.

Minimal setup

Codex CLI works with the files and tools on your machine. OpenAI recommends the standalone installer on macOS and Linux; npm remains a cross-platform alternative. Check the version before signing in.

Terminal
# Recommended on macOS and Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# npm alternative
npm install -g @openai/codex

codex --version
cd ~/code/my-project
codex

On first launch, follow the sign-in flow shown by Codex. Inside a session, /status summarizes the active directory, model, and permissions.

Terminal
/status
/permissions
/model

Choose a surface

  • CLI for fast local work, scripts, Git, and terminal-native workflows.
  • IDE for changes closely tied to the file or selection in view.
  • App for longer tasks, visual review, and coordinating parallel work.
  • Cloud for delegated work in a prepared, isolated environment.

Codex alongside Cursor, Windsurf, or your IDE

You do not need to choose a single tool. Use Cursor, Windsurf, or your IDE for localized edits, visual navigation, and small refactors. Use Codex when you need to traverse a repository, run commands, review Git, automate checks, or complete a whole task with evidence.

Practical rule: if the context fits on one screen, the IDE works well; if the context lives across files, commands, logs, and commits, Codex usually gives you more operational control.

First check

Start with a read-only request: “Summarize the architecture, tell me how tests run, and do not edit files.” Confirm that Codex identifies the language, package manager, and Git state correctly.

Lesson deliverable

What you will build

A working Codex setup and a first read-only session.

Why it matters

Before delegating changes you need to know which surface to use, which permissions are active, and how to verify the setup.

Starter repository or files

Any small Git repository. If you do not have one, create an empty folder with README.md.

Steps

  1. 1. Install Codex CLI.
  2. 2. Check the version.
  3. 3. Open Codex inside the repository.
  4. 4. Run /status, /permissions, and /model.
  5. 5. Ask for analysis without edits.

Copy-ready Codex request

Summarize this repository's architecture, tell me how tests run, and do not edit files. Cite concrete paths and separate observed facts from inferences.

Expected result

Codex identifies the project type, likely commands, and boundaries of what it has not inspected yet.

Verification command

codex --version && git status --short

Manual check

Confirm that git status shows no changes after the analysis.

Common error. Opening Codex outside the repository. Fix: cd into the project root first.

Mini exercise

Open a second session and request the same analysis limited to one specific folder.

Show solution

Use explicit scope: “Focus only on app/ and state which parts you did not read.”

Evidence to save

Save Codex version, /status output, and clean git status.

Official sources and tested version

OpenAI CodexTested: 2026-07-12
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue