siyuan-api
Skill9 starsChanged 4 months agoMITView on GitHub
当用户要求"查询思源笔记"、"操作思源笔记"、"获取思源笔记内容"、"思源笔记 API"、"写笔记"、"往思源新增/修改笔记"、"同步记忆到思源"时使用此 skill。
- Reads credentials
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cmo-weather-query/CLAUDE.mdCLAUDE.md
- db_client/CLAUDE.mdCLAUDE.md
- deepseek-search/CLAUDE.mdCLAUDE.md
- documents_ripgrep/CLAUDE.mdCLAUDE.md
- excel-alasql/CLAUDE.mdCLAUDE.md
- game_mahjong_agent/CLAUDE.mdCLAUDE.md
- gaode_map/CLAUDE.mdCLAUDE.md
- magpie-image-gen/CLAUDE.mdCLAUDE.md
- ms_office_x_editer/CLAUDE.mdCLAUDE.md
- ssh2-node/CLAUDE.mdCLAUDE.md
- use_http_mcp/CLAUDE.mdCLAUDE.md
- where-am-i/CLAUDE.mdCLAUDE.md
- 88chaSkill
- agent-browserSkill
- baidu-search-nodejsSkill
- brz-repair-manual-querySkill
- cmo-weather-querySkill
- db-clientSkill
- deepseek-searchSkill
- dianping-searchSkill
- doc-readerSkill
- documents-ripgrepSkill
- drawio-nodejsSkill
- excel-alasqlSkill
- figma-code-connectSkill
- figma-create-design-system-rulesSkill
- figma-create-new-fileSkill
- figma-generate-designSkill
- figma-generate-librarySkill
- figma-implement-designSkill
- figma-useSkill
- file-code-boxSkill
- financialSkill
- game-mahjong-agentSkill
- gaode-mapSkill
- gitea-apiSkill
- happy-agent-easySkill
- hindsightSkill
- jina-readerSkill
- kavita-liteSkill
- magpie-image-genSkill
- magpie-toolsSkill
- makepad-evolutionSkill
- markitdown-pdfSkill
- memos-nodeSkill
- mind-map-skillSkill
- ms-office-x-editerSkill
- nexus3-skillSkill
- obsidian-basesSkill
- obsidian-cliSkill
- json-canvasSkill
- ocr-toolSkill
- opencode-go-usageSkill
- sendmailSkill
- smb-clientSkill
- ssh2-nodeSkill
- use-http-mcpSkill
- website-security-scanSkill
- where-am-iSkill
- The first 60 shown.
The file
Files
思源笔记 REST API 工具
通过 REST API 与思源笔记交互,支持笔记本、文档、块的增删改查、属性、SQL 查询、文件操作、导出,以及从 Memory MCP 同步实体。
快速开始
export SIYUAN_URL="http://127.0.0.1:6806"
export SIYUAN_API_TOKEN="your-token"
node skill.js notebook ls # 列笔记本
node skill.js sql "SELECT * FROM blocks WHERE type='d' LIMIT 10" # SQL 查询
node skill.js doc create --notebook <id> --path note "标题" "# 正文" # 建文档
node skill.js export md <doc-id> # 导出为 Markdown命令总表
| 对象 | 查询 | 写入 / 修改 |
notebook | ls / conf <id> | create <name> / open / close |
doc | hpath / hpath-by-id / path-by-id / ids-by-hpath | create / rename / remove |
block | kramdown <id> / children <id> | insert / prepend / append / update / delete / move |
attr | get <id> | set <id> '<json>' |
sql | <stmt> | — |
file | get <path> / ls <path> | — |
export | md <id> | — |
system | version / time / boot | — |
sync | — | <notebook-id> '<entity-json>'(Memory MCP → 思源) |
📖 详细用法、参数说明与完整案例:
- 📝 创建(建笔记本 / 文档 / 写块)→
examples/create.md- 🔍 查询(检索 / SQL / 导出)→
examples/query.md- ✏️ 修改(改 / 删 / 移动 / 属性 / 同步)→
examples/modify.md
选项
| 选项 | 说明 |
--format <type> | 输出格式(json / yaml / table / default);YAML 省 ~50% token |
--notebook <id> | 笔记本 ID(doc 命令) |
--path <path> | 路径(doc 命令) |
--title <t> | 文档标题(doc create / rename) |
--parentID / --nextID / --previousID | 块插入 / 移动锚点(大小写不敏感) |
认证与配置
访问需 API Token:思源笔记 > 设置 > 关于 > API Token,通过 Authorization: Token <token> 传递。
| 变量 | 说明 | 默认值 |
SIYUAN_URL | 服务地址 | http://127.0.0.1:6806 |
SIYUAN_API_TOKEN | API Token | 无 |
也可在同目录 .env 写入这两个变量。URL / Token 还可作为命令尾部位置参数临时覆盖。
命令别名
| 命令 | 别名 |
notebook | nb |
system | sys |
sql | query |
doc remove | rm / delete |
常见问题
- Token 怎么拿? 设置 > 关于 > API Token。
- 连接被拒? 确认思源已启动,默认监听
http://127.0.0.1:6806。 - 怎么查文档内容?
export md <id>导出 Markdown,或block kramdown <id>取源码,或sql直接查blocks表。 - 怎么写 / 改笔记? 见
examples/create.md与examples/modify.md。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

