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

@godiao/cswap

v1.0.0

Published

Cross-platform CLI for switching Claude Code providers — supports CC Switch database and standalone config

Downloads

31

Readme

cswap

Switch Claude Code providers on the fly — without touching your global settings.

cswap is a lightweight CLI that lets you pick a Claude Code provider before each session. It creates isolated settings per provider, so you can run different providers in different terminal tabs simultaneously.

Why?

If you use CC Switch to manage multiple Claude providers, you've probably run into these problems:

  • Switching providers in CC Switch affects all running Claude sessions
  • You can't use different providers in different projects at the same time
  • Every switch modifies your global ~/.claude/settings.json

cswap solves this by creating per-session provider isolation — each cswap invocation spawns Claude with its own settings file, leaving your global config untouched.

Features

  • Provider isolation — each session gets its own settings, no cross-contamination
  • Two config sources — reads from CC Switch database and/or its own config file (~/.cswap.json)
  • Interactive selection — pick a provider by number or name
  • Direct mode--provider flag to skip the interactive prompt
  • Management commands — add, remove, list, import providers
  • Cross-platform — macOS, Linux, Windows
  • Zero config — works out of the box if CC Switch is installed

Install

npm install -g cswap

Quick Start

# Interactive — pick a provider from the list
cswap

# Direct — skip the prompt
cswap --provider "Claude Official"

# Pass any Claude Code flags through
cswap --provider df --dangerously-skip-permissions --continue

Usage

Interactive Mode

cswap

Shows a numbered list of providers. Type a number or name to select:

  Select a provider:

  1. df
  2. Claude Official
  3. DeepSeek
  4. OpenRouter

  Type number or name, "q" to quit

  > 1

Direct Mode

cswap --provider df -r --dangerously-skip-permissions

Management Commands

# List all providers (shows source: cswap or cc-switch)
cswap list

# Add a provider to cswap config
cswap add myprovider \
  --env ANTHROPIC_API_KEY=sk-xxx \
  ANTHROPIC_BASE_URL=https://api.example.com

# Remove a provider
cswap remove myprovider

# Import all CC Switch providers into cswap config
cswap import

Config File

cswap stores its providers in ~/.cswap.json:

{
  "providers": [
    {
      "name": "My Provider",
      "env": {
        "ANTHROPIC_API_KEY": "sk-xxx",
        "ANTHROPIC_BASE_URL": "https://api.example.com"
      }
    }
  ]
}

When both CC Switch and cswap config exist, providers are merged (cswap config takes priority on name conflicts).

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | CC_CLI_PATH | Path to Claude CLI binary | claude | | CC_SWITCH_DB_PATH | Full path to CC Switch database | ~/.cc-switch/cc-switch.db | | CC_SWITCH_HOME | CC Switch config directory | ~/.cc-switch |

Custom CLI

# Via environment variable
export CC_CLI_PATH=/path/to/claude
cswap

# Via command line (higher priority)
cswap --cli /path/to/claude

Cleanup

# Remove all cswap-generated settings files
cswap --clear

How It Works

  1. Reads providers from CC Switch database and/or ~/.cswap.json
  2. Shows interactive selection (or uses --provider flag)
  3. Creates an isolated settings file at ~/.cswap-{name}.settings.json
  4. Spawns claude --settings=<file> with your chosen provider
  5. cswap exits — Claude runs independently

The generated settings file inherits your hooks, plugins, and permissions from ~/.claude/settings.json, but replaces environment variables and model config with the selected provider's values.

Requirements

License

MIT