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

hermes-xiaodu

v0.1.3

Published

小度 ↔ Hermes 桥接服务 CLI

Readme

hermes-xiaodu

小度(Xiaodu)到 Hermes Agent 的本地桥接 CLI。

hermes-xiaodu start 会检查 ~/.hermes/.env,自动补齐小度 Access Token 和 API_SERVER_ENABLED=trueAPI_SERVER_KEY,必要时重启 Hermes gateway,然后在后台启动桥接服务。

工作方式

小度云端 WebSocket ──► hermes-xiaodu 后台服务 ──► Hermes gateway API
                              │                 POST /v1/chat/completions
                              └──► 小度云端 HTTP /openclaw/gateway
  • 小度云端通过 WebSocket 推送用户消息。
  • 后台服务用设备 cuid 作为 X-Hermes-Session-Id 调用 Hermes。
  • Hermes 回复后,后台服务用 fe-service 当前兼容的旧版 Xiaodu SendMessage 字段发回小度云端。
  • 同一个 cuid 的消息串行处理,不同设备可以并行。

前置条件

  • Node.js >= 18
  • Hermes 已安装,并能通过 hermes gateway run --replace 启动

不需要单独手动启动 hermes api-server。CLI 会确保 gateway 模式下启用 API_SERVER_ENABLED=true,Hermes 会在 localhost:8642 暴露 API。

安装

开发目录内使用:

npm install
npm run build
npm link

发布后用户使用:

npm install -g hermes-xiaodu

使用

hermes-xiaodu start
hermes-xiaodu restart
hermes-xiaodu status
hermes-xiaodu stop

不安装也可以直接用 npx:

npx hermes-xiaodu start
npx hermes-xiaodu restart
npx hermes-xiaodu status
npx hermes-xiaodu stop

如果已经拿到了小度 AccessToken,可以在启动时直接设置:

npx hermes-xiaodu start --token your_xiaodu_access_token

也可以单独更新 AccessToken:

npx hermes-xiaodu setAccessToken your_xiaodu_access_token

setAccessToken 支持粘贴授权页复制出的完整提示词。更新 token 时,如果桥接服务正在运行,CLI 会自动重启桥接服务让新 token 生效;这不会重启 Hermes gateway。start 过程中如果补齐或更新了 API_SERVER_ENABLED / API_SERVER_KEY,会自动重启 Hermes gateway。

如果你希望让 Hermes 代理自动帮用户完成安装、配置和验证,可以参考:

install/SKILL.md

首次执行 hermes-xiaodu start 时,如果 ~/.hermes/.env 缺少 XIAODU_ACCESS_TOKEN,CLI 会提示你打开以下页面获取:

https://duerstatic.cdn.bcebos.com/openclaw/claw-token.html

在页面点击“授权获取密钥”完成 OAuth 授权后,可以复制第 2 步的完整提示词, 直接粘贴回 CLI;CLI 会自动提取其中的 AccessToken 并写入 ~/.hermes/.env

后台服务日志写入:

~/.hermes/logs/xiaodu-bridge.log

配置

配置从环境变量和 ~/.hermes/.env 读取。常用项:

XIAODU_ACCESS_TOKEN=your_xiaodu_access_token
API_SERVER_ENABLED=true
API_SERVER_KEY=auto_generated_secret
HERMES_API_URL=http://localhost:8642
HERMES_MODEL=default
LOG_LEVEL=info

可选的小度端地址:

XIAODU_WS_URL=wss://xiaodu.baidu.com/openclaw/socket
XIAODU_BASE_URL=https://xiaodu.baidu.com

开发命令

npm run hermes-xiaodu -- --help
npm run typecheck
npm run test
npm run build

构建产物在 dist/,发布 bin 入口是 dist/bin/hermes-xiaodu.js