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

@maas-connector/cli

v0.14.0

Published

Connector Hub CLI - Unified Multi-Platform Integration Gateway for AI Agents

Readme

maas-connector CLI

Connector Hub CLI —— 面向 AI Agent 的多平台统一接入网关命令行工具。

同一份源码发布到两个 registry,命令名始终是 maas-connector:

| 目标 | 包名 | registry | | --- | --- | --- | | 集团内部(默认) | @ali/maas-connector | https://registry.anpm.alibaba-inc.com | | 公网 | @maas-connector/cli | https://registry.npmjs.org/ |

安装

集团内部(推荐,需在内网环境):

# 首次使用先安装 tnpm 并登录
npm i -g tnpm --registry=https://registry.anpm.alibaba-inc.com
tnpm login

tnpm i -g @ali/maas-connector

也可以直接用 npm 指定 registry:

npm i -g @ali/maas-connector --registry=https://registry.anpm.alibaba-inc.com

公网:

npm i -g @maas-connector/cli --registry=https://registry.npmjs.org/

本地默认 registry 已指向内网 anpm 时,必须带上 --registry,否则 anpm 会因镜像尚未同步版本而报 ENOVERSIONS。 公网旧包名 maas-connector 已停止更新(停在 0.9.11),请改用 @maas-connector/cli。

配置

Connector Key 是必填项,缺失会直接报错退出,优先级:CLI flag > 环境变量 > 报错退出。

HUB 地址 可以不传,默认指向线上 https://skillhub.wanuai.cn,优先级:CLI flag > 环境变量 > 默认地址。

# 方式一:直接用默认线上地址,只配 Key
export MAAS_CONNECTOR_KEY="mck_xxx"
maas-connector shopify products.list -p limit=10

# 方式二:显式指定 HUB 地址(私有化部署)
maas-connector shopify products.list -p limit=10 \
  -k mck_xxx --hub-url https://your-hub.example.com

# 本地联调
maas-connector shopify products.list --hub-url http://localhost:7001

私有化部署或本地联调时,用 --hub-url 或 MAAS_CONNECTOR_HUB_URL 覆盖默认地址。 Vault 模式例外:地址必须显式传入,不接受环境变量或默认地址兜底(见下文)。

Vault 模式(0.10.0 起:兼容 Forge Vault)

新增 Vault 调用方式,原来的真实 Key、MAAS_CONNECTOR_KEY、MAAS_CONNECTOR_HUB_URL 和旧接口继续可用。

Vault 模式只接受以下占位值与对应地址:

| --key | --hub-url 路径 | |---|---| | vault-user | /connector-hub/vault/user | | vault-tenant | /connector-hub/vault/tenant | | vault-platform | /connector-hub/vault/platform |

maas-connector google messages.list \
  --key vault-user \
  --hub-url https://<Hub域名>/connector-hub/vault/user \
  --account-id <账号ID> \
  --header requestId=<请求ID> \
  --raw

普通请求追加 /api/invoke,文件请求追加 /api/invoke/upload。例如 -p image=@/tmp/image.png 仍按原来的规则上传文件;Vault 上传同时传递 --account-id 和 requestId。

CLI 只发送 Authorization: Bearer vault-user 等占位值。Forge 在沙箱外按地址注入真实 Key,CLI 不调用 Vault API,也不读取真实 Key。

--hub-url 在 Vault 模式下必须显式指定,不能退回环境变量或默认域名;地址和占位值不匹配、鉴权失败、网络失败或 HTTP 重定向都会失败,不切换旧方案。未知的 vault-* 占位值同样拒绝。

--header 原本表示第三方业务请求头,这个含义保持不变;Vault 模式额外把 requestId 放到 Hub HTTP 请求头,并同步为 Hub 能识别的 X-Request-Id,方便追踪。不能用它覆盖 Authorization、X-Connector-Key、X-App-Key 等鉴权头。

服务端配置、身份分类及上线顺序见 Vault 接入说明。

本地开发

npm install
npm run link          # npm link,把本地代码挂成全局 maas-connector 命令
npm start -- --help   # 不 link 直接跑

验证

npm install
npm test
npm pack --dry-run

测试启动本机临时 HTTP 服务,验证实际 CLI 进程的普通调用、上传、新旧兼容和失败处理;不会调用真实业务接口。

发布

发布前先改版本号。本目录在 Java 单仓里,用 --no-git-tag-version 避免 npm 自动打 tag / 提交:

npm version patch --no-git-tag-version    # 或 minor / major

本次代码版本为 0.12.0;修改版本号不代表已经发布到 npm。

然后按需选择目标。建议先跑 dry-run 确认包名、版本、tarball 内容:

npm run release:internal:dry     # 内部,仅预演
npm run release:internal         # 内部,真实发布 @ali/maas-connector

npm run release:public:dry       # 公网,仅预演
npm run release:public           # 公网,真实发布 maas-connector

发布脚本 scripts/publish.mjs 的行为:

  • 不改动仓库里的 package.json,而是把 files 声明的内容复制到系统临时目录, 在临时目录里替换成目标包名后再 npm publish,中断也不会留下脏文件;
  • 显式传 --registry,不受本地 .npmrc 影响;
  • 发布前打印目标 registry 与当前登录账号,账号识别不到时给出登录提示;
  • 额外参数原样透传给 npm publish,例如 node scripts/publish.mjs public --tag beta --otp 123456。

首次发布内部包

@ali/maas-connector 是新包名,直接发布即可,发布后你会自动成为该包 owner。 后续给他人授权:

tnpm owner add <域账号> @ali/maas-connector

若发布报 401/403,先确认已执行 tnpm login(Ali NPM 只支持 web login,不支持密码登录)。