Codex CLI is an AI coding agent that runs in your terminal. It is separate from cloud or IDE versions, and is started with the codex command inside the project directory you want to work on.
What you need
- Node.js and npm
- Internet access
- An account that can use Codex
- A project directory
- A terminal environment
Step 1: Install Codex CLI
The official documentation provides an npm-based install command.
npm i -g @openai/codexTo update an existing install, install the latest version again.
npm i -g @openai/codex@latestStep 2: Check the command
Confirm that your shell can find the codex command.
codex --version
which codexIf command not found appears, the npm global install location may not be on PATH.
Step 3: Sign in
Run Codex CLI once and follow the authentication prompt.
codexStep 4: Start it in a project
Move to the project directory and start Codex there.
cd your-project
codex- codex runs from the terminal
- Authentication is complete
- Codex starts inside the target project
- The command is available before connecting from Even Terminal