Install OpenAI Codex CLI in one evening, sign in, and complete one small Python task in a practice folder—written for after-work learners who review every change.
OpenAI Codex CLI is a coding agent that runs in your terminal on your own machine. You describe a task in plain language; it can read your project, propose edits, and run commands under the permissions you allow. Official docs list several install options, including npm (npm install -g @openai/codex), Homebrew on Mac (brew install --cask codex), platform binaries from GitHub Releases, and OpenAI's standalone installer scripts. After install you run codex and sign in—usually with ChatGPT (Plus, Pro, Business, Edu, or Enterprise) or with an API key if you prefer that setup. Source: github.com/openai/codex.
This guide is for after-work learners who already write a little Python (or want to) and keep hitting the same friction: small scripts, messy folders, “what should I change next?” You do not need a full-time engineering role. You need one quiet evening, a disposable practice folder, and the habit of reviewing every change before you trust it.
If you are comparing terminal agents with editor agents, see also our Hub note on top AI agent tools for after-work Python. Tonight the goal is narrower: get Codex CLI installed and complete one safe task.
Skip this for tonight if you do not yet have Python on PATH. Fix that first with a basic environment setup, then come back.
If you already use Node.js, the npm global install is a clear after-work path:
npm install -g @openai/codex
On Mac with Homebrew:
brew install --cask codex
Prefer one method. Mixing installers in the same evening creates PATH confusion. For standalone installer scripts (Mac/Linux or Windows PowerShell), follow the Quickstart on the official repository README rather than copying installers from random blogs.
Open a new terminal and check:
codex --version
If the command is missing, the shell session is stale or the install did not land on PATH. Close the tab and try again before troubleshooting anything else.
mkdir -p ~/codex-practice && cd ~/codex-practice
codex
Choose Sign in with ChatGPT when prompted if that matches your plan, or follow OpenAI’s API-key auth docs if you use keys. Do this on a personal practice folder first—not on work repos with secrets, .env files, or client data.
Ask for something you can verify by eye, for example:
Create
hello_stats.pythat prints the count of words in a hard-coded string and exits. Do not touch any other files.
Watch the proposal. Approve only what you understand. Prefer tasks that create or edit one file over “refactor the whole project.”
Leave Codex (or open a second terminal) and run:
python hello_stats.py
# or: python3 hello_stats.py
If the output is wrong, ask Codex for a focused fix—not a rewrite. Your learning signal is the loop: request → review → run → adjust.
End the session when one script works. Resist “while we are here” follow-ups. After-work progress compounds from finished nights, not from open-ended agent chats.
In ~/codex-practice, ask Codex to add greet.py that takes a name from input() and prints Hello, <name>. Run it twice with two names. Then open the file and rewrite the prompt string by hand so you still own the code.
When the CLI feels calm, harden the skill that actually matters after work: writing and reading Python yourself. Start with Introduction to Python Programming—short lessons built for employed evenings, not a three-day workshop you cannot attend.