Syntax
Description
Thelogout command removes your stored authentication credentials from Codex. After logging out, you’ll need to run codex login again to authenticate.
Usage
- ChatGPT OAuth tokens
- API keys
- Any other stored credentials
Examples
Standard Logout
Verify Logout
Switch Accounts
CI/CD Cleanup
What Gets Removed
Thelogout command removes:
- OAuth Tokens: ChatGPT authentication tokens
- API Keys: Stored OpenAI API keys
- Session Data: Any active session information
Credential Storage
Credentials are stored in your system’s secure storage:- macOS: Keychain Access
- Linux: Secret Service API (gnome-keyring, KWallet)
- Windows: Windows Credential Manager
logout command removes entries from these secure stores.
After Logout
To use Codex again, you must re-authenticate:Troubleshooting
Credentials Still Present
If credentials persist after logout:-
Check login status:
-
Manually remove from keychain (macOS):
-
Or remove config file:
Permission Errors
If you see permission errors:Related Commands
codex login- Authenticate with Codexcodex login status- View authentication status