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 🙏

© 2025 – Pkg Stats / Ryan Hefner

claude-keys-manager

v1.0.0

Published

Claude Code API Key manager with template and repository management tools

Readme

Claude Code Manager

轻量级代码模板和项目管理工具,专为Claude Code用户设计。

功能特性

  • 📥 快速下载: 通过ZIP下载GitHub仓库,无需Git
  • 📝 模板管理: 创建、存储和复用代码模板
  • 🚀 快速启动: 内置常用项目模板选择
  • 🔑 Key管理: 多个Claude Code API Key管理和切换
  • 🧪 Key测试: 验证和测试API Key功能
  • 💡 轻量设计: 纯Node.js实现,无外部依赖
  • 🎯 简单易用: 命令简洁,支持交互模式
  • 💻 跨平台: 支持Windows, macOS, Linux

安装

作为Claude Code的依赖安装

npm install claude-code-manager

全局安装

npm install -g claude-code-manager

使用方法

基本命令

# 下载GitHub仓库
claude-get https://github.com/username/repository.git

# 简化格式
claude-get username/repository

# 指定目标目录
claude-get username/repo -d ./my-project

# 交互式模式
claude-get -i

# 快速选择常用模板
claude-get quick

模板管理

# 创建模板
claude-get template create my-template ./source-directory

# 使用模板
claude-get template use my-template

# 列出所有模板
claude-get template list

# 使用模板到指定目录
claude-get template use my-template -d ./new-project

API Key 管理

# 添加新的API Key
claude-get key add

# 列出所有Keys
claude-get key list

# 切换当前使用的Key
claude-get key switch

# 测试Key功能
claude-get key test

# 验证Key有效性
claude-get key validate
claude-get key validate --all

# 删除Key
claude-get key remove

编程接口

const ClaudeCodeManager = require('claude-code-manager');
const KeyManager = require('claude-code-manager/lib/keyManager');

const manager = new ClaudeCodeManager();
const keyManager = new KeyManager();

// 下载仓库
await manager.run('username/repository', {
  targetDir: './my-project'
});

// 创建模板
await manager.createTemplate('my-template', './source-dir');

// 使用模板
await manager.useTemplate('my-template', './target-dir');

// Key管理
await keyManager.init();

// 添加API Key
await keyManager.addKey({
  name: 'my-key',
  key: 'sk-xxxxxxxxxx',
  description: '测试用key'
});

// 测试Key
const result = await keyManager.testKey(keyId, 'Hello Claude!');

// 获取当前Key
const currentKey = keyManager.getCurrentKey();

支持的仓库格式

  • https://github.com/owner/repo
  • https://github.com/owner/repo.git
  • owner/repo (简化格式)

内置快速模板

使用 claude-get quick 可以快速选择:

  • React App
  • Vue.js 3
  • Next.js
  • Express.js
  • Node.js TypeScript
  • Python Flask
  • Django
  • 自定义输入

API Key 管理详解

功能特性

  • 🔐 安全存储: Keys加密存储在本地配置文件
  • 🔄 多Key切换: 支持多个API Key管理和切换
  • 验证测试: 验证Key有效性和功能测试
  • 📊 使用统计: 跟踪Key使用次数和最后使用时间
  • 💾 导入导出: 支持Key配置的备份和恢复

使用场景

  • 开发测试: 使用不同的Keys进行开发和测试
  • 团队协作: 不同项目使用不同的API Keys
  • 负载均衡: 在多个Keys之间轮换使用
  • 成本控制: 监控不同Keys的使用情况

Key存储位置

  • 配置目录: ~/.claude-code-manager/
  • Keys文件: ~/.claude-code-manager/keys.json
  • 配置文件: ~/.claude-code-manager/config.json

工作原理

  1. ZIP下载: 通过GitHub API下载仓库ZIP文件
  2. 智能解压: 自动处理GitHub ZIP文件结构
  3. 模板存储: 本地保存常用代码模板
  4. 快速复用: 一键应用保存的模板

在package.json中集成

{
  "scripts": {
    "postinstall": "claude-get your-username/your-repo"
  },
  "dependencies": {
    "claude-code-manager": "^1.0.0"
  }
}

优势

  • 无需Git: 直接下载ZIP,不需要安装Git
  • 无需Python: 纯Node.js实现,轻量快速
  • 离线模板: 本地保存模板,无需网络即可使用
  • 灵活配置: 支持多种URL格式和目录选项
  • 智能提示: 自动检测项目类型并给出建议

错误处理

  • 网络连接问题自动重试
  • 支持main/master分支自动切换
  • 详细的错误信息和解决建议
  • 优雅的用户界面反馈

开发

# 克隆项目
git clone https://github.com/your-username/claude-code-manager.git
cd claude-code-manager

# 安装依赖
npm install

# 本地测试
node bin/cli.js --help

许可证

MIT License

更新日志

1.0.0

  • 轻量级设计,无需Git和Python
  • ZIP下载GitHub仓库
  • 本地模板管理系统
  • 交互式命令行界面
  • 常用项目模板快速选择
  • Claude Code API Key管理系统
  • 多Key切换和验证功能
  • Key使用统计和监控