Skip to main content

Syntax

Description

The logout command removes your stored authentication credentials from Codex. After logging out, you’ll need to run codex login again to authenticate.

Usage

This removes:
  • ChatGPT OAuth tokens
  • API keys
  • Any other stored credentials

Examples

Standard Logout

Verify Logout

Switch Accounts

CI/CD Cleanup

What Gets Removed

The logout command removes:
  1. OAuth Tokens: ChatGPT authentication tokens
  2. API Keys: Stored OpenAI API keys
  3. 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
The 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:
  1. Check login status:
  2. Manually remove from keychain (macOS):
  3. Or remove config file:

Permission Errors

If you see permission errors: