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

cli-agent-gateway

v0.1.5

Published

HTTP gateway for CLI coding agents (Cursor, Claude, Kimi) via ACP

Downloads

64

Readme

cli-agent-gateway (npm)

npm 分发包:安装时从 GitHub Releases 下载对应平台的 Go 二进制,并提供 cli-agent-gateway / cag 命令。

完整文档见仓库根目录 README.zh-CN.md

安装

npm install -g cli-agent-gateway

或一次性运行:

npx cli-agent-gateway init
npx cli-agent-gateway

注意:本包只安装网关,不包含 cursor-agent。请先安装 Cursor CLI 或配置 config.local.yaml 中的 cursor.binary_path

命令

| 命令 | 说明 | |------|------| | cli-agent-gateway | 启动 HTTP 网关(默认 127.0.0.1:8080) | | cli-agent-gateway init | 初始化用户配置目录 | | cli-agent-gateway doctor | 检查二进制与 cursor-agent | | cag | 同上(短别名) |

配置

npm 启动器会自动传入 -config

  1. 当前工作目录存在 config.yaml → 使用该文件
  2. 否则使用用户配置目录(init 或首次启动时自动创建)

与 Go 二进制内置解析逻辑一致;旧版 Release 二进制也通过 npm 层兼容。

  • Linux/macOS:~/.config/cli-agent-gateway/
  • Windows:%AppData%\cli-agent-gateway\

环境变量

| 变量 | 说明 | |------|------| | CG_BINARY_PATH | 使用本地二进制,跳过 vendor 下载 | | CG_SKIP_BINARY_INSTALL | postinstall 不下载二进制 | | CG_BINARY_VERSION | 指定 Release 标签(如 v0.1.1) | | CG_GITHUB_REPO | 默认 chaojimct/cli-agent-gateway | | CG_CONFIG_HOME | 覆盖用户配置目录 |

发布(维护者)

配置 GitHub Secret(首次必做)

CI 报错 ENEEDAUTH 表示 未配置或配错了 NPM_TOKEN

  1. 打开 https://www.npmjs.com → 右上角头像 → Access TokensGenerate New Token
  2. Granular Access Token(npm 新版已取消单独的 “Automation” 类型)
  3. Packages:勾选 cli-agent-gateway(或 All packages)
  4. PermissionsRead and write
  5. 若账号开了 2FA:勾选 Bypass two-factor authentication(CI 发布必须,否则 Actions 无法 publish)
  6. 设置过期时间 → Generate Token → 复制 token(只显示一次)
  7. GitHub 仓库 → SettingsSecrets and variablesActionsNew repository secret
    • Name 必须为:NPM_TOKEN(大小写一致)
    • Value:粘贴 npm token

配置好后:每次推送 v* tagbuild 工作流会创建 GitHub Release,并在同一运行末尾 npm publish,无需单独点 Actions。

npm 版本需与 Release tag 一致(如 v0.1.3 → 包版本 0.1.3)。

若二进制已就绪但只有一次 npm 失败,可用 Actions → npm-publish-manual,输入与 tag 一致的版本号做补救。

本地打包检查:

cd packages/cli-agent-gateway
npm pack