cli: rename profile v2 flag to --profile (#23883)

## Why

Profile v2 is taking over the user-facing profile selection path, so the
CLI no longer needs to expose the transitional `--profile-v2` spelling.
This switches the public args surface to `--profile` before the
remaining legacy profile plumbing is removed separately.

## What

- Rebind `--profile` and `-p` to the v2 profile name argument that
selects `$CODEX_HOME/<name>.config.toml`.
- Stop parsing the legacy shared CLI profile argument while keeping its
implementation path in place for follow-up cleanup.
- Update CLI validation, profile-name parse errors, and the
legacy-profile collision message/tests to refer to `--profile`.

## Testing

- `cargo test -p codex-cli -p codex-config -p codex-protocol -p
codex-utils-cli`
This commit is contained in:
jif-oai authored and GitHub committed 2026-05-21 16:45:27 +02:00
1 parent c1d7f4c8f8
commit 8a511d5881
4 files changed
+14 -19

No files matched your search

+5 -5
View File
@@ -196,9 +196,9 @@ async fn exec_cli_applies_model_instructions_file() {
);
}
/// Verify that `codex exec --profile ...` preserves the active profile when it
/// starts the in-process app-server thread, so profile-scoped
/// `model_instructions_file` is applied to the outbound request.
/// Verify that `codex exec --profile ...` preserves the active user config
/// profile when it starts the in-process app-server thread, so the selected
/// profile's `model_instructions_file` reaches the outbound request.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn exec_cli_profile_applies_model_instructions_file() {
skip_if_no_network!();
@@ -223,8 +223,8 @@ async fn exec_cli_profile_applies_model_instructions_file() {
let home = TempDir::new().unwrap();
std::fs::write(
home.path().join("config.toml"),
format!("[profiles.default]\nmodel_instructions_file = \"{custom_path_str}\"\n",),
home.path().join("default.config.toml"),
format!("model_instructions_file = \"{custom_path_str}\"\n"),
)
.unwrap();