From 9b034e7b46f556366103161c1bb105063927e8ca Mon Sep 17 00:00:00 2001 From: Michael Fan Date: Tue, 24 Mar 2026 15:59:46 -0400 Subject: [PATCH] .env -> .env.local --- codex-rs/tui/src/api_provision.rs | 10 +++++----- codex-rs/tui/src/slash_command.rs | 2 +- ...i__api_provision__tests__success_cell_snapshot.snap | 2 +- ...ccess_cell_snapshot_when_live_apply_is_skipped.snap | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/codex-rs/tui/src/api_provision.rs b/codex-rs/tui/src/api_provision.rs index f6b09b02cc..1f671ae341 100644 --- a/codex-rs/tui/src/api_provision.rs +++ b/codex-rs/tui/src/api_provision.rs @@ -36,7 +36,7 @@ pub(crate) fn start_command( return Ok(existing_shell_api_key_message()); } - let dotenv_path = cwd.join(".env"); + let dotenv_path = cwd.join(".env.local"); let start_hint = format!( "Codex will save {OPENAI_API_KEY_ENV_VAR} to {path} and hot-apply it here when allowed.", path = dotenv_path.display() @@ -129,7 +129,7 @@ fn live_apply_api_key( ) -> LiveApplyOutcome { if matches!(forced_login_method, Some(ForcedLoginMethod::Chatgpt)) { return LiveApplyOutcome::Skipped(format!( - "Saved {OPENAI_API_KEY_ENV_VAR} to .env, but left this session unchanged because ChatGPT login is required here." + "Saved {OPENAI_API_KEY_ENV_VAR} to .env.local, but left this session unchanged because ChatGPT login is required here." )); } @@ -200,7 +200,7 @@ mod tests { project_api_key: "sk-proj-123".to_string(), access_token: "oauth-access-123".to_string(), }, - Path::new("/tmp/workspace/.env"), + Path::new("/tmp/workspace/.env.local"), LiveApplyOutcome::Applied, ); @@ -219,9 +219,9 @@ mod tests { project_api_key: "sk-proj-123".to_string(), access_token: "oauth-access-123".to_string(), }, - Path::new("/tmp/workspace/.env"), + Path::new("/tmp/workspace/.env.local"), LiveApplyOutcome::Skipped( - "Saved OPENAI_API_KEY to .env, but left this session unchanged because ChatGPT login is required here." + "Saved OPENAI_API_KEY to .env.local, but left this session unchanged because ChatGPT login is required here." .to_string(), ), ); diff --git a/codex-rs/tui/src/slash_command.rs b/codex-rs/tui/src/slash_command.rs index 121ebff78d..f90e06caf0 100644 --- a/codex-rs/tui/src/slash_command.rs +++ b/codex-rs/tui/src/slash_command.rs @@ -83,7 +83,7 @@ impl SlashCommand { // SlashCommand::Undo => "ask Codex to undo a turn", SlashCommand::Quit | SlashCommand::Exit => "exit Codex", SlashCommand::Diff => "show git diff (including untracked files)", - SlashCommand::ApiProvision => "provision an API key and save it to .env", + SlashCommand::ApiProvision => "provision an API key and save it to .env.local", SlashCommand::Copy => "copy the latest Codex output to your clipboard", SlashCommand::Mention => "mention a file", SlashCommand::Skills => "use skills to improve how Codex performs specific tasks", diff --git a/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot.snap b/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot.snap index 839ce5259c..a756441d7b 100644 --- a/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot.snap +++ b/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot.snap @@ -3,4 +3,4 @@ source: tui/src/api_provision.rs assertion_line: 192 expression: render_cell(&cell) --- -• Provisioned an API key for Default Org / Default Project and saved OPENAI_API_KEY to /tmp/workspace/.env. Updated this session to use the newly provisioned API key without touching auth.json. +• Provisioned an API key for Default Org / Default Project and saved OPENAI_API_KEY to /tmp/workspace/.env.local. Updated this session to use the newly provisioned API key without touching auth.json. diff --git a/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot_when_live_apply_is_skipped.snap b/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot_when_live_apply_is_skipped.snap index 6c7d9e3e43..a8fbcfb28c 100644 --- a/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot_when_live_apply_is_skipped.snap +++ b/codex-rs/tui/src/snapshots/codex_tui__api_provision__tests__success_cell_snapshot_when_live_apply_is_skipped.snap @@ -3,4 +3,4 @@ source: tui/src/api_provision.rs assertion_line: 214 expression: render_cell(&cell) --- -• Provisioned an API key for org-default / proj-default and saved OPENAI_API_KEY to /tmp/workspace/.env. Saved OPENAI_API_KEY to .env, but left this session unchanged because ChatGPT login is required here. +• Provisioned an API key for org-default / proj-default and saved OPENAI_API_KEY to /tmp/workspace/.env.local. Saved OPENAI_API_KEY to .env.local, but left this session unchanged because ChatGPT login is required here.