Collector CLI MVP
PyPI 安装
pip install wecar-wechat-collector-cli
wecar-wechat-collector status
需要连接其他电脑上的采集器时,可临时指定地址:
wecar-wechat-collector --url http://192.168.1.20:18765 status
也可以复制并修改包内的 config/collector-cli.toml,再通过
--config 路径 指定自己的配置文件。
该目录是云端 Agent Skill 使用的独立命令行客户端。它只使用 Python 标准库,不依赖
wechat_mvp、OpenCV、OCR 或 SQLite,可以将整个 collector_cli/ 文件夹单独复制、
压缩并分发到其他电脑。
独立目录
collector_cli/
├─ config/
│ └─ collector-cli.toml API 地址、请求超时和默认查询条数
├─ __init__.py
├─ __main__.py
├─ cli.py
├─ client.py
├─ README.md
└─ API.md
需要 Python 3.11 或更高版本,不需要安装第三方依赖。
配置
编辑 collector_cli/config/collector-cli.toml:
[api]
base_url = "http://192.168.1.20:18765"
timeout_seconds = 5.0
[query]
default_conversations_limit = 100
default_next_limit = 30
default_history_limit = 50
base_url 必须填写采集机真实的局域网 IP。不要使用 0.0.0.0,它只能作为采集器
服务端监听地址。
使用
在包含 collector_cli/ 的父目录执行:
python -m collector_cli status
python -m collector_cli conversations --limit 100
python -m collector_cli conversations --updated-since 1786690000 --limit 100
python -m collector_cli next --limit 30
python -m collector_cli history --conversation-id 12 --limit 50
python -m collector_cli sender history --conversation-id 12 --sender-name 张三 --limit 50
python -m collector_cli collect retry --conversation-id 12
python -m collector_cli ack --conversation-id 12 --through-message-id 105 --decision replied
也支持直接执行目录:
python collector_cli status
conversations 列出已经存有历史消息的会话,并返回消息数、参与人数、最近消息/入库/采集时间和未确认数量。updated-since 按消息入库时间筛选。next 只读,不会推进游标;发送失败时不要调用 ack。ack 成功后,后续 next 只返回该会话中更新的消息。
默认接口、请求超时以及 conversations/next/history/sender history 默认条数来自目录内部的
config/collector-cli.toml。全局 --url、--timeout 和各命令的 --limit 可临时
覆盖配置;使用其他配置文件时传入 --config 路径。
从局域网其他电脑读取时,--url 必须填写采集机的真实局域网 IP,例如:
python -m collector_cli --url http://192.168.1.20:18765 status
不要使用 http://0.0.0.0:18765;0.0.0.0 只用于采集器监听全部网卡。
完整的 HTTP 路径、请求参数、消息字段、分页和消费游标语义见
API.md。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wecar_wechat_collector_cli-0.2.0.tar.gz.
File metadata
- Download URL: wecar_wechat_collector_cli-0.2.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
481f182f97a2a245f8ad103e72c28aec5d5689c79b445561a10db0406aaa4bbb
|
|
| MD5 |
dd18b2b843b0bdc79b5e5f8f447784e8
|
|
| BLAKE2b-256 |
37e0ff6505241562f319e362130a26d4f76022e4ab6287a1311cb7262cb50ad7
|
File details
Details for the file wecar_wechat_collector_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: wecar_wechat_collector_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add843399f9d6cd4f23717fb158449ec15e29eef12c879f36ac5e0a3ecf6e7d4
|
|
| MD5 |
c29f7e7e3af2037bbd61323c4d6668c6
|
|
| BLAKE2b-256 |
0d6433e801a22f9921a431dec106221962e593cb5fb44ef629ba349bd1840931
|