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

@moonwork-labs/cli

v0.0.10

Published

MoonWork CLI for content generation, local runtime orchestration, and agent automation.

Readme

MoonWork CLI

@moonwork-labs/cli 提供 moonwork 命令行工具。

MoonWork 当前聚焦两类能力:

  • 内容生成:商品文案、商品图片、商品视频
  • 指纹浏览器基础设施:代理关联、指纹浏览器 profile、指纹浏览器启动与复用、登录自动填充、runtime 生命周期管理

MoonWork 不是一个通用浏览器控制层。它更适合先把正确的指纹浏览器环境准备好,再交给用户手动操作,或者交给第三方 agent 接管。

安装

npm install -g @moonwork-labs/cli

安装完成后可以先执行:

moonwork version
moonwork system info --json
moonwork --help

它适合做什么

适合的场景:

  • 在终端里生成电商平台内容
  • 为某个平台账号准备带代理的指纹浏览器环境
  • 将平台账号绑定到可复用的指纹浏览器 profile
  • 启动一个用户可手动操作的指纹浏览器会话
  • 启动指纹浏览器后,把会话交给 agent

不适合作为主要能力边界的场景:

  • 以 selector 为中心的浏览器自动化
  • 通用爬虫命令集
  • 把点击、抓取、翻页、标签页控制做成 CLI 的主要使用方式

这类更偏交互和页面操作的能力,更适合交给更上层的 agent 工具处理,例如 Playwright、Puppeteer,或者其他支持 CDP 接管的 agent 工具。

快速开始

1. 登录

普通账号登录:

moonwork login --email [email protected] --password-stdin
moonwork whoami

如果是 agent 或 CI 环境,建议使用 MoonWork 网站账户中心创建的 access token,并确保网站环境和 API 环境一致:

moonwork login --token-stdin
moonwork whoami --json

2. 生成内容

生成文案:

moonwork generate-copy \
  --product-name "Insulated Travel Mug" \
  --product-image ./product.png \
  --platform AMZ \
  --language English

生成图片任务:

moonwork generate-image \
  --product-image ./product.png \
  --product-name "Outdoor Knife" \
  --platform TK \
  --language English \
  --ratio 9:16 \
  --resolution 1080x1920 \
  --task white-bg \
  --task hero \
  --wait \
  --output-dir ./moonwork-results

生成视频任务:

moonwork generate-video \
  --product-image ./product.png \
  --product-name "Outdoor Knife" \
  --core-selling-points "portable, camping ready" \
  --video-requirements "show opening, grip, and outdoor usage" \
  --platform TK \
  --language English \
  --ratio 9:16 \
  --duration-seconds 10 \
  --resolution 1080p \
  --task product-showcase \
  --generate-audio true \
  --subtitles true \
  --wait \
  --output-dir ./moonwork-results

3. 启动一个指纹浏览器

最简单的方式,是直接从平台账号启动:

moonwork browser launch --business-account-id <business-account-id>

一个更完整的典型流程通常是:

  1. 查看可用代理资源
  2. 查看可用平台账号
  3. 创建或复用一个 profile
  4. 启动指纹浏览器
  5. 用户自己继续操作,或者把会话交给 agent

指纹浏览器使用闭环

MoonWork 的指纹浏览器命令,目标是把“指纹浏览器环境准备”这条路径补完整。

查看可用资源

moonwork browser proxy list --json
moonwork browser business-account list --json

创建可复用 Profile

快速方式:

moonwork browser profile create store-us --json

配置文件方式:

moonwork browser profile init store-us --output-file ./store-us.profile.json --json
moonwork browser profile create --config ./store-us.profile.json --json
moonwork browser bindings store-us --json
moonwork browser doctor --json

browser profile init 会生成一份可复用的默认 profile 模板。只有确实需要自定义行为时,再去修改这份 JSON。

启动与复用会话

按平台账号启动:

moonwork browser launch --business-account-id <business-account-id> --json
moonwork browser launch <business-account-id> --json

按 profile 启动:

moonwork browser launch store-us --json
moonwork browser launch store-us --browser-executable "/path/to/browser" --json
moonwork browser launch store-us --provider electron --bridge-url http://127.0.0.1:17321 --app-id moonwork-agent --window-id main --placement right-panel --json
moonwork browser launch store-us --provider chrome --json

可选生命周期控制:

moonwork browser launch store-us --ttl 1800 --json
moonwork browser launch store-us --idle-timeout 900 --json

