MCPInstall

codex-auth-account-manager

CLI tool to switch and manage multiple Codex accounts seamlessly

Installs
255
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/reason-machines/codex-skills --skill codex-auth-account-manager
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads codex-auth-account-manager automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Codex Auth Account Manager

Skill by ara.so — Codex Skills collection.

codex-auth is a command-line tool for switching between multiple Codex accounts. It works with Codex CLI, VS Code extension, and Codex App. This skill covers installation, account management, import/export workflows, and API vs local-only modes.

What It Does

  • Account switching: Seamlessly switch between multiple Codex accounts stored locally
  • Usage tracking: View token usage and limits for each account (API-backed or local-only)
  • Import/Export: Batch import auth files or export for backup
  • Multi-client support: Works with Codex CLI, VS Code extension, and Codex App

Important: After switching accounts with Codex CLI or Codex App, you must restart the client for changes to take effect. For seamless switching without restarts, use the forked codext CLI.

Installation

Install globally via npm:

npm install -g @loongphy/codex-auth

Or run without installing:

npx @loongphy/codex-auth list

Supported platforms: Linux (x64, arm64), macOS (x64, arm64), Windows (x64, arm64).

Uninstall

npm uninstall -g @loongphy/codex-auth

Account Management Commands

List Accounts

View all stored accounts with usage information:

# List accounts with API-backed usage refresh (default)
codex-auth list

# List with live TUI auto-refresh
codex-auth list --live

# Show only the active account
codex-auth list --active

# Skip API calls, use local rollout files only
codex-auth list --skip-api

Usage Data Modes:

  • Default (API): Makes HTTPS requests to OpenAI endpoints using access tokens for accurate usage/limit data
  • Local-only (--skip-api): Reads ~/.codex/sessions/**/rollout-*.jsonl files; may show stale data (hours old) due to rate_limits: null in recent Codex builds

Add Accounts

Login and add a new account:

# Interactive browser login
codex-auth login

# Device-code authentication
codex-auth login --device-auth

This runs codex login internally, then stores the account in codex-auth's registry.

Switch Accounts

Interactive account picker:

# Interactive selection with API-backed usage
codex-auth switch

# Interactive with live TUI refresh
codex-auth switch --live

# Interactive, skip API calls
codex-auth switch --skip-api

Direct selection by row number or query:

# Switch to account at row 02
codex-auth switch 02

# Switch by email/alias substring
codex-auth switch work
codex-auth switch personal@example.com

Remove Accounts

Interactive removal:

# Interactive multi-select with API-backed data
codex-auth remove

# Interactive with local-only data
codex-auth remove --skip-api

Direct removal by query:

# Remove specific accounts by selector
codex-auth remove work personal@example.com 03

# Remove all stored accounts
codex-auth remove --all

Import and Export

Import Accounts

Import a single auth file:

# Import with auto-generated alias
codex-auth import /path/to/auth.json

# Import with custom alias
codex-auth import /path/to/auth.json --alias work-account

Batch import from a folder:

# Import all auth.json files in a directory
codex-auth import /path/to/auth-folder

Import CLIProxyAPI token JSON:

# Import from default ./token.json
codex-auth import --cpa

# Import from custom path
codex-auth import --cpa /path/to/token.json

Rebuild registry from existing auth files:

# Purge and rebuild registry.json from managed auth files
codex-auth import --purge

# Rebuild from custom auth directory
codex-auth import --purge /custom/auth/dir

Export Accounts

Export all managed auth files:

# Export to current directory
codex-auth export

# Export to specific directory
codex-auth export /backup/codex-auth

# Export as CLIProxyAPI token.json format
codex-auth export --cpa
codex-auth export --cpa /backup/tokens

Maintenance

Clean Stale Files

Remove managed backup and stale account files:

codex-auth clean

This deletes:

  • Managed backup files created during account switches
  • Stale account auth files no longer in the registry

Configuration

Live TUI Refresh Interval

Configure auto-refresh interval for --live mode:

# Set refresh interval to 10 seconds
codex-auth config live --interval 10

# Set refresh interval to 30 seconds
codex-auth config live --interval 30

Common Workflows

Daily Account Switching

# Morning: check all accounts and switch to work
codex-auth list
codex-auth switch work

# Evening: switch back to personal
codex-auth switch personal

# Restart Codex CLI or App for changes to take effect

Batch Account Setup

# Import multiple auth files from a backup folder
codex-auth import ~/codex-backups/auth-files

