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

@cungnguyen/claude-switch

v0.2.0

Published

CLI profile manager for switching between Claude configurations.

Downloads

26

Readme

claude-switch

claude-switch is a CLI-first profile manager for Claude settings. It helps users save multiple Claude profiles, switch the active ~/.claude/settings.json, and run commands with a temporary profile without overwriting global config.

MVP features

  • init local profile storage
  • add interactive profile creation
  • list saved profiles
  • use <profile> to rewrite Claude settings
  • current active profile summary
  • remove <profile> cleanup
  • doctor environment checks
  • run <profile> -- <command> temporary env injection

Install

Global CLI (recommended)

From the package folder after build:

npm install
npm run build
npm link

Then use claude-switch from any terminal:

claude-switch paths
claude-switch help

After you publish to npm, users run:

npm install -g @cungnguyen/claude-switch

Local development

npm install
npm run build
node dist/cli.js help

Or:

npm run dev -- help

Example workflow

Named profile + key (global-style, no prompts)

Each profile is one named use case (work, personal, client A, …) with its own token (key):

claude-switch init
claude-switch add work --token "YOUR_KEY" --provider claude-proxy --base-url "https://your-api.example.com"
claude-switch add personal --token "OTHER_KEY" --provider anthropic
claude-switch list
claude-switch use cong-ty

Update only the key for a profile:

claude-switch set-token cong-ty --token "NEW_KEY"

Pipe token (scripting):

echo "YOUR_KEY" | claude-switch set-token ca-nhan

Interactive (prompts)

npm run dev -- init
npm run dev -- add work
npm run dev -- list
npm run dev -- use work
npm run dev -- run work -- claude

Global data directory

By default everything lives under ~/.claude-switch/ (profiles, backups, optional legacy tokens.json).

Override the base directory (portable disk, one folder for all “cases”):

set CLAUDE_SWITCH_HOME=D:\configs\claude-switch
claude-switch paths

On macOS/Linux:

export CLAUDE_SWITCH_HOME="$HOME/.config/claude-switch"

Storage

Metadata lives in:

  • ~/.claude-switch/profiles.json

Tokens use OS credential storage when the optional keytar native module is installed (Windows Credential Manager, macOS Keychain, or libsecret on Linux). keytar is listed as an optionalDependency; if it fails to build or is omitted, tokens fall back to:

  • ~/.claude-switch/tokens.json (plain JSON, not ideal for production)

When both are available, legacy entries in tokens.json are migrated on first use and then removed from the file for that profile.

Service name for OS storage: claude-switch.

Supported Claude config

The first version targets a Claude settings file shaped like:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "...",
    "ANTHROPIC_BASE_URL": "https://your-proxy-or-api.example.com"
  }
}

use <profile> preserves unrelated settings and updates only the relevant env keys.

Publish checklist

  • Add masked secret input instead of visible token entry.
  • Add richer argument parsing and shell completion.
  • Add cross-platform path coverage for macOS/Linux.
  • Validate against more Claude config variants.