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

claude-code-proxy-cli

v1.1.0

Published

增强版Claude Code代理服务CLI工具,支持多提供商、智能路由和变换器系统

Downloads

52

Readme

天天AI Claude代理服务

🚀 由 tiantianai.pro 提供的本地Claude Code代理服务CLI工具,让你通过代理调用API接口,无需依赖云平台。

特性

  • ✨ 一键安装和启动
  • 🔧 自动安装Claude CLI
  • 🌐 本地代理服务,保护隐私
  • 🌟 高性能、安全可靠
  • 🎯 智能模型选择
  • 📊 实时状态监控
  • 🔄 兼容Anthropic和OpenAI API格式

开始使用

1. 注册获取API密钥

🌐 访问官网注册: https://tiantianai.pro

在官网注册账号并获取API密钥,然后继续安装步骤。

2. 安装

# 全局安装
npm install -g claude-code-proxy-cli

# 或者使用yarn
yarn global add claude-code-proxy-cli

快速开始

1. 配置API设置

claude-proxy config

按提示输入以下信息:

  • API Key(默认已提供测试密钥)
  • API Base URL(默认: https://api.ai-wave.org/v1)
  • 大模型名称(默认: claude-opus-4)
  • 小模型名称(默认: claude-sonnet-4)
  • 代理服务端口(默认: 8082)

2. 启动服务

# 标准启动
claude-proxy start

# 或者快速启动
claude-code-start

# 指定端口启动
claude-proxy start -p 8083

# 后台运行
claude-proxy start -d

3. 使用Claude Code

服务启动后,Claude CLI会自动配置为使用本地代理,你可以直接使用:

claude-code

命令参考

配置管理

# 配置API设置
claude-proxy config

# 查看当前配置
claude-proxy status

服务管理

# 启动服务
claude-proxy start [选项]

# 停止服务
claude-proxy stop

# 查看服务状态
claude-proxy status

Claude CLI管理

# 安装Claude CLI
claude-proxy install-claude

启动选项

  • -p, --port <port>: 指定端口号
  • -d, --daemon: 后台运行

API接口

代理服务提供以下API接口:

健康检查

GET http://localhost:8082/health

聊天完成

POST http://localhost:8082/v1/chat/completions
POST http://localhost:8082/v1/messages  # Anthropic格式

模型列表

GET http://localhost:8082/v1/models

智能模型选择

系统会根据请求内容自动选择合适的模型:

  • 复杂任务:使用大模型(claude-opus-4)
    • 大量token需求(> 2048)
    • 长文本内容(> 2000字符)
  • 简单任务:使用小模型(claude-sonnet-4)
    • 快速响应需求
    • 简短对话

配置文件

配置文件存储在用户目录下:~/.claude-proxy-config.json

默认配置:

{
  "apiKey": "sk-hqCBU4vCa20ckdQ_qwRjyaXbJf8-RRFczVdDC0F_ADuh9ixbY7WB74lfa6k",
  "baseUrl": "https://api.ai-wave.org/v1",
  "bigModel": "claude-opus-4",
  "smallModel": "claude-sonnet-4",
  "proxyPort": 8082,
  "logLevel": "INFO",
  "maxTokensLimit": 4096,
  "minTokensLimit": 1024,
  "requestTimeout": 90,
  "maxRetries": 2
}

价格套餐

  • 日卡: ¥29.9
  • 周卡: ¥190
  • 月卡: ¥728

故障排除

端口被占用

# 查看端口使用情况
lsof -i :8082

# 或者指定其他端口启动
claude-proxy start -p 8083

Claude CLI未安装

# 手动安装Claude CLI
claude-proxy install-claude

# 或者直接安装
npm install -g @anthropic-ai/claude-code

代理连接问题

# 检查服务状态
claude-proxy status

# 测试连接
curl http://localhost:8082/health

开发

本地开发

# 克隆项目
git clone <repository-url>
cd claude-code-proxy-cli

# 安装依赖
npm install

# 开发模式运行
npm run dev

# 运行测试
npm test

项目结构

claude-code-proxy-cli/
├── bin/                    # CLI入口文件
│   ├── claude-proxy.js     # 主CLI工具
│   └── start.js           # 快速启动脚本
├── src/                    # 源代码
│   ├── index.js           # 主入口
│   └── proxy-server.js    # 代理服务器
├── scripts/               # 辅助脚本
├── test/                  # 测试文件
├── package.json           # 包配置
└── README.md             # 说明文档

环境变量

服务启动后会自动设置以下环境变量:

ANTHROPIC_BASE_URL=http://localhost:8082
ANTHROPIC_AUTH_TOKEN=dummy-key

注意事项

  1. 网络连接:确保能够访问API服务器
  2. 端口权限:某些系统可能需要管理员权限使用特定端口
  3. 防火墙:确保代理端口未被防火墙阻止
  4. Node.js版本:需要Node.js 16或更高版本

许可证

MIT License

支持

  • 问题反馈:[GitHub Issues]
  • 技术支持:[邮箱地址]
  • 使用文档:[文档链接]

享受智能编程体验! 🎉