npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

codex-switcher-11arkan

v2.1.4

Published

Interactive React + Ink CLI for running codex with isolated CODEX_HOME profiles.

Readme

Codex Switcher (React + Ink)

Interactive CLI to run codex with isolated CODEX_HOME profiles so multiple accounts can stay signed in and usable at the same time.

CI npm version License: ISC

Stack

  • React
  • Ink
  • TypeScript
  • Node.js

Install

npm install

Install from npm

npm install -g codex-switcher-11arkan
codex-switcher

Build

npm run build

Start interactive CLI

# runs the Ink UI menu
npm run dev

# or after build
node dist/index.js

Production usage

codex-switcher
codex-switcher usage --period month

Core commands

# list profiles
node dist/index.js list

# add profiles
node dist/index.js add work
node dist/index.js add personal

# login each profile
node dist/index.js login work
node dist/index.js login personal

# run codex in this terminal
node dist/index.js run work

# run codex in parallel (new terminal window)
node dist/index.js run work --new-window
node dist/index.js spawn personal -- chat

# switch account used by main while keeping main threads/settings in place
# (swaps auth artifacts with target profile and updates user CODEX_HOME)
node dist/index.js switch-main work

# login status for all profiles in one list
node dist/index.js status

# model-wise token + cost breakdown from local Codex session data
node dist/index.js usage
node dist/index.js usage work

# period views
node dist/index.js usage --period day
node dist/index.js usage --period month
node dist/index.js usage main --period month

Automatic main profile detection

On startup, if main is missing, the app checks default CODEX_HOME (%USERPROFILE%\.codex unless CODEX_HOME is already set). If that location is already logged in, it auto-registers as profile main.

Data locations

  • Profile definitions: %APPDATA%\CodexSwitcher\profiles.json
  • Default profile homes: %USERPROFILE%\.codex-switcher\profiles\<profile-name>

Development

npm install
npm run typecheck
npm run build
npm run release:check

CI and release automation

  • CI runs on every push/PR via .github/workflows/ci.yml.
  • npm publish runs automatically on push to main when package.json version is unpublished. Requires NPM_TOKEN secret.

Contributing and policies

Notes

  • Multiple Codex sessions are supported simultaneously via --new-window / spawn.
  • Profile storage is lock-protected to avoid concurrent write corruption.
  • usage shows rows per model with input, cached input, output, total tokens, thread count, and estimated USD cost.
  • Cost uses standard API text-token pricing fetched at runtime from OpenAI docs: Pricing.
  • Pricing is cached locally in-memory (success: 6h, fetch failure: 5m retry window).
  • If a model is missing from the local pricing map, its row is still shown but cost is n/a.
  • In interactive mode, profile creation uses typing; login/open/remove now use selectable profile lists.
  • switch-main <profile> keeps main home fixed and swaps auth artifacts (auth.json, cap_sid) between main and target profile, so main threads/settings remain in place.
  • After switch-main, user CODEX_HOME is updated on Windows so plain codex follows main in new terminals.
  • In interactive mode, Usage opens a submenu with model view, daily cost view, and monthly cost view.