Codex in the terminal is a coding agent that works inside your project folder. It can read the structure, propose changes, run checks, and explain what it found. It works best with specific requests and human review before anything is published.
Before you install
Use a terminal on macOS or Linux and keep your project in a folder you recognize. If the project uses Git, check its current state first. This makes it easier to separate your own work from changes made during the task.
git status
Install on macOS or Linux
The official installer downloads the appropriate version for your system:
curl -fsSL https://chatgpt.com/codex/install.sh | shClose and reopen your terminal if the command is not recognized right away. Then check the installation:
codex --version
Sign in
From a project folder, run:
cd path/to/your/project
codexOn the first run, Codex shows a sign-in flow. Complete authentication in the browser it opens, then return to the terminal. To sign in from another device, use:
codex login --device-auth
Make your first request
Start with something small and easy to check:
Explain this project's structure and where the application starts.
Find unused files and only list the candidates; do not change anything yet.
Create a contact page that follows the site's existing visual pattern and run the available checks.Ask Codex to show what changed and which checks it ran. If a task involves publishing, credentials, payments, or deleting data, review it carefully before moving on.
Useful commands
| Command | What it does |
|---|---|
codex resume | Continues an earlier conversation. |
codex review | Opens a review of project changes. |
codex doctor | Helps diagnose the installation. |
codex mcp list | Lists configured MCP connections. |
codex update | Updates the installation when a new version is available. |
A safe way to work
- State the outcome you want and name the relevant folder or file.
- Ask for a plan when the change is large.
- Review the change before accepting or publishing it.
- Run the checks that fit the project.
- Use Git to record a change you understand.
Official documentation
The Codex CLI documentation and the command reference are the right sources for current installation steps and options.