Start here: your first terminal task
Goal. Install the Codex CLI, point it at a real project, and hand the agent a whole task in plain English.
codex "Read anova_analysis.R, find the bug on line 34, fix it, and run the script to confirm it works."
Install Codex, run codex inside your project folder, and type your task. Codex starts in Agent mode — it reads files, runs commands, and writes changes in your project directory.
- 1Install. macOS/Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | sh. Windows PowerShell:irm https://chatgpt.com/codex/install.ps1 | iex. (Ornpm install -g @openai/codex/brew install --cask codex.) The CLI is open source. - 2Run
codexin your project folder. On first run, sign in with your ChatGPT account or an API key. - 3Type the task above. Codex reads the file, explains the problem, proposes the fix, and runs the script — pausing for your approval based on the approval mode (lesson 2).
You'll see. A fixed, re-run script — Codex read the file, found the bug, edited it, and confirmed the fix from one sentence.
Cost. Codex is included with a paid ChatGPT plan (Plus $20/mo, Pro from $100/mo); a Free ($0) and Go ($8/mo) tier exist for lighter use, or pay per token via the OpenAI API.
Takeaway. Codex is an agent in your terminal — describe the outcome and it reads your repo, edits files, and runs commands to get there.