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

ccenv

v1.3.0

Published

Claude Code environment variable switcher

Readme

ccenv

🚀 Interactive CLI tool for switching Claude Code environment variables quickly and seamlessly.

New in v1.1.0: Interactive list navigation with arrow keys for seamless environment switching!

✨ Key Features

  • 🎯 Interactive Navigation - Use arrow keys to browse and select environments
  • Instant Switching - One keystroke to change your entire Claude Code environment
  • 🔄 Automatic Application - Environment variables applied immediately (with shell integration)
  • 💾 Persistent Sessions - New terminals remember your last environment
  • 📁 Project-aware - Automatically switch environments when entering project directories
  • 🔧 Shell Integration - Works seamlessly with zsh, bash, and other shells
  • 🎨 Beautiful UI - Colorful, intuitive command-line interface

Quick Start

1. Install

npm install -g ccenv
# or
pnpm install -g ccenv

2. Add Environment Configuration

ccenv add work
# Interactive prompts for ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY

3. Install Shell Integration (Recommended)

ccenv install
# Auto-detects and configures zsh/bash integration
source ~/.zshrc  # or source ~/.bashrc

4. Switch Environment

🎯 Interactive Mode (Recommended)

ccenv list -i
# Navigate with ↑↓ arrow keys
# Press Enter to select environment
# ✓ Switched to environment: work
# 🎉 Environment variables automatically applied!

⚡ Direct Switch

ccenv use work
# ✓ Applied ccenv environment: work
# Environment variables automatically applied to current shell

Usage

Core Commands

# Add new environment
ccenv add <name>

# 🎯 Interactive list (navigate with arrow keys)
ccenv list -i
ccenv list --interactive

# List all environments (traditional view)
ccenv list

# Switch environment (auto-apply with shell integration)
ccenv use <name>

# Show current environment
ccenv current

# Export environment variables
ccenv current --export

🎯 Interactive Features

Navigate environments with ease using arrow keys:

ccenv list -i

What you get:

  • ↑↓ Arrow key navigation through all environments
  • 📋 Live preview of Base URL and API Key (masked)
  • Instant switching - just press Enter to select
  • 🔄 Automatic application of environment variables (with shell integration)
  • 🔙 Easy exit - select "← Back" to return to standard list

Demo:

? Select an environment to switch to: (Use arrow keys)
❯ work (current)
  https://api.anthropic.com | sk-123...

  personal
  https://api.personal.com | sk-456...

  mirror
  https://api.mirror.com | sk-789...

  ← Back (just list)

Shell Integration Features

After installing shell integration, you get these automated features:

  1. Auto-apply Environment Variables

    ccenv use work      # Direct command mode
    ccenv list -i       # Interactive mode
    # Both automatically set environment variables, no manual eval needed!
  2. Persistent Environment

    # New terminals automatically restore last environment
    echo $ANTHROPIC_BASE_URL  # Auto-loaded
  3. Project-level Environment

    # Create .ccenv file in project directory
    echo "work" > .ccenv
    cd project  # Automatically switches to work environment

Manual Integration

If you prefer not to install automatic integration:

# Manually apply to current shell
eval "$(ccenv current --export)"

# Or load specific environment
eval "$(ccenv use work --source)"

Environment Variables

ccenv manages these environment variables for Claude Code:

  • ANTHROPIC_BASE_URL - Anthropic API base URL
  • ANTHROPIC_API_KEY - Anthropic API key

Configuration Files

  • ~/.ccenv/config.json - Environment configurations
  • ~/.ccenv/current_env - Current environment persistence file
  • .ccenv - Project-level environment configuration file

Example Workflow

# Set up multiple environments
ccenv add work
ccenv add personal
ccenv add mirror

# Install automation
ccenv install

# 🎯 Interactive mode - navigate with arrow keys
ccenv list -i
# Select environment with Enter key
# ✓ Switched to environment: work
# 🎉 Environment variables automatically applied!

# Or direct command mode
ccenv use work
echo $ANTHROPIC_BASE_URL  # https://api.work.com

# New terminals automatically restore environment
# Projects with .ccenv files auto-switch environments

Development

Setup

# Clone repository
git clone <repository-url>
cd ccenv

# Install dependencies
pnpm install

# Development mode
pnpm dev <command> [args]
# Example: pnpm dev add test

# Build TypeScript to JavaScript
pnpm build

# Test built CLI
node dist/index.js --help

Project Structure

ccenv/
├── src/
│   ├── commands/      # CLI command implementations
│   ├── config/        # Configuration management
│   ├── index.ts       # CLI entry point
│   └── types.ts       # TypeScript interfaces
├── dist/              # Built JavaScript files
├── package.json
└── tsconfig.json

Architecture

  • CLI Framework: Commander.js for argument parsing
  • Interactive Prompts: Inquirer.js for user input
  • Configuration: JSON files in ~/.ccenv/
  • Shell Integration: Dynamic script generation following volta/bun patterns

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run pnpm build to ensure it compiles
  5. Test with node dist/index.js
  6. Submit a pull request