Add codex login --api-key (#1759)

Allow setting the API key via `codex login --api-key`
This commit is contained in:
pakrym-oai
2025-07-31 10:48:49 -07:00
committed by GitHub
parent 96654a5d52
commit 549846b29a
10 changed files with 218 additions and 46 deletions

View File

@@ -226,7 +226,7 @@ fn should_show_login_screen(config: &Config) -> bool {
// Reading the OpenAI API key is an async operation because it may need
// to refresh the token. Block on it.
let codex_home = config.codex_home.clone();
match load_auth(&codex_home) {
match load_auth(&codex_home, true) {
Ok(Some(_)) => false,
Ok(None) => true,
Err(err) => {