SIGN IN SIGN UP
openai / codex UNCLAIMED

Lightweight coding agent that runs in your terminal

0 0 110 Rust

fix: replace --api-key with --with-api-key in `codex login` (#4646)

Previously, users could supply their API key directly via:

```shell
codex login --api-key KEY
```

but this has the drawback that `KEY` is more likely to end up in shell
history, can be read from `/proc`, etc.

This PR removes support for `--api-key` and replaces it with
`--with-api-key`, which reads the key from stdin, so either of these are
better options:

```
printenv OPENAI_API_KEY | codex login --with-api-key
codex login --with-api-key < my_key.txt
```

Other CLIs, such as `gh auth login --with-token`, follow the same
practice.
M
Michael Bolin committed
69ac5153d4212d629036df8b24c2015caa615099
Parent: 16b6951
Committed by GitHub <noreply@github.com> on 10/3/2025, 6:17:31 AM