Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Setting Up Codex

Resources mentioned in this lesson:

00:00 Now that the Codex CLI is installed, you’ll want to set it up. Start by making sure you’re at the root of your rpcontacts project, just for the sake of convenience, and then run the command codex.

00:13 Once you do, you’ll be asked to sign in. And the two main options are to sign in with ChatGPT, which is what you’ll want if you have a paid account, and the other option is to use your own API key.

00:27 I’ll use the sign in through ChatGPT, and when I press Enter, a browser window opens. I’ll sign in with my account, and once I’m signed in, I want to give the Codex CLI access to ChatGPT. Once that’s done, close the browser page, and the terminal will show that you are now signed in.

00:51 You will see a couple of disclaimers on the screen. You need to be aware of how much autonomy you want to grant Codex CLI for each directory you’re working in.

01:00 You’re reminded that LLMs make mistakes, much like humans do, except LLMs can’t be held accountable, so you’re accountable for the LLMs’ mistakes. And then, regardless of whether you’re using an API key or you sign in with your paid tier, Codex costs money. So, if you sign in with your account, you have rate limits in place, which you can check, and that get used up as you go, and if you have an API key, you’ll be consuming credits, so you need to keep an eye out for your usage.

01:32 Once you press Enter to dismiss those disclaimers, you’re then asked whether you trust the contents of the current directory you’re in or not. You’ll be prompted for this any time you open Codex in a new directory, and the reason you’re asked whether you trust the contents of this directory is because when you download a folder from the internet, someone might have hidden a harmful prompt in one of the files of that folder.

01:59 And when Codex accesses those files, it might see the bad prompt, and the prompt might lead the LLM to do something harmful to you, which might include modifying your files in a way that you don’t want, or even sending sensitive data to a malicious actor.

02:16 So you should always be very careful about whether you trust the contents of the directory you’re in or not. For the rpcontacts directory, you can take a look at the Python code, you can take a look at the files that are in there, everything should be fine.

02:31 So you’ll press Enter to confirm that yes, you want to continue. Once you’re in, you’ll see a header with a couple of informations, like the Codex CLI version you’re in, the model, and the directory you’re running the Codex CLI from.

Become a Member to join the conversation.