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

@chenpu17/cc-gw

v0.8.8

Published

Rust-backed local Claude Code compatible gateway with web console and CLI daemon.

Downloads

1,931

Readme

cc-gw

GitHub 仓库:chenpu17/cc-gw2

cc-gw 是一个本地网关项目,使用 Rust 重写原先的 Node.js 后端,同时保留现有 Web UI、CLI 使用方式、配置文件和 SQLite 数据格式的兼容性。

当前主线已收敛到 v0.8.4 正式版,核心收益是后端完成 Rust 化之后,在相同常驻场景下内存占用实测可降至旧 Node.js 实现的约 1/20,同时继续保持对既有 CLI、Web UI、配置目录与 SQLite 数据的兼容。

说明:

  • 当前 GitHub 仓库名是 cc-gw2
  • 对外 npm 包名仍然是 @chenpu17/cc-gw
  • 命令行入口仍然是 cc-gw

项目目标

  • Web 前端保持不改,继续复用现有管理台
  • 后端接口尽量对齐旧 Node.js 版本的外部行为
  • SQLite 数据、配置目录、密钥格式继续兼容旧版本
  • CLI 保持 startstoprestartstatusversion 等命令习惯
  • npm 安装默认使用预编译原生二进制,不要求用户本机安装 Rust
  • 发布目标尽量提供自包含二进制,减少宿主机运行时依赖

正式版亮点

  • Rust 后端已替代旧 Node.js 服务端,兼容原有使用方式
  • 常驻内存占用实测下降到旧实现的约 1/20
  • npm 安装默认分发预编译原生二进制,普通用户不需要本机 Rust 环境
  • Web 控制台、CLI 命令习惯、配置文件路径与 SQLite 数据格式继续兼容

控制台预览

以下截图通过仓库脚本自动生成,固定为英文界面与亮色主题:

快速开始

全局安装:

npm install -g @chenpu17/cc-gw

以前台模式启动:

cc-gw start --foreground --port 4100

或以守护进程模式启动:

cc-gw start --daemon --port 4100

启动后访问:

http://127.0.0.1:4100/ui

默认本地数据目录:

  • 配置:~/.cc-gw/config.json
  • 数据库:~/.cc-gw/data/gateway.db
  • 日志:~/.cc-gw/logs
  • PID:~/.cc-gw/cc-gw.pid

当前实现

  • Rust workspace:crates/cc-gw-corecrates/cc-gw-server
  • 兼容型 CLI:src/cli
  • 原 Web 前端:src/web
  • 兼容配置路径:~/.cc-gw/config.json
  • 兼容数据库路径:~/.cc-gw/data/gateway.db
  • 兼容旧 encryption.key、旧 api_keys.key_ciphertext、旧 Web Auth scrypt 密码格式
  • 已覆盖 Web 管理台和客户端依赖的核心接口,包括 /ui/assets/*/favicon.ico/api/*/v1/*/openai/v1/*
  • 已实现 Anthropic / OpenAI Chat / OpenAI Responses 的代理与流式转换
  • 已实现 API Key、日志、事件、统计、路由预设、自定义端点和 SQLite 兼容迁移

本地开发

pnpm install
pnpm build
pnpm dev

直接通过 CLI 前台启动:

pnpm --filter @cc-gw/cli exec tsx index.ts start --foreground

pnpm build 会执行:

  1. 构建 Rust 服务端
  2. 构建 src/cli/dist
  3. 构建 src/web/dist
  4. 为当前平台生成 bin/<platform>-<arch>/cc-gw-server
  5. 同步当前平台 native npm 子包中的原生二进制

CLI 启动时的后端解析顺序:

  1. 平台专用 native npm 子包
  2. CC_GW_SERVER_BIN
  3. 工作区 bin/<platform>-<arch>/cc-gw-server
  4. 工作区 target/releasetarget/debug
  5. cargo run -p cc-gw-server --

安装与发布

对外发布模型:

  • 根包:@chenpu17/cc-gw
  • 平台包:@chenpu17/cc-gw-darwin-arm64
  • 平台包:@chenpu17/cc-gw-linux-x64
  • 平台包:@chenpu17/cc-gw-linux-arm64
  • 平台包:@chenpu17/cc-gw-win32-x64

用户安装:

npm install -g @chenpu17/cc-gw

安装时会通过 optionalDependencies 自动拉取当前平台的预编译二进制,无需本地编译 Rust。 Linux 版本使用 musl,Windows 版本使用静态 CRT,目标是让用户只需 npm install 即可直接运行。

本地在仓库中直接验证未发布包时,需要额外安装当前平台 native 包;否则 CLI 会回退到 cargo run

pnpm pack:dry-run
pnpm --dir packages/native/darwin-arm64 pack --pack-destination ../../../.pack/native
npm install -g ./.pack/native/chenpu17-cc-gw-darwin-arm64-0.8.4.tgz
npm install -g ./.pack/chenpu17-cc-gw-0.8.4.tgz

当前发布目标:

  • macOS arm64
  • Linux x64
  • Linux arm64
  • Windows x64(npm 包名为 win32-x64

验证

建议在上传或发版前执行:

cargo test
pnpm build
pnpm smoke:cli
pnpm pack:dry-run

首次运行 Web E2E 前,先安装 Playwright Chromium:

pnpm exec playwright install --with-deps chromium
pnpm test:e2e:web

如需刷新 README 中使用的英文亮色截图:

pnpm docs:readme-screenshots

如果只想跑分层回归,可直接用:

pnpm test:e2e:web:core
pnpm test:e2e:web:hardening
pnpm test:e2e:web:visual

如需刷新页面级截图基线:

pnpm test:e2e:web:update-snapshots

当前仓库已具备:

  • Web UI 构建通过
  • Web Playwright E2E 通过
  • 页面级视觉截图基线回归
  • 低频危险路径 E2E
  • CLI smoke 流程可单独执行
  • GitHub Actions CI 与 release workflow 已落地

CI 与文档