Add logout command to CLI and TUI (#1932)

## Summary
- support `codex logout` via new subcommand and helper that removes the
stored `auth.json`
- expose a `logout` function in `codex-login` and test it
- add `/logout` slash command in the TUI; command list is filtered when
not logged in and the handler deletes `auth.json` then exits

## Testing
- `just fix` *(fails: failed to get `diffy` from crates.io)*
- `cargo test --all-features` *(fails: failed to get `diffy` from
crates.io)*

------
https://chatgpt.com/codex/tasks/task_i_68945c3facac832ca83d48499716fb51
This commit is contained in:
Gabriel Peal
2025-08-07 01:17:33 -07:00
committed by GitHub
parent 28395df957
commit 6d19b73edf
5 changed files with 65 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ pub enum SlashCommand {
Compact,
Diff,
Status,
Logout,
Quit,
#[cfg(debug_assertions)]
TestApproval,
@@ -32,6 +33,7 @@ impl SlashCommand {
SlashCommand::Quit => "Exit the application",
SlashCommand::Diff => "Show git diff (including untracked files)",
SlashCommand::Status => "Show current session configuration and token usage",
SlashCommand::Logout => "Log out of Codex",
#[cfg(debug_assertions)]
SlashCommand::TestApproval => "Test approval request",
}