This is Part 1 of the Codex CLI series. We’ll cover installation, authentication, and your first session. Future posts will explore workflows, best practices, and advanced features.
Codex CLI Overview: Terminal-Based AI Coding Agent
Today I want to introduce you to Codex CLI—a tool that has genuinely changed how I work with both code and writing.
If you have ever wished you could have an AI assistant that actually understands your project, can read your files, and help you make changes right from your terminal, Codex CLI is exactly that. It is not just another chatbot; it is designed to work inside your repository, understanding your code structure and helping you improve it safely.
In this series, I will walk you through everything you need to know to use Codex CLI productively. Today’s post covers the fundamentals: what it is, how to install it, and how to take your first steps safely.
What Is Codex CLI?
Before we jump into installation, let me explain what Codex CLI actually is and why it is different from using ChatGPT in a browser.
The Core Concept
Codex CLI is a coding agent that runs locally in your terminal. When you start it in a project directory, it can:
- Read all the files in that directory
- Understand your project structure
- Propose changes to files
- Run commands (with your approval)
- Show you diffs before applying changes
Think of it as having an experienced developer pair-programming with you, but one who works incredibly fast and has read your entire codebase. See the [official Codex CLI documentation][1] for the complete command reference.
How It Differs from ChatGPT
Here is a helpful comparison:
ChatGPT in a browser:
- Great for discussing ideas and getting code snippets
- You copy and paste code back and forth
- It does not know about your actual project files
- Every conversation starts fresh
Codex CLI:
- Understands your entire repository context
- Can directly edit your files (with approval)
- Can run tests and commands in your environment
- Maintains conversation history across sessions
The key difference is context and action. Codex CLI sits next to your actual code and can help you work with it directly.
Codex CLI vs ChatGPT: Quick-Reference
| Dimension |
ChatGPT in Browser |
Codex CLI in Terminal |
| Project context |
None — you paste snippets manually. |
Full repo read; understands file structure. |
| File editing |
You copy-paste suggestions back manually. |
Proposes and applies diffs with your approval. |
| Command execution |
Cannot run commands. |
Runs pytest, ruff, build scripts in your env. |
| Session memory |
Resets every conversation. |
Maintains history; resumable across sessions. |
| Safety model |
No guardrails on outputs. |
Approval modes: read-only → auto → full access. |
| Best for |
Ideas, snippets, brainstorming. |
Repo-native edits, QA, automation, refactors. |
The Safety Model
Here is what I appreciate most: Codex CLI is built with safety guardrails. By default, it asks for permission before:
- Editing files
- Running commands
- Making network requests
You control how much autonomy to give it through “approval modes” (which I will explain in Part 2). This means you can start conservatively and gradually trust it more as you become comfortable.
Installation Guide
🔒 Subscribe to keep reading.
Authentication
🔒 Subscribe to keep reading.
Your First Session
🔒 Subscribe to keep reading.
Codex CLI Practice Checklist: Recommended First Steps
🔒 Subscribe to keep reading.
Codex CLI Series Roadmap: Parts 2–4
🔒 Subscribe to keep reading.
Codex CLI Adoption Strategy: Building Trust Gradually
🔒 Subscribe to keep reading.
You've hit a Deep Dive tutorial.
I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):
Full content temporarily unavailable — refresh in a moment
Already a subscriber? Use the magic link from your last newsletter, or reset your password.
Log in to unlock
New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.