首页龙虾技能列表 › Westmoon QR Code — 西之月登录

Westmoon QR Code — 西之月登录

v0.1.1

西之月二维码登录工具。

1· 46·0 当前·0 累计
by @jader (Jader)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/10
安全扫描
VirusTotal
Pending
查看报告
OpenClaw
安全
high confidence
The skill's code, instructions, and requested resources match its stated purpose (QR-code login and token persistence); nothing indicates hidden exfiltration or unrelated privileges, though a few minor implementation notes deserve attention.
评估建议
This skill appears to do exactly what it says: generate a Westmoon QR, poll for confirmation, and save tokens to ~/.westmoon-user-login/tokens.json. Before installing, consider: 1) Verify the API host: the code uses api-x.westmonth.com while the skill name/docs say Westmoon—confirm this is the correct endpoint. 2) The skill writes auth tokens to your home directory (files are created with restrictive perms but still stored on disk); if you share the machine or are concerned about persistence, do...
详细分析 ▾
用途与能力
The skill's name, SKILL.md, and code consistently implement a Westmoon QR-login flow and persist tokens under ~/.westmoon-user-login. One minor inconsistency: Config.BASE_URL uses api-x.westmonth.com (note the extra 't' in 'westmonth') while the skill and docs refer to 'westmoon'—verify the intended API host.
指令范围
Runtime instructions (SKILL.md) align with the code: generate QR, decode/save image, poll status, fetch user info, and persist tokens. The code only reads/writes files under the dedicated ~/.westmoon-user-login directory and does network calls to the configured BASE_URL endpoints.
安装机制
No install spec is provided (instruction-only metadata), but the bundle includes Python scripts and requirements.txt (requests). Installing or running the skill will require Python and the requests package; there is no remote download of arbitrary code or installers in the manifest.
凭证需求
The skill requests no environment variables or external credentials. It stores tokens locally (tokens.json) which is appropriate for a login manager. File permissions are set to restrict access (directory 700, token temp file 600).
持久化与权限
The skill persists tokens to the user's home directory for reuse and agents/openai.yaml sets allow_implicit_invocation: true so it can be triggered when other skills see a missing token — this is coherent for a login helper but be aware it can be invoked automatically by other skills when they detect a missing/expired token.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv0.1.12026/4/10

westmoon-qrcode-login v0.1.1 - No code or documentation changes in this release. - Version bump only; behavior and interface remain the same as previous version.

● Pending

安装命令 点击复制

官方npx clawhub@latest install westmoon-qrcode-login
镜像加速npx clawhub@latest install westmoon-qrcode-login --registry https://cn.clawhub-mirror.com

技能文档

重要:先按本 skill 的流程执行,再调用具体业务接口。不要绕过这里的 token 校验和落盘逻辑。

这个 Skill 用于为西之月相关自动化提供稳定的用户登录态。它支持普通终端场景,也支持 OpenClaw 会话中的二维码展示。

何时使用

  • 需要访问依赖西之月用户身份的接口
  • 其他 Skill 提示缺少或检测到失效的 Authorization: Bearer <令牌>
  • 需要重新获取二维码让用户扫码确认
  • 需要校验本地保存的登录态是否还有效

工作流

获取二维码 -> 解码 wxacode -> 展示给用户 -> 轮询 scan_token
    -> confirmed -> 保存 token -> 调用 /umc/user/user/info 验证
    -> invalid/expired -> 提示重新获取二维码
  • 调用生成接口获取 scan_tokenwxacode
  • wxacode 的 data URI 解码为 PNG 文件
  • 在普通终端打印图片路径和 data URI;在 OpenClaw 中额外输出可识别的文件标记
  • 阻塞模式下默认每 5 秒轮询一次 /umc/miniprogram/qrcode/poll
  • 状态为 confirmed 时保存:
- access_token - refresh_token - token_type - expires_in - expires_at - user_info
  • 使用 Authorization: Bearer <令牌> 访问 /umc/用户/用户/info
  • 如果返回 HTTP 401,则认为本地登录态失效,需要重新登录

快速使用

命令行

# 获取二维码,默认非阻塞
python scripts/westmoon_login.py

# 显式阻塞等待扫码完成 python scripts/westmoon_login.py --blocking

# 继续上一次未完成的扫码轮询 python scripts/westmoon_login.py --continue

# 用指定 scan_token 继续轮询 python scripts/westmoon_login.py --poll

# 查看本地登录态摘要 python scripts/westmoon_login.py --status

# 校验当前 token 是否有效 python scripts/westmoon_login.py --check

# 读取用户信息 python scripts/westmoon_login.py --userinfo

# 清除本地登录态 python scripts/westmoon_login.py --logout

Python API

from scripts.westmoon_login import WestmoonLoginManager

manager = WestmoonLoginManager() result = manager.login()

if result.success and result.scan_token: print(result.message) print(result.scan_token)

非阻塞默认行为与 OpenClaw 场景

  • 默认行为是展示二维码后立即结束,并把待处理的 scan_token 存到 ~/.westmoon-用户-登录/pending_login.json
  • 用户扫码确认后,再让 agent 执行 --continue--poll 完成登录
  • 如果希望当前进程一直等到登录成功,使用 --blocking,此时会每 5 秒轮询一次
  • OpenClaw 场景下,如果 OPENCLAW_SESSION=1,脚本会打印:
- [OPENCLAW_SEND_FILE]...[/OPENCLAW_SEND_FILE] - data:image/png;base64,...

登录态存储

默认保存到:

~/.westmoon-user-login/tokens.json

其他技能优先读取这个文件,或直接使用 scripts/token_manager.py

关键脚本

  • scripts/westmoon_login.py
统一入口,负责编排二维码、轮询、持久化、用户信息验证
  • scripts/qr_code_client.py
负责调用生成接口、解析 wxacode、保存二维码文件
  • scripts/status_poller.py
负责轮询扫码状态
  • scripts/token_manager.py
负责登录态落盘、读取、过期判断
  • references/api_reference.md
西之月扫码登录接口速查
  • references/integration_guide.md
其他 Skill 如何复用登录态

集成建议

  • 当业务 Skill 收到 401,先调用本 Skill 的 --check
  • 若无效,再触发本 Skill 重新登录
  • 只有在确认 令牌 有效后,才继续调用业务接口

详细接口和复用方式请按需读取:

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务