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

@aiyiran/myclaw

v1.1.111

Published

为 OpenClaw 教学环境设计的一站式命令行工具。

Downloads

5,781

Readme

MyClaw CLI

为 OpenClaw 教学环境设计的一站式命令行工具。

npm install -g @aiyiran/myclaw

命令速查

| 命令 | 说明 | 平台 | |------|------|------| | myclaw prepare | 🚀 一键初始化(推荐第一次用) | 全平台 | | myclaw open | 打开浏览器(自动带 Token) | 全平台 | | myclaw update up | 自动升级 MyClaw 到最新版(无缓存) | 全平台 | | myclaw patch | 注入 UI 扩展(语音输入等) | Mac/Linux | | myclaw unpatch | 移除 UI 扩展 | Mac/Linux | | myclaw install | 安装 OpenClaw | 全平台 | | myclaw status | 查看 Gateway / Agent 状态 | 全平台 | | myclaw new <name> | 创建新 Agent | 全平台 | | myclaw restart | 重启 Gateway | 全平台 | | myclaw bat | 生成 Windows 桌面快捷启动器 | Windows | | myclaw wsl2 | WSL2 安装向导 | Windows | | myclaw weixin | 微信绑定向导 | 全平台 | | myclaw rebind | 微信重绑向导 | 全平台 | | myclaw help | 显示帮助 | 全平台 |


核心流程

myclaw prepare — 初始化链条

自动检测环境并按需执行安装、配置、注入:

Step 1: 检测环境 (Mac / Windows / Linux / WSL)
Step 2: 检测 Chrome 浏览器
Step 3: 检测 OpenClaw → 未装则安装
Step 4: 执行 Patch(受 AUTO_PATCH 开关控制)
Step 5: [Windows] 生成桌面快捷启动器

触发方式:

  • 手动运行 myclaw prepare
  • npm install -g @aiyiran/myclaw 时通过 postinstall 自动触发

postinstall 模式(无交互):

  • OpenClaw 已装 → 自动 patch
  • OpenClaw 未装 → 跳过,提示手动安装
  • 不会弹出 y/n 询问

myclaw bat — Windows 桌面启动器

生成一个 .bat 启动脚本 + 桌面快捷方式,双击即可智能启动。

快捷方式命名规则:

版本号_OpenClaw_MM-DD_HH-MM-SS.lnk
例: 1.0.46_OpenClaw_04-01_00-36-19.lnk

通过桌面图标名称可验证 prepare 是否执行过,以及执行的版本和时间。

双击后的完整流程:

Gateway 未运行:
  [1/5] WSL              → 检测/安装 WSL2
  [2/5] OpenClaw Linux   → 检测/导入 WSL 发行版
  [3/5] Gateway          → 未运行 → 更新 myclaw
  [4/5] Patch            → 注入 UI 扩展
  [5/5] Browser          → myclaw open(带 Token)
        → 启动 openclaw gateway(保持窗口)

Gateway 已运行:
  [1/4] WSL
  [2/4] OpenClaw Linux
  [3/4] Gateway          → 已运行
  [4/4] Browser          → myclaw open(带 Token)
        → 进入 WSL 终端(cd /root/.openclaw)

myclaw patch — UI 扩展注入

向 OpenClaw 的 control-ui 注入自定义功能:

  • myclaw-inject.js — 自定义 UI 逻辑
  • voice-input.js — 语音输入 SDK

原理: 修改 control-ui/index.html,在 </body> 前插入 <script> 标签。

myclaw patch     # 注入
myclaw unpatch   # 还原

注意:每次 OpenClaw 更新后需要重新 patch(index.html 会被覆盖)。


myclaw open — 打开浏览器

自动检测 Chrome 路径,拼接 Token 打开:

http://127.0.0.1:18789?token=aiyiran

支持的 Chrome 路径:

  • Mac: /Applications/Google Chrome.app
  • Windows: C:\Program Files\Google\Chrome\Application\chrome.exe
  • Linux: google-chrome / chromium-browser

myclaw wsl2 — WSL2 安装向导

Windows 专用,分两阶段:

| 阶段 | 内容 | |------|------| | Phase 1 | 启用 WSL 功能 + 安装 WSL2(需要重启) | | Phase 2 | 下载并导入 OpenClaw rootfs.tar |

已安装时会提示:

是否要重新安装 Linux 环境? (y/N):

配置文件

config.js

module.exports = {
  TOKEN: 'aiyiran',                      // Gateway 认证 Token
  DEFAULT_URL: 'http://127.0.0.1:18789', // 默认地址
  AUTO_PATCH: true,                      // prepare 时是否自动 patch
};

| 配置项 | 说明 | |--------|------| | TOKEN | 所有 open 命令和 bat 启动器使用的认证令牌 | | DEFAULT_URL | Gateway 地址 | | AUTO_PATCH | true = prepare/postinstall 自动 patch;false = 跳过 |


文件结构

myclaw/
├── index.js              # CLI 主入口 + 命令路由 + bat 模板
├── config.js             # 全局配置(Token、URL、开关)
├── prepare.js            # 初始化链条
├── patch.js              # UI 扩展注入逻辑
├── wsl2.js               # WSL2 安装向导
├── create_agent.js       # Agent 创建
├── package.json          # npm 包配置(含 postinstall)
├── publish.sh            # 一键发布脚本
├── assets/
│   ├── myclaw-inject.js  # 注入到 control-ui 的 JS
│   └── detect-browser.sh # Chrome 检测脚本
├── voice-input/
│   ├── index.html        # 语音输入独立页
│   └── voice-input.js    # 语音 SDK
└── wizards/              # 交互式向导系统
    ├── index.js           # 向导入口
    ├── runner/            # 向导运行引擎
    ├── configs/           # 向导配置文件
    ├── scripts/           # Python 后端脚本
    └── commons/           # 共享步骤定义

调试

查看 prepare 执行日志

prepare 运行时会写入日志文件:

  • Mac/Linux: /tmp/myclaw-prepare.log
  • Windows WSL: /tmp/myclaw-prepare.log
cat /tmp/myclaw-prepare.log

示例输出:

[2026-04-01T00:30:00.000Z] === prepare start (postinstall=true, version=1.0.46)
[2026-04-01T00:30:00.100Z] Step 1: env=linux
[2026-04-01T00:30:00.200Z] Step 2: chrome=true
[2026-04-01T00:30:00.300Z] Step 3: openclaw=installed
[2026-04-01T00:30:00.400Z] Step 4: AUTO_PATCH=true, env=linux
[2026-04-01T00:30:01.000Z] Step 4: patch executed
[2026-04-01T00:30:01.100Z] === prepare end (success)

npm 缓存问题

如果 npm install -g @aiyiran/myclaw 拿到旧版本:

# 方案 1: 强制最新
npm install -g @aiyiran/myclaw@latest --prefer-online

# 方案 2: 清缓存
npm cache clean --force
npm install -g @aiyiran/myclaw

# 方案 3: 先 view 刷新元数据
npm view @aiyiran/myclaw version
npm install -g @aiyiran/myclaw

发布

cd myclaw
sh publish.sh

自动完成:git commit → 版本号 +1 → git push + tag → npm publish