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

agentbar

v0.2.0

Published

CLI to manage multiple AI auth profiles and usage in one place

Readme

🔑 agentbar

CLI to manage multiple AI auth profiles and usage in one place.

What It Does

  • Stores multiple codex and copilot profiles in one local store.
  • Switches the active Codex profile and applies it to Codex CLI auth.
  • Fetches usage data for saved profiles with caching and concurrency controls.
  • Supports per-profile notes for account context.

Requirements

  • Node.js >= 20.19 for the published CLI, npm, npx, and global installs.
  • Bun >= 1.3 is used for development and may be used as a package runner.

The published agentbar executable uses a Node shebang for npm ecosystem compatibility.

Installation

Run without installing globally:

npx agentbar@latest --help
# or, with Bun as the package runner when Node.js is available:
bunx agentbar@latest --help

Global install:

npm install -g agentbar
agentbar --help

You can also install with Bun's package manager when Node.js is available:

bun install -g agentbar
agentbar --help

To force Bun's runtime for one-off execution:

bunx --bun agentbar@latest --help

Update:

npm update -g agentbar
# or, if installed with Bun:
bun update -g agentbar

Runtime Notes

  • npm install -g agentbar and npx agentbar require Node.js.
  • bunx agentbar works as a Bun package runner and follows Bun's executable behavior.
  • bun install -g agentbar installs the same npm package, but the global executable uses the Node shebang.

Quick Start

Check installed version:

agentbar --version
# or:
agentbar -v

Login and save profiles:

agentbar login codex
agentbar login copilot

List accounts:

agentbar accounts
agentbar accounts --json

Switch active Codex profile:

agentbar switch codex [email protected]

Check usage:

agentbar usage
agentbar usage --provider codex

Set and clear notes:

agentbar note set codex [email protected] "Work account"
agentbar note clear codex [email protected]

Delete saved profiles:

agentbar delete codex [email protected] --yes
agentbar delete copilot [email protected] --yes

Important Behavior

Active Semantics

  • active in agentbar accounts means the profile currently applied to Codex CLI.
  • Only Codex supports active switching in agentbar.
  • Copilot rows are always inactive and usage-only.

Profile Selection

  • Profile selection is case-insensitive by email.
  • If multiple profiles share the same email, provide --plan.
  • If required selectors are omitted in a TTY session, agentbar prompts interactively.
  • In non-interactive mode, ambiguous selectors fail with an error.

Non-Interactive Safety

  • agentbar delete ... requires --yes outside interactive TTY.
  • note set without note text requires interactive input; otherwise it fails.

Codex Auth Apply Target

agentbar switch codex writes to:

  • $CODEX_HOME/auth.json when CODEX_HOME is set
  • ~/.codex/auth.json otherwise

Commands

agentbar login codex
agentbar login copilot

agentbar accounts [provider] [--json]

agentbar switch codex [email] [--plan <plan>] [--json]

agentbar delete codex [email] [--plan <plan>] [--yes] [--json]
agentbar delete copilot [email] [--plan <plan>] [--yes] [--json]

agentbar usage [provider] [--provider codex|copilot] [--refresh] [--json]

agentbar note set <provider> [email] [note...] [--plan <plan>] [--json]
agentbar note clear <provider> [email] [--plan <plan>] [--json]

agentbar config [--json]
agentbar config list [--json]
agentbar config get <key> [--json]
agentbar config set <key> <value> [--json]
agentbar config unset <key> [--json]

Storage and Security

Paths:

  • Profile store: ~/.agentbar/store.json
  • Config: ~/.agentbar/config.json
  • Usage cache: ~/.agentbar/usage-cache.json

Security model:

  • Tokens are stored as plain JSON on disk.
  • Treat ~/.agentbar/store.json as a password file.
  • Do not share or commit local store/config/cache files.
  • On POSIX systems, files are written with 0600.
  • Store and cache writes use file locking for safer concurrent access.

Configuration

Set and read config values:

agentbar config list
agentbar config get usage.timeoutMs
agentbar config set usage.timeoutMs 8000
agentbar config unset usage.timeoutMs

Supported keys:

  • usage.timeoutMs (default 10000, non-negative integer)
  • usage.ttlMs (default 60000, non-negative integer)
  • usage.errorTtlMs (default 10000, non-negative integer)
  • usage.concurrency (default 4, positive integer)

Usage cache behavior:

  • Successful rows are cached for usage.ttlMs.
  • Error rows are cached for min(usage.errorTtlMs, usage.ttlMs).
  • Use agentbar usage --refresh to bypass cache.

Automation and Output

  • Use --json on list/switch/delete/usage/note/config commands for machine-readable output.
  • NO_COLOR=1 disables ANSI colors.
  • FORCE_COLOR=1 forces ANSI colors.
  • AGENTBAR_DEBUG_TIMING=1 prints per-profile timing to stderr.
  • AGENTBAR_DEBUG_STACK=1 prints stack traces for unexpected errors.

Development

git clone https://github.com/nbsp1221/agentbar
cd agentbar
bun install
bun run test
bun run build
bun run test:package
bun run src/index.ts --help

Watch mode:

bun run test:watch

Release (Maintainers)

npm publish is automated by GitHub Actions on v* tag pushes.

npm version patch
git push origin main --follow-tags

Current workflow publishes with npm publish --provenance.

Current auth model: npm trusted publishing (OIDC).

One-time npm setup is required before the first release:

  1. Open npm package settings for agentbar.
  2. Add a Trusted Publisher for this GitHub repository/workflow.
  3. Target workflow file: .github/workflows/publish-npm.yml.

After trusted publisher is configured, no NPM_TOKEN repository secret is needed.

Disclaimer

agentbar is not affiliated with OpenAI or GitHub.