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

@@ -18,7 +18,7 @@ pub fn set_chatgpt_token_data(value: TokenData) {
/// Initialize the ChatGPT token from auth.json file
pub async fn init_chatgpt_token_from_auth(codex_home: &Path) -> std::io::Result<()> {
let auth = codex_login::load_auth(codex_home)?;
let auth = codex_login::load_auth(codex_home, true)?;
if let Some(auth) = auth {
let token_data = auth.get_token_data().await?;
set_chatgpt_token_data(token_data);