Walkthrough

Install and Authenticate

Codex CLI on macOS / Linux, signing in, picking a model.

Steps · 0 / 4 done
  1. Install via npm

    Install the Codex CLI globally.

    npm install -g @openai/codex
    Verify`codex --version` prints a version.
  2. Authenticate

    Run codex once and pick "Sign in with ChatGPT" — usage is included with Plus/Pro/Team plans. Prefer pay-per-token? Set OPENAI_API_KEY in your shell instead.

    codex
    VerifyAfter auth, the status line shows your account, model, and approval mode.
  3. Pick a model for mobile work

    gpt-5.1-codex-max is the agentic default and the right call for scaffolding. /model also sets reasoning effort — medium for iteration speed, high or xhigh when it must not miss.

    /model gpt-5.1-codex-max
    VerifyThe status line confirms the model and reasoning effort. You can switch mid-session at any time.
  4. Give it project memory

    Codex reads AGENTS.md — at repo root, in subfolders, and globally in ~/.codex — the same idea as CLAUDE.md from Course 1. Keep build commands and house rules there.

    # AGENTS.md
    
    - Expo app, TypeScript strict. Dev: `npx expo start`.
    - Tests: `npm test`. Run them before declaring anything done.
    - Never hand-edit ios/ or android/ — they're generated by prebuild.
    VerifyA fresh session mentions your conventions without being told.
Check your understanding
Q1. Two valid ways to authenticate with Codex are…
· Tick off the 4 step(s) above.
· Score 100% on the quiz.