返回顶部
s

siyuan-agent

Interact with SiYuan notes via direct HTTP API. Use when reading, writing, searching, or managing SiYuan blocks, documents, notebooks, attributes, assets, or executing SQL queries.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 2.0.6
安全检测
已通过
99
下载量
0
收藏
概述
安装方式
版本历史

siyuan-agent

# siyuan-agent (Direct HTTP) Standalone CLI for [SiYuan](https://ld246.com/) — direct HTTP API access, no npm dependencies. ## Setup 1. Enable SiYuan API token: SiYuan → Settings → About → API token 2. Set the token: ```bash export SIYUAN_TOKEN=your_token_here export SIYUAN_BASE=http://127.0.0.1:6806 # optional, default shown ``` (Add these to your `~/.bashrc` or `~/.zshrc` to persist.) **You don't need to use the CLI yourself.** Just tell your agent to read this SKILL.md — it will use this tool automatically. ## Commands ### Read | Command | Description | |---|---| | `search query=<kw>` | Full-text search | | `searchByNotebook query=<kw> notebook=<id>` | Search in specific notebook | | `getDoc id=<blockID>` | Get document | | `getBlock id=<blockID>` | Get single block | | `getChildren id=<blockID>` | Get child blocks | | `backlinks id=<blockID>` | Find backlinks | | `outline id=<blockID>` | Get document outline | | `sql "SELECT ..."` | Execute SELECT-only SQL | | `exportMd id=<docID>` | Export doc to markdown | | `call path=/api/... '{}'` | Any API endpoint directly | ### Write (requires write=true) | Command | Description | |---|---| | `insertBlock parentID=<id> data="<content>" write=true` | Insert block | | `updateBlock id=<id> data="<content>" write=true` | Update block | | `deleteBlock id=<id> write=true` | Delete block | ## SQL Safety The `sql` command only allows SELECT statements. Non-SELECT queries are rejected with an error. ## Write Protection Write operations (`insertBlock`, `updateBlock`, `deleteBlock`) require `write=true`. The `call` command requires `write=true` for non-read paths (export, asset upload are treated as write paths). ## Hard-Blocked Paths These notebook operations are blocked and cannot be called: - `/api/notebook/createNotebook` - `/api/notebook/removeNotebook` - `/api/notebook/renameNotebook` - `/api/notebook/closeNotebook` - `/api/notebook/saveNotebookConf` ## Usage Examples ```bash # Search node siyuan.js search query=keyword # Read a block node siyuan.js getBlock id=20260321111240-o5xe15o # Get document node siyuan.js getDoc id=20260321111240-o5xe15o # Get child blocks node siyuan.js getChildren id=20260321111240-o5xe15o # SQL query node siyuan.js sql "SELECT id, type, content FROM blocks WHERE content LIKE '%keyword%' LIMIT 5" # Write operation node siyuan.js updateBlock id=20260321111240-o5xe15o data="New content" write=true # Direct API call node siyuan.js call path=/api/notebook/lsNotebooks '{}' ``` ## Files ``` siyuan.js — CLI entry point (native fetch, no deps) lib/api.js — HTTP API caller ```

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 siyuan-agent-1776107957 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 siyuan-agent-1776107957 技能

通过命令行安装

skillhub install siyuan-agent-1776107957

下载 Zip 包

⬇ 下载 siyuan-agent v2.0.6

文件大小: 4.49 KB | 发布时间: 2026-4-14 11:19

v2.0.6 最新 2026-4-14 11:19
- Added author field ("eloklam") to skill metadata.
- No functional or command changes; documentation improvement only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部