https://developers.openai.com/codex/cli
### Install
Install the Codex CLI with npm.
```shell
npm i -g @openai/codex
```
### Run
Run Codex in a terminal. It can inspect your repository, edit files, and run commands.
```shell
codex
```
The first time you run Codex, you'll be prompted to sign in. Authenticate with your ChatGPT account or an API key.
### Upgrade
New versions of the Codex CLI are released regularly. See the [changelog](https://developers.openai.com/codex/changelog) for release notes. To upgrade with npm, run:
```shell
npm i -g @openai/codex@latest
```