SkillsGrove
SkillsGrove/生産性向上/systemxlabs/wechat-cli/wechat-cli

wechat-cli

インストール

$npx skills add https://github.com/systemxlabs/wechat-cli --skill wechat-cli
$git clone --depth 1 https://github.com/systemxlabs/wechat-cli.git /tmp/wechat-cli && mkdir -p ~/.claude/skills && cp -r /tmp/wechat-cli/. ~/.claude/skills/wechat-cli
この Agent Skill をインストールしてください:https://github.com/systemxlabs/wechat-cli/tree/2236440d93f26e641e0d530dbfbc4c60e0a0e289/ — まず SKILL.md とスクリプトを読み、安全であることを確認してから、私のスキルフォルダにインストールしてください。

概要

原文の説明 · MITUse the `wechat-cli` command-line tool to log in a WeChat bot, manage accounts, and send text, image, or file messages to users.
以下の SKILL.md は systemxlabs/wechat-cli(コミット 2236440)から MIT ライセンスに基づいて転載しています。本文は変更しておらず、ファイル先頭のメタデータのみ省略し、画像はリンクとして表示し、非常に長いファイルは途中までの表示としています。Copyright 2026 SystemX Labs。ライセンス:LICENSE。表示しているのは指示ファイルのみです。スクリプト等は元のリポジトリをご覧ください。

wechat-cli

Install

cargo install wechat-cli

Login

Use non-interactive login workflow:

  1. Request a QR code:
    wechat-cli qrcode
    
  2. Read qrcode_id and qrcode_url from the JSON output.
  3. Show the QR code to the human outside the CLI.
  4. Poll status:
    wechat-cli qrcode-status --qrcode-id <qrcode_id>
    
  5. When status becomes confirmed, read bot_token and user_id from the JSON output.
  6. Use wechat-cli account add to save those credentials.

Account

List Accounts

wechat-cli account list

Use this to find saved account indexes and inspect user_id.

Add Account

wechat-cli account add \
  --user-id <user_id> \
  --bot-token <bot_token> \
  [--route-tag <route_tag>]

Delete Account

wechat-cli account delete --account <index>

Send

Prerequisites

Before sending, you need a context_token.

Send Text (Saved Account)

wechat-cli send \
  --account <index> \
  --context-token <token> \
  --text "hello"

Send Text from Stdin (Pipe)

When --text is omitted and stdin is a pipe or redirected file, the CLI reads the message body from stdin:

echo "hello from pipe" | wechat-cli send \
  --account <index> \
  --context-token <token>

Or redirect from a file:

wechat-cli send \
  --account <index> \
  --context-token <token> \
  < message.txt

Send Image (Saved Account)

wechat-cli send \
  --account <index> \
  --context-token <token> \
  --file <image_path>

Send File (Saved Account)

wechat-cli send \
  --account <index> \
  --context-token <token> \
  --file <file_path>

Send With Caption (Saved Account)

wechat-cli send \
  --account <index> \
  --context-token <token> \
  --file <file_path> \
  --caption "caption text"

Explicit Credential Mode

Use this only when the task explicitly provides raw credentials instead of relying on saved accounts.

wechat-cli send \
  --bot-token <bot_token> \
  --user-id <user_id> \
  --context-token <token> \
  [--route-tag <route_tag>] \
  --text "hello"

Important Rules

  • The bot is bound to exactly one user_id.
  • Re-login for the same WeChat user rotates the bound bot credentials.
  • The bot can only send messages to its currently bound user_id.
  • --context-token is always required for send.
  • --text and --file are mutually exclusive.
  • --caption only works with --file.
  • When neither --text nor --file is provided, stdin is read if it is a pipe or redirected file.
  • When --text is explicitly provided, stdin is ignored even if a pipe is present.

Local Storage

  • Storage root: ~/.config/wechat-cli/
  • Accounts file: ~/.config/wechat-cli/accounts.json

Help

Use built-in help before guessing flags:

wechat-cli --help
wechat-cli qrcode --help
wechat-cli qrcode-status --help
wechat-cli account --help
wechat-cli send --help
ライセンス全文を見る(MIT)
MIT License

Copyright (c) 2026 SystemX Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.