codex-auth CLI

A Zig utility for switching Codex accounts: importing an auth file, listing, switching, for the CLI, VS Code and the app

  • 2,807 ★ on the repository
  • Last commit
  • MIT
CLI

Broad access

Why this level

  • Reads and changes Codex auth files with access tokens
  • A wrong switch can leave the wrong account active
All reasons and checks

loongphy/codex-auth

Install

Works in

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/codex-auth

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Reads and changes Codex auth files with access tokens
  • A wrong switch can leave the wrong account active

This is third-party code. Review the repository files before installing.

What it does

codex-auth switches Codex accounts: it imports an auth file or CLIProxyAPI tokens (`import <path> [--alias]`), shows the list and changes the active account. It works with Codex CLI, the VS Code extension and the Codex app. After switching the client must be restarted: the `codext` fork switches without a restart and installs with `npm i -g @loongphy/codext`. The mode for the Codex app (`codex-auth app`) is unstable per the README. Install with `npm install -g @loongphy/codex-auth` or run through `npx @loongphy/codex-auth list`.

Who it is for. For people who have a personal and a work Codex account and are tired of changing the auth file by hand.

Good fit when

  • You need to switch quickly between a personal and a work Codex account
  • You need to keep several authorizations under short aliases
  • You need to switch the account without editing files by hand

Not a fit when

  • You want to get around limits or the terms of the service: the utility is not meant for that and responsibility lies with the user
  • You are not ready to trust a utility with files that hold access tokens

Example request

Show the list of saved Codex accounts and switch the active one to the work one by the alias work

Limitations

The utility reads and changes Codex auth files, that is access tokens, so it needs full access to those files. Switching several accounts is meant for a personal and a work account. Getting around limits and service terms is not allowed and responsibility lies with the user. After switching the client must be restarted unless you use the codext fork. The mode for the Codex app is unstable per the README. The latest release is v0.3.0 from 15.09.2026.

How to disable. Remove the package with npm uninstall -g @loongphy/codex-auth and check which auth file remains active in the Codex folder.

FAQ

What does codex-auth do?

It switches Codex accounts: imports an auth file, shows the list and changes the active account.

Which clients does it work with?

Codex CLI, the VS Code extension and the Codex app. After switching the client must be restarted.

What is codext?

A fork that switches the account without a restart: npm i -g @loongphy/codext.

Can I get around limits?

No. The utility is meant for a personal and a work account and service terms must not be broken.

Discussion

No questions or reviews yet.

CLI tools

Aligns provider data in old Codex sessions after a model provider change: session files and the SQLite index, with backups

CLIBroad access3.6KRepository stars

Shows what Claude Code and Codex actually send to the API: it captures local traffic and splits tokens and cost by source

CLIBroad access4.7KRepository stars

Claude Code Tools

claude-code-tools

A set of practical tools for Claude Code, Codex CLI and similar agents: utilities, skills, agents, hooks and plugins for terminal work

CLIExtended access2KRepository stars

Tokscale

tokscale

A CLI with an interactive TUI that tracks token usage and cost across AI coding agents: Claude Code, Codex, Copilot, Cursor and more

CLIExtended access5.7KRepository stars

Token Optimizer

token-optimizer

A plugin for Claude Code and Codex: trims wasted tokens, keeps work alive across sessions and compactions and shows cost. The license is noncommercial

PluginExtended access2.6KRepository stars

A self-hosted control center for coding agents: Claude Code, Codex, Copilot, OpenCode and Pi from your phone, desktop and terminal

CLIExtended access20.8KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
codex-auth (this entry)no2,807
codex-provider-syncno3,579aligns old Codex sessions after a provider change
CodexPrononot required2,091a local MCP giving ChatGPT access to repositories through a tunnel

README in short

The README describes a Zig utility for switching Codex accounts: npm installation, import, list and switch commands, the codext fork without a restart and the unstable app mode. MIT license.

README badge

Report a problem

Foxx AIcodex-auth
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.