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

openilink-app-runner

v0.3.6

Published

Run local commands as OpeniLink Hub App tools — bridge CLI to WeChat

Readme

openilink-app-runner

将本地命令行工具桥接到微信 —— 通过 OpeniLink Hub 接收微信命令,在本地执行,返回结果。

工作原理

微信用户 → /weather 北京 → Hub → WebSocket → Runner → curl wttr.in/北京 → 结果返回微信
  1. 在 YAML 配置中定义命令(名称 + shell 命令)
  2. Runner 启动时自动同步命令到 Hub
  3. 通过 WebSocket 保持连接,接收来自微信的命令事件
  4. 在本地执行对应 shell 命令,将输出返回给微信用户

安装

npm install -g openilink-app-runner

快速开始

1. 初始化配置

openilink-app-runner init --hub-url https://hub.openilink.com --token app_xxx

这会在当前目录创建 runner.yaml 配置文件。

2. 添加命令

# 添加查天气命令
openilink-app-runner add weather "curl -s 'wttr.in/\${args}?format=3'" -d "查天气" -t 5

# 添加查 IP 命令
openilink-app-runner add ip "curl -s ifconfig.me" -d "查公网 IP" -t 5

# 查看已添加的命令
openilink-app-runner list

添加命令时会自动同步到 Hub。

3. 启动

openilink-app-runner start

现在在微信中发送 /weather 北京 即可看到天气结果。

CLI 命令

| 命令 | 说明 | |------|------| | init --hub-url <url> --token <token> | 初始化配置文件 | | add <name> <exec> [-d desc] [-t timeout] | 添加命令 | | remove <name> | 删除命令 | | list | 查看已配置的命令 | | sync | 手动同步命令到 Hub | | start | 启动 runner,连接 Hub 并监听命令 |

所有命令支持 -c, --config <path> 指定配置文件路径,默认为 runner.yaml

配置文件格式

hub_url: "https://hub.openilink.com"
app_token: "app_your_token_here"
max_output: 2000  # 输出最大字符数

commands:
  weather:
    description: "查天气"
    exec: "curl -s 'wttr.in/${args}?format=3'"
    timeout: 5  # 秒,默认 30
  ip:
    description: "查公网 IP"
    exec: "curl -s ifconfig.me"
    timeout: 5

字段说明

  • hub_url — Hub 服务地址(必填)
  • app_token — App Token,在 Hub 中创建 App 后获取(必填)
  • max_output — 命令输出最大字符数,超出截断(默认 2000)
  • commands — 命令映射
    • description — 命令描述,会显示在微信中
    • exec — 要执行的 shell 命令,支持 ${args} 占位符接收用户输入
    • timeout — 超时秒数(默认 30)

安全提示

${args} 会直接替换到 shell 命令中,存在命令注入风险。请注意:

  • 仅在信任的微信群/用户中使用
  • 避免在 exec 中使用 ${args} 执行危险操作(如 rmsudo 等)
  • 设置合理的 timeout 防止命令卡住
  • max_output 限制输出大小,防止刷屏

示例:集成 opencli

commands:
  hn:
    description: "HackerNews 热门"
    exec: "opencli hackernews top --format json"
    timeout: 10
  github:
    description: "GitHub 趋势"
    exec: "opencli github trending ${args}"
    timeout: 10

自动重连

Runner 会自动维护 WebSocket 连接。断开后每 5 秒自动重连,同时通过 ping/pong 保持心跳。


English

What is this?

openilink-app-runner bridges local CLI commands to WeChat via OpeniLink Hub. Define commands in a YAML config, and WeChat users can invoke them by sending /command args.

How it works

  1. Define commands in runner.yaml (name + shell command)
  2. Runner syncs commands to Hub on startup
  3. Stays connected via WebSocket, receives command events from WeChat
  4. Executes shell commands locally, returns output to WeChat

Quick start

npm install -g openilink-app-runner

openilink-app-runner init --hub-url https://hub.openilink.com --token app_xxx
openilink-app-runner add weather "curl -s 'wttr.in/\${args}?format=3'" -d "Weather" -t 5
openilink-app-runner start

Security

${args} is interpolated directly into shell commands. Only use in trusted environments. Set reasonable timeouts and output limits.

License

MIT