Above you can see a lesson from our Use Codex CLI to Enhance Your Python Projects video course by Rodrigo Girão Serrão.
Important: Open your terminal and start Codex before following along with the video above:
$ codex
Type codex and press Enter to start a new Codex session. Ideally, you start Codex in a project folder that you trust rather than in your user home folder.
Watch the video above and follow along as Rodigo sets up Codex for the first time. You can ignore the instructions mentioning rpcontacts towards the end.
The most important step for you is to authenticate Codex by logging in. On the first run, Codex will prompt you to sign in. You have two options:
- Sign in with ChatGPT (recommended): run
codex loginand complete the sign-in in your browser. This works with any paid ChatGPT plan (Plus, Pro, Business, Edu, or Enterprise). - Use an OpenAI API key: run
codex login --with-api-keyand paste your key.
