AgentStack
SKILL verified MIT Self-run

Siyuan Cli

skill-cicbyte-siyuan-cli-siyuan-cli · by cicbyte

操作思源笔记的 CLI 工具。当用户要求管理笔记本、文档、块、标签、搜索笔记、导入导出、管理资源、同步数据时使用此 skill。可执行路径下的 siyuan-cli.exe(或 go run .)。不包含 auth/chat/mcp 命令。

No reviews yet
0 installs
8 views
0.0% view→install

Install

$ agentstack add skill-cicbyte-siyuan-cli-siyuan-cli

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Siyuan Cli? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

siyuan-cli 使用指南

可执行文件:项目根目录 siyuan-cli.exe(开发时用 go run .) 全局选项:--format json 输出 JSON,--output/-o 导出到文件

前置条件

思源笔记实例需已运行且已通过 siyuan-cli auth login 配置连接。如连接失败,提示用户先执行 siyuan-cli auth login

笔记本

siyuan-cli notebook list                              # 列出所有笔记本
siyuan-cli notebook list --closed                     # 包含已关闭
siyuan-cli notebook create "名称"                      # 创建
siyuan-cli notebook rename  "新名"                  # 重命名
siyuan-cli notebook open                           # 打开
siyuan-cli notebook close                          # 关闭
siyuan-cli notebook delete  -F                     # 删除(-F 强制)
siyuan-cli notebook getconf                        # 获取配置
siyuan-cli notebook setconf  --sort 1              # 设置配置

`` 支持笔记本名称(模糊匹配)或笔记本 ID。

文档

siyuan-cli document list                           # 列出文档(depth=1)
siyuan-cli document list  --depth 0                # 全部展开
siyuan-cli document list  --path "/技术"           # 指定路径
siyuan-cli document get                  # 获取 Markdown 内容
siyuan-cli document get   -o output.md   # 导出到文件
siyuan-cli document outline                    # 大纲(支持 doc-id 或 nb/path)
siyuan-cli document createMd  --title "标题" --content "# 标题\n内容"
siyuan-cli document createMd  --file readme.md --path "/目录"
siyuan-cli document rename   "新名"
siyuan-cli document move                # 支持跨笔记本:nb2:/path
siyuan-cli document copy  
siyuan-cli document delete  
siyuan-cli document daily --notebook               # 创建今日日记
siyuan-cli document history                  # 查看历史
siyuan-cli document history --query "关键词"            # 搜索历史
siyuan-cli document rollback --notebook  --to   # 回滚

搜索与查询

siyuan-cli search doc "关键词"                          # 按标题搜索
siyuan-cli search block "关键词"                        # 全文搜索块内容
siyuan-cli search block "关键词" --notebook  -l 50  # 限定范围和数量
siyuan-cli query "SELECT id, content FROM blocks WHERE content LIKE '%关键词%'" -o result.json

SQL 仅限 SELECT。blocks 表常用字段:id, type, content, hpath, box, created, updated

siyuan-cli block get 
siyuan-cli block source                      # kramdown 源码
siyuan-cli block update  --content "新内容"
siyuan-cli block append  --content "## 新段落"   # 也支持 nb/path
siyuan-cli block delete  --force

block append--type 参数:markdown(默认)或 dom

标签

siyuan-cli tag list
siyuan-cli tag search "关键词"
siyuan-cli tag add  --tag "标签1" --tag "标签2"  # 支持 doc-id 或 nb/path
siyuan-cli tag remove  --tag "标签"

导入导出

siyuan-cli export doc  [path] --format html -o output.html
siyuan-cli export doc  [path] --format md
siyuan-cli export notebook  --format md -o ./backup/
siyuan-cli export notebook  --format sy -o ./backup/
siyuan-cli import md  --notebook  --path "目标路径"
siyuan-cli import sy  --notebook 

资源与同步

siyuan-cli asset upload 
siyuan-cli asset list  [path]
siyuan-cli asset unused                                # 未使用资源
siyuan-cli asset clean -F                              # 清理未使用资源
siyuan-cli sync status
siyuan-cli sync now

其他

siyuan-cli fav "收藏内容"                              # 收藏到"我的收藏"笔记本
siyuan-cli config list                                 # 查看配置
siyuan-cli config get                             # 获取配置项
siyuan-cli config set                      # 设置配置项
siyuan-cli version                                     # 版本信息

注意事项

  • 笔记本/文档路径支持名称模糊匹配和 ID 精确匹配
  • 文档路径用人类可读格式(如 java面试/AI/index),不用 .sy 后缀
  • --output/-o 自动使用 JSON 格式
  • --format json 为全局选项,放在命令前
  • 删除操作建议加 -F/--force 避免交互确认阻塞
  • document history --query 可搜索全局历史,不限定笔记本

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.