行为说明:

  • 如果相同 profile 的 runtime 会话已经存在,MoonWork 会优先复用
  • launch 解析优先级为:显式 CLI 参数、local profile 绑定、平台账号默认值
  • 如果本机只有国产 Chromium 壳浏览器,MoonWork 会先探测 CDP,探测通过后才使用
  • 当绑定的平台账号带有登录信息时,launch 默认会尝试自动填充
  • CLI 在启动完成后会退出,不会一直挂住终端
  • --provider electron 会把启动请求发给调用方传入的 Electron bridge;CLI 不会猜测应该回显到哪个 Electron 应用

浏览器环境辅助命令:

moonwork browser doctor --json
moonwork browser doctor --browser-executable "/path/to/browser" --json
moonwork browser install chromium --download --install-dir ./.moonwork-browsers --json
moonwork browser install edge --download --install-dir ./.moonwork-browsers --json

browser install chromium --download 会下载 Chrome for Testing,作为 Chromium 兼容 runtime 浏览器使用。browser install edge --download 会在官方 Edge 更新元数据能匹配当前系统时下载 Edge 安装包。需要使用企业内镜像或手动选择的官方安装包时,可以传 --download-url

查看 Runtime 状态

moonwork browser sessions --json
moonwork browser session <runtime-id> --json
moonwork runtime status --json
moonwork browser stop <runtime-id> --json
moonwork browser stop-all --json
moonwork runtime shutdown --json

自动填充与 Cookies

moonwork browser login --business-account-id <business-account-id> --json
moonwork browser autofill <runtime-id> --business-account-id <business-account-id> --json
moonwork browser cookies export <profile-id> --json
moonwork browser cookies import <profile-id> --input-file ./cookies.json --json
moonwork browser cookies clear <profile-id> --json

JSON 输出

如果是给 agent、脚本或集成程序使用,建议统一加 --json

成功输出:

{
  "ok": true,
  "data": {},
  "error": null,
  "meta": null
}

失败输出:

{
  "ok": false,
  "data": null,
  "error": {
    "code": "MONTHLY_LIMIT_EXCEEDED",
    "message": "MONTHLY_LIMIT_EXCEEDED",
    "status": 402
  }
}

常用命令

账户与包信息

moonwork login --email [email protected] --password-stdin
moonwork login --token-stdin
moonwork whoami --json
moonwork logout
moonwork config-check --json
moonwork version --json
moonwork system info --json
moonwork update-check --json
moonwork self-update
moonwork skill-path --json

moonwork system info --json 返回运行 CLI 的本机操作系统信息,不需要登录,也不会调用后端 API。

内容生成

moonwork skills --json
moonwork points --json
moonwork quota --json
moonwork jobs --limit 10 --json
moonwork job <job-id> --wait --json
moonwork results <job-id> --json
moonwork cancel <job-id> --json

浏览器基础设施

moonwork browser proxy list --json
moonwork browser proxy get <resource-id> --json
moonwork browser proxy test <resource-id> --json
moonwork browser proxy diagnose <resource-id> --json
moonwork browser business-account list --json
moonwork browser business-account get <business-account-id> --json
moonwork browser profile list --json
moonwork browser launch --business-account-id <business-account-id> --json
moonwork browser ws <runtime-id> --json
moonwork browser cdp <runtime-id> --json

browser wsbrowser cdp 属于 handoff / debug 命令,更适合在另一个工具需要连接现有指纹浏览器会话时使用。

内容生成补充说明

文案生成:

  • 必填:--product-name--product-image--platform--language
  • 选填:--product-info
  • --product-image 最多可重复 4 次
  • 如果图片已经在 MoonWork 后端存在,可以直接使用 --image-asset

图片生成:

  • 必填:商品图片或素材、商品名、平台、语言、比例、分辨率、任务类型

视频生成:

  • 必填:商品图片或素材、平台、语言、比例、时长、分辨率、任务类型

使用 --wait 可以等待任务到达最终状态;使用 --output-dir 可以把生成结果直接保存到本地。

默认情况下,results 输出只返回生成结果,不返回源素材。只有在明确需要时,才使用 --include-source

Agent Skill

这个包里自带一份可分发的 MoonWork skill:

skills/moonwork/

可以通过下面命令定位:

moonwork skill-path

这份 skill 适合给会调用 moonwork CLI、并解析标准 JSON 输出的 agent runtime 使用。

退出码

  • 0:命令执行成功
  • 1:参数校验、认证、额度、API 或网络错误

HTTP 402 通常表示当前账号的积分或额度不足。

能力边界

MoonWork 提供的是:

  • 内容生成能力
  • 带代理关联的指纹浏览器基础设施
  • 指纹浏览器启动与 runtime 生命周期管理
  • 登录自动填充与会话交接

MoonWork 不打算直接承担的是:

  • 完整指纹浏览器自动化控制层
  • 通用爬虫框架
  • 高层 agent 决策与页面操作逻辑

相关文档