Install Codex CLI
OpenAI's open-source coding agent in your terminal
Codex CLI is OpenAI's open-source terminal coding agent. Describe a task in natural language and it edits code, runs commands, and iterates locally on your machine.
npm install -g @openai/codexOther install methods
brew install --cask codexnpm install -g @openai/codexOther install methods
brew install --cask codexnpm install -g @openai/codexOther install methods
brew install --cask codexcodexcodex --versionBefore you start
The npm route needs Node.js 18+. Sign in with your ChatGPT account or an OpenAI API key on first run.
Official documentation: Codex CLI on GitHub
Frequently asked questions
Is Codex CLI open source?
Yes. Codex CLI is published on GitHub under an open-source licence and can be installed via npm or Homebrew.
Do I need an OpenAI account?
Yes — on first launch you sign in with ChatGPT or provide an OpenAI API key.
What's the difference from the Codex cloud agent?
Codex CLI runs locally in your terminal; the cloud agent runs tasks remotely. They share the same account.
Codex and OpenAI are trademarks of OpenAI, Inc. cli-install.com is an independent resource and is not affiliated with or endorsed by the trademark owner.