Zsxq Sync — Documentation skill for Claude Code
知识星球(zsxq.com)到本地 markdown 的增量同步工具,Obsidian 友好,可作为 Claude Code skill 使用.
How to install Zsxq Sync
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open dueti/zsxq-sync and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Zsxq Sync does
知识星球(zsxq.com)到本地 markdown 的增量同步工具,Obsidian 友好,可作为 Claude Code skill 使用.
Alternatives in Documentation
- 会话管理(Session Manager)需求文档(PRD / Markdown) — 目标:对 Codex / Claude Code 的本地会话记录进行可视化管理,并提供“一键复制 / 一键终端恢复”能力 31.7k ★
- Repo Recap — Generate a structured recap of the repository state: open PRs, open issues, recent releases, and executive sum 11.9k ★
- Documentation Sync — Check if documentation matches the current code state 5.8k ★
README
zsxq-sync
把 [知识星球(zsxq.com)](https://wx.zsxq.com) 的帖子、评论、图片增量同步到本地 markdown 文件夹。Obsidian 友好。
也可作为 [Claude Code](https://docs.claude.com/claude-code) 的 skill 使用——把这个仓库 clone 到 `~/.claude/skills/zsxq-sync/`,模型遇到"抓一下星球 X 的新内容"会自动调用。
特性
- 增量同步:每个星球维护一个游标(最新一条的
create_time),下次只抓新内容 - 多星球:一个工具管多个星球,每个独立配置
- 完整内容:
- 图片下载到
_assets/,markdown 引用本地路径 - 评论分页拉全(>30 条也不丢)
- 专栏文章(article)抓 HTML 转 markdown,含内嵌图
- 文件附件(PDF/Excel 等)走签名 URL 下载到
_assets/files/
- 图片下载到
- 风控友好:
- 短重试(5/10/15s × 3 次)
- 三次连续风控后进入 30 分钟长冷却
- 最多两次长冷却后放弃,已抓内容已落盘
- 完整浏览器 header 模拟(X-Version 2.77.0、Origin、Referer、可注入 extra cookie)
- token 不进对话:通过 macOS keychain 或环境变量传入
- 零第三方依赖:纯 Python 标准库
安装
git clone https://github.com/dueti/zsxq-sync.git ~/code/zsxq-sync
ln -sf ~/code/zsxq-sync/zsxq-sync /usr/local/bin/zsxq-sync # 可选
依赖:Python 3.9+,无第三方包。
快速开始 · 浏览器面板(推荐)
zsxq-sync web
会自动打开 `http://127.0.0.1:8765`。在网页里:
- 点「+ 添加星球」
- 粘星球链接(
https://wx.zsxq.com/group/xxx) - 起个显示名、选输出目录(建议指向你 Obsidian 库内)
- 粘 token(登录 wx.zsxq.com 后从浏览器 Cookie 里复制
zsxq_access_token) - 提交 → 点「增量同步」就开始抓
token 立即写入 macOS keychain,server 内存不留,不上传。 面板只 bind 127.0.0.1,外网访问不到。
命令行使用
1. 拿到 token
浏览器登录 https://wx.zsxq.com,开发者工具 → Application → Cookies → 复制 `zsxq_access_token` 的值。
2. 配置一个星球
zsxq-sync init "https://wx.zsxq.com/group/28512414455411"
会问你显示名和输出目录,写入 `~/.zsxq-sync/groups/
或非交互:
zsxq-sync init <链接> --non-interactive --name "孤独大脑" --output ~/Documents/zsxq-孤独大脑
3. 保存 token(macOS keychain)
security add-generic-password -s zsxq_sync_ -a $USER -w ''
非 macOS 直接用环境变量:
export ZSXQ_TOKEN=
4. 首次全量抓取
zsxq-sync sync --full
注意:星球内容多时会被风控拦在某一页(通常 ~40-50 页)。脚本会自动冷却+重试,最终保留已抓内容。补完 4-5 个长冷却(约 2 小时)后通常能完成全量。
5. 日常增量
zsxq-sync sync
游标之后的新帖才会抓。建议用 cron 每天跑一次:
0 9 * * * /usr/local/bin/
Related Skills
Obsidian Export
Export a clean structured snapshot of the vault that any agent or tool can consume — flat JSON or markdown ind
Phd Deepread Workflow
A professinal CLI workflow for PhD students to extract, analyze, and visualize academic papers into structured
Chro
Chro is basically Codex / Claude Code x Obsidian: a local-first markdown workspace with parallel agents, workt
Claude Vault
Encrypt Claude Code markdown files at rest. AES-256-GCM for CLAUDE.md, skills, memory, and Obsidian vaults.
Obsidian Notes CLI
CLI that writes structured Markdown notes generated by Claude Code into an Obsidian vault.
Commune Wiki
Own your canon. Dictate; job-split agent skills turn the dump into atomic, cross-linked markdown over a querya
Related Agents
Vault Structure Agent
Analyze any Markdown or Obsidian vault structure using manifest-first methods. Use for first-pass structure de
Local Writer
Use for high-token repetitive writing (docstrings, inline code comments, Markdown documentation, CHANGELOG/REA
Editor And Vault Curator
Curator for the editor-and-vault lane in Obsidian Plugin Brain. Use when maintaining source coverage, workflow