# Verify imports
codex-auth list

# Switch to preferred account
codex-auth switch 01

Usage Monitoring

# Quick active account check
codex-auth list --active

# Monitor all accounts with live refresh
codex-auth list --live

# Check usage without API calls (faster but possibly stale)
codex-auth list --skip-api

Cleanup and Backup

# Export all accounts before cleanup
codex-auth export ~/codex-backup-$(date +%Y%m%d)

# Remove unused accounts
codex-auth remove old-work abandoned-test

# Clean stale files
codex-auth clean

Troubleshooting

Usage Limits Not Refreshing

Symptom: Usage data appears hours out of date.

Cause: When using --skip-api, local rollout-*.jsonl files may contain rate_limits: null (Codex issue #14880).

Solution: Use API-backed refresh (default):

# Use API for accurate data
codex-auth list

# Verify with actual usage
codex exec "say hello"

Account Switch Not Taking Effect

Symptom: After switching accounts, Codex still uses old account.

Solution: Restart Codex CLI or Codex App after switching. Or use codext for seamless switching:

npm install -g @loongphy/codext
codext  # Enhanced CLI with auto account switching

Import Fails

Symptom: codex-auth import doesn't find auth files.

Solution: Ensure you're importing valid auth.json files from ~/.codex/ or exported backups:

# Verify file exists and is valid JSON
cat /path/to/auth.json | jq .

# Try absolute path
codex-auth import /absolute/path/to/auth.json

API Calls vs Privacy

Concern: Don't want to send tokens to OpenAI endpoints.

Solution: Use --skip-api for all commands:

codex-auth list --skip-api
codex-auth switch --skip-api
codex-auth remove --skip-api

Note: Team names won't refresh and usage data may be stale, but no API calls are made.

Security Notes

  • API Mode: Sends access tokens to chatgpt.com/backend-api/wham/usage and chatgpt.com/backend-api/accounts/check/v4-2023-04-27. May violate OpenAI ToS.
  • Local Mode: Reads local files only, safer but less accurate.
  • Auth Storage: All auth files stored in ~/.codex-auth/ (platform-specific). Keep this directory secure.

Platform-Specific Paths

Auth files are stored in:

  • Linux/macOS: ~/.codex-auth/
  • Windows: %USERPROFILE%\.codex-auth\

Original Codex auth:

  • All platforms: ~/.codex/auth.json

Session rollout files:

  • All platforms: ~/.codex/sessions/**/rollout-*.jsonl

FAQ

What does the codex-auth-account-manager skill do?

CLI tool to switch and manage multiple Codex accounts seamlessly

How do I install codex-auth-account-manager?

Run npx skills add https://github.com/reason-machines/codex-skills --skill codex-auth-account-manager in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codex-auth-account-manager/ (personal) or .claude/skills/codex-auth-account-manager/ (project).

Which AI agents can use codex-auth-account-manager?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is codex-auth-account-manager safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains codex-auth-account-manager?

It is published by reason-machines in reason-machines/codex-skills. It has 255 recorded installs.

More from reason-machines/codex-skills

View all →

academic-research-skills-codex

reason-machines/codex-skills

Open the skill to read its SKILL.md instructions.

codexplusplus-launcher

reason-machines/codex-skills

Enhanced launcher for Codex App that unlocks plugins, enables session deletion, exports conversations, and syncs provider sessions via CDP injection

Security286 installs

codex-plugin-claude-code

reason-machines/codex-skills

Open the skill to read its SKILL.md instructions.

273 installs

awesome-codex-subagents

reason-machines/codex-skills

A curated collection of 136+ specialized Codex subagents for development tasks across 10 categories

AI & Agents273 installs

oh-my-codex-workflow

reason-machines/codex-skills

Expert in Oh My Codex (OMX) - workflow layer for OpenAI Codex CLI with agents, skills, and team coordination

codexbar-menubar-ai-usage-tracker

reason-machines/codex-skills

Monitor AI coding assistant usage limits and token resets in the macOS menu bar with CodexBar

271 installs

Popular backend & apis skills

View category →

find-skills

vercel-labs/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

OfficialBackend & APIs4.1M installs

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

OfficialBackend & APIs566.7K installs

This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

Backend & APIs514.8K installs

embedded-captions

heygen-com/hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Backend & APIs453.3K installs

entra-agent-id

microsoft/azure-skills

Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).

OfficialBackend & APIs336.6K installs

neon

neondatabase/agent-skills

Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.

Backend & APIs237.1K installs