siyuan-notes by 2234839/siyuan-notes-skill
npx skills add https://github.com/2234839/siyuan-notes-skill --skill siyuan-notes# 全文搜索(推荐,支持中文分词,返回格式化字符串)
node -e "const s = require('./index.js'); (async () => { console.log(await s.searchNotes('关键词', 20)); })();"
# 按类型搜索(只搜索标题)
node -e "const s = require('./index.js'); (async () => { console.log(await s.searchNotes('关键词', 10, 'h')); })();"
# 翻页(第2页)
node -e "const s = require('./index.js'); (async () => { console.log(await s.searchNotes('关键词', 20, null, 2)); })();"
返回格式:
单条结果 :📄 [文档ID] /路径 > [类型 块ID] 内容
多条结果 :
📄 [文档ID] /路径
1. [类型 块ID] 内容
2. [类型 块ID] 内容
内容预览 :最多显示 150 字符,超出会显示 ...
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 获取指定块的内容(返回 kramdown 源码,文档块包含反向链接)
node -e "const s = require('./index.js'); (async () => { console.log(await s.getBlockByID('块ID')); })();"
# 获取资源文件(图片、附件等)的本地完整路径
node -e "const s = require('./index.js'); (async () => {
const path = await s.getLocalAssetPath('块ID', 'assets/image-xxx.webp');
console.log(path);
})();"
返回示例:
/home/gs/.claude/skills/siyuan-notes/.tmp/assets/image-20251223152400-195ojeh.webp
使用场景:
# 提取指定块中所有的资源文件路径
node -e "const s = require('./index.js'); (async () => {
const assets = await s.extractAssetsFromBlock('块ID');
console.log(assets);
})();"
返回格式:
[
{
"path": "assets/image-20251223151651-8wilav6.webp",
"type": "image"
}
]
# SQL查询(返回精简后的原始数据数组)
node -e "const s = require('./index.js'); (async () => { console.log(await s.executeSiyuanQuery('SELECT * FROM blocks WHERE content LIKE \\\"%关键词%\\\" LIMIT 10')); })();"
h-标题 p-段落 d-文档 l-列表 c-代码 t-表格 b-引用
不要使用 cwd 参数、不要创建临时文件、不要使用 cd 命令
持续尝试,直到解决用户问题:
| 用户查询 | 可尝试的关键词 |
|---|---|
| 图片压缩 | 压缩、优化、减小、webp、图片处理 |
| 工作总结 | 总结、周报、月报、汇报、复盘 |
| bug修复 | bug、修复、问题、issue、调试 |
| 学习笔记 | 学习、笔记、记录、整理、心得 |
id: 块ID | type: 块类型(d/h/p/l/c/t/b) | subtype: 子类型content: 纯文本 | markdown: Markdown文本 | hpath: 人类可读路径created/updated: 创建/更新时间 (YYYYMMDDHHmmss)root_id: 所属文档ID | parent_id: 父块ID | box: 笔记本ID-- 查询段落块
SELECT * FROM blocks WHERE type='p' AND content LIKE '%关键词%'
-- 组合查询(多个关键词)
SELECT * FROM blocks WHERE content LIKE '%关键词1%' OR content LIKE '%关键词2%'
-- 查询最近7天
SELECT * FROM blocks WHERE updated > strftime('%Y%m%d%H%M%S', datetime('now', '-7 day'))
-- 查询反向链接
SELECT * FROM blocks WHERE id IN (SELECT block_id FROM refs WHERE def_block_id='块ID')
Weekly Installs
1
Repository
GitHub Stars
47
First Seen
1 day ago
Security Audits
Installed on
amp1
cline1
openclaw1
opencode1
cursor1
kimi-cli1
# 全文搜索(推荐,支持中文分词,返回格式化字符串)
node -e "const s = require('./index.js'); (async () => { console.log(await s.searchNotes('关键词', 20)); })();"
# 按类型搜索(只搜索标题)
node -e "const s = require('./index.js'); (async () => { console.log(await s.searchNotes('关键词', 10, 'h')); })();"
# 翻页(第2页)
node -e "const s = require('./index.js'); (async () => { console.log(await s.searchNotes('关键词', 20, null, 2)); })();"
返回格式:
单条结果 :📄 [文档ID] /路径 > [类型 块ID] 内容
多条结果 :
📄 [文档ID] /路径
1. [类型 块ID] 内容
2. [类型 块ID] 内容
内容预览 :最多显示 150 字符,超出会显示 ...
# 获取指定块的内容(返回 kramdown 源码,文档块包含反向链接)
node -e "const s = require('./index.js'); (async () => { console.log(await s.getBlockByID('块ID')); })();"
# 获取资源文件(图片、附件等)的本地完整路径
node -e "const s = require('./index.js'); (async () => {
const path = await s.getLocalAssetPath('块ID', 'assets/image-xxx.webp');
console.log(path);
})();"
返回示例:
/home/gs/.claude/skills/siyuan-notes/.tmp/assets/image-20251223152400-195ojeh.webp
使用场景:
# 提取指定块中所有的资源文件路径
node -e "const s = require('./index.js'); (async () => {
const assets = await s.extractAssetsFromBlock('块ID');
console.log(assets);
})();"
返回格式:
[
{
"path": "assets/image-20251223151651-8wilav6.webp",
"type": "image"
}
]
# SQL查询(返回精简后的原始数据数组)
node -e "const s = require('./index.js'); (async () => { console.log(await s.executeSiyuanQuery('SELECT * FROM blocks WHERE content LIKE \\\"%关键词%\\\" LIMIT 10')); })();"
h-标题 p-段落 d-文档 l-列表 c-代码 t-表格 b-引用
不要使用 cwd 参数、不要创建临时文件、不要使用 cd 命令
持续尝试,直到解决用户问题:
| 用户查询 | 可尝试的关键词 |
|---|---|
| 图片压缩 | 压缩、优化、减小、webp、图片处理 |
| 工作总结 | 总结、周报、月报、汇报、复盘 |
| bug修复 | bug、修复、问题、issue、调试 |
| 学习笔记 | 学习、笔记、记录、整理、心得 |
id: 块ID | type: 块类型(d/h/p/l/c/t/b) | subtype: 子类型content: 纯文本 | markdown: Markdown文本 | hpath: 人类可读路径created/updated: 创建/更新时间 (YYYYMMDDHHmmss)root_id: 所属文档ID | parent_id: 父块ID | box: 笔记本ID-- 查询段落块
SELECT * FROM blocks WHERE type='p' AND content LIKE '%关键词%'
-- 组合查询(多个关键词)
SELECT * FROM blocks WHERE content LIKE '%关键词1%' OR content LIKE '%关键词2%'
-- 查询最近7天
SELECT * FROM blocks WHERE updated > strftime('%Y%m%d%H%M%S', datetime('now', '-7 day'))
-- 查询反向链接
SELECT * FROM blocks WHERE id IN (SELECT block_id FROM refs WHERE def_block_id='块ID')
Weekly Installs
1
Repository
GitHub Stars
47
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
amp1
cline1
openclaw1
opencode1
cursor1
kimi-cli1
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
29,800 周安装