Getting Started with OpenAI Codex: A TPM’s Diving Deep Guide to Vibe Coding
What is Codex?
Codex is OpenAI’s developer-focused AI assistant designed to understand, generate, and modify code in dozens of programming languages. It builds on the same foundational technology as ChatGPT, but with a special emphasis on code reasoning, repository awareness, and task automation.
Unlike traditional AI code helpers that only autocomplete lines, Codex can work end-to-end:
- Read and understand your codebase across multiple files.
- Modify files directly in your working directory.
- Propose changes with the option to approve them.
- Run commands, tests, or scripts in a sandboxed environment.
- Follow your style guides and project-specific conventions.
Think of it as a pair programmer in your terminal — one who can refactor, debug, test, and document your project without constant copy-pasting into a browser window.
Codex comes in two main flavors:
- Cloud-based agent inside ChatGPT (Plus, Pro, Team plans) for quick, conversational code help.
- Codex CLI — a command-line tool for macOS/Linux that integrates directly with your local projects, Git repos, and shell commands.
See why we rely on Fastmail to power all our emails
As a Technical Program Manager, it would be handy even if you aren’t a day-to-day coder to vibe code, as well as leverage Codex to help you understand the code base your engineers are working on. In this tutorial, we’ll focus on the CLI version, walking through installation, setup, and real-world coding examples on macOS.
This tutorial assumes you have an OpenAI pro or plus license.
1. Why Use Codex CLI?
Codex CLI is particularly useful when you want:
- Local code context without uploading files to a browser.
- Faster iteration by automating file edits and shell commands.
- Mode flexibility: from cautious suggestion mode to full automation.
- Version-controlled changes that can be reviewed before merging.
- Custom workflows tied to your project’s build, test, and deploy processes.
This makes it ideal for those who want AI to assist in maintaining quality and speed in software projects.
2. Installation on macOS
2.1 Prerequisites
- macOS 12 or newer
- Node.js v22+ (NVM recommended)
- Git (if working with version control)
- (Optional) An OpenAI API key or ChatGPT Plus/Pro/Team account
2.2 Install Node.js with NVM
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# Add to your shell config (~/.zshrc or ~/.bashrc)
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
# Reload your shell
nvm install 22
nvm use 22
nvm alias default 22
2.3 Install Codex CLI
We will use Homebrew to install Codex: brew install codex
Confirm its installed by checking for the version you have installed: codex --version