mp2rss-cli

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 1 Imported by: 0

README

Mp2rss-cli(微信公众号 + X / Twitter 订阅管理,统一转 RSS / JSON)

🚀 一行命令,把你关注的微信公众号和 X 账号变成 RSS,喂给你最熟悉的阅读器。

Mp2RSS 的官方命令行客户端 —— 在终端订阅 / 查询 微信公众号与 X 账号、列出已订阅源、拉历史文章 / 推文流 / 长文流,输出 table 或 JSON。AI Agent 友好(Claude Code / Cursor skills),可作为 Web 控制台的脚本化替代。

关于 Mp2RSS —— 把信任的信息源搬进熟悉的阅读器。公众号文章、X 推文 / 长文 → 标准 RSS 2.0 / Atom 1.0 / JSON Feed 1.1 / OPML 2.0,可同步到 Reeder、NetNewsWire、FreshRSS、Miniflux 等阅读器。

Keywords: wechat, weixin, 微信, 公众号, twitter, x, rss, atom, jsonfeed, opml, feed, subscription, 订阅, mp2rss.

Release Downloads npm npm downloads Go Report Card

安装

# 一键安装脚本(macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/areyoubugcoder/mp2rss-cli/main/scripts/install.sh | sh

# npm(Node ≥ 18,跨平台含 Windows)
pnpm add -g @mp2rss/cli

也可在 Releases 直接下载对应平台二进制,或 go install 从源码构建。完整安装/卸载说明见 文档站 · 安装

升级到最新版本:

mp2rss update           # 检查并升级
mp2rss update --check   # 只检查不升级

使用

登录
mp2rss auth login        # 浏览器 loopback 授权(推荐)
mp2rss auth login -k <feed-key>   # 直传 Feed Key(CI / 无头)
mp2rss auth login --no-browser    # SSH 远程:仅打印授权 URL
微信公众号
mp2rss mp subscribe https://mp.weixin.qq.com/s/xxxxxxxxxx   # 参数是任意一篇文章的 URL
mp2rss mp list                                              # 已订阅公众号
mp2rss mp list -q 财经                                      # 模糊搜索已订阅源
mp2rss mp articles <mpId>                                   # 该公众号历史文章
mp2rss mp remove <mpId>                                     # 取消订阅

⚠️ 订阅公众号时传入的是 文章 URLhttps://mp.weixin.qq.com/s/...),不是公众号名字。

X(Twitter)
mp2rss x list                       # 已订阅 X 账号
mp2rss x posts <xUserId>            # 推文流
mp2rss x articles <xUserId>         # 长文流

X 的搜索 / 订阅 / 取消订阅请在 Web 控制台 完成,CLI 仅暴露读类操作。

脚本化
mp2rss mp list -o json | jq '.items[].mpName'   # 所有命令支持 -o json

📖 完整命令参考(全部 flag、JSON schema、错误码、配置文件、全局参数)→ 在线文档 · CLI

快捷入口: 安装 · 登录 · 命令总览 · FAQ

AI Agent 如何使用

Mp2rss 以两种形态提供 agent skills,同仓库维护、内容同步:

Claude Code / Cursor(skills/ 目录,按域拆分)

  • mp2rss-auth —— 登录态管理(login / logout / status)
  • mp2rss-mp —— 公众号订阅与文章查询
  • mp2rss-x —— X 账号已订阅列表、推文流与长文流(只读 3 件套;订阅 / 取消订阅 / 搜索请到 Web 控制台)

OpenClaw(openclaw/mp2rss/ 目录,单入口路由 + references 子文档)

  • 发布在 ClawHub,slug mp2rssopenclaw skills install mp2rss(或 clawhub install mp2rss

完整安装与使用步骤见 AI Agent 安装指南

快速安装
# 1. 装 CLI(Node ≥ 18)
pnpm add -g @mp2rss/cli

# 2. 装 Skills,任选其一
mp2rss skills sync --global                             # CLI ≥ 1.2.0 内置,之后 mp2rss update 会顺带同步
npx skills add areyoubugcoder/mp2rss-cli -y -g          # Claude Code / Cursor 通用,一次装齐三个 skill
/plugin marketplace add areyoubugcoder/mp2rss-cli       # Claude Code 内置 plugin marketplace
/plugin install mp2rss-cli@mp2rss

# 3. 登录
mp2rss auth login
使用举例(自然语言驱动)
  • 「登录公众号 RSS 服务」/「我的 Feed Key 是什么」→ mp2rss-auth
  • 「订阅这个公众号 https://mp.weixin.qq.com/s/...」→ mp2rss mp subscribe
  • 「我订阅了哪些公众号」/「搜一下我订阅的财经类公众号」→ mp2rss mp list / search
  • 「<公众号名> 最近发了什么」→ mp2rss mp articles
  • 「取消订阅 <公众号名>」→ mp2rss mp remove

所有命令支持 -o json,Agent 可直接解析结构化输出做后续处理。

License

MIT

Documentation

Overview

mp2rss-cli is the command-line client for mp2rss.bugcode.dev.

Directories

Path Synopsis
cmd
Package cmd wires the cobra command tree for mp2rss CLI.
Package cmd wires the cobra command tree for mp2rss CLI.
auth
Package auth implements `mp2rss auth ...` subcommands.
Package auth implements `mp2rss auth ...` subcommands.
mp
Package mp implements `mp2rss mp ...` subcommands.
Package mp implements `mp2rss mp ...` subcommands.
skills
Package skills implements the `mp2rss skills` command group: sync the repo's Agent Skills to the local agent config, show sync status, and list the official skills.
Package skills implements the `mp2rss skills` command group: sync the repo's Agent Skills to the local agent config, show sync status, and list the official skills.
update
Package update implements `mp2rss update` self-updating the installed binary.
Package update implements `mp2rss update` self-updating the installed binary.
x
Package x implements `mp2rss x ...` subcommands for X (Twitter) sources.
Package x implements `mp2rss x ...` subcommands for X (Twitter) sources.
internal
authflow
Package authflow implements the OAuth Loopback flow used by `mp2rss auth login`.
Package authflow implements the OAuth Loopback flow used by `mp2rss auth login`.
browser
Package browser opens URLs in the user's default browser, best-effort.
Package browser opens URLs in the user's default browser, best-effort.
client
Package client is a thin HTTP wrapper around the mp2rss Open API.
Package client is a thin HTTP wrapper around the mp2rss Open API.
cliopts
Package cliopts exposes the shared command dependency surface.
Package cliopts exposes the shared command dependency surface.
config
Package config persists CLI configuration to ~/.mp2rss/config.json.
Package config persists CLI configuration to ~/.mp2rss/config.json.
errs
Package errs defines exit-code-aware typed errors for the CLI.
Package errs defines exit-code-aware typed errors for the CLI.
output
Package output renders command results as table or JSON.
Package output renders command results as table or JSON.
prompt
Package prompt provides interactive terminal input helpers.
Package prompt provides interactive terminal input helpers.
skills
Package skills syncs the repo's Agent Skills to the local agent config.
Package skills syncs the repo's Agent Skills to the local agent config.
version
Package version holds the CLI version, injected at build time via ldflags.
Package version holds the CLI version, injected at build time via ldflags.
test
mock-api command
Package main implements a minimal in-memory mock of the mp2rss Open API.
Package main implements a minimal in-memory mock of the mp2rss Open API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL