siyuan

Manage SiYuan knowledge base blocks and documents via the kernel REST API using curl.

14|5|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MLT-OSS/hermes-agent-go --skill siyuan-mlt-oss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: siyuan
Source: https://github.com/MLT-OSS/hermes-agent-go/tree/main/optional-skills/productivity/siyuan
Command: npx skills add https://github.com/MLT-OSS/hermes-agent-go --skill siyuan-mlt-oss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It lets you search, read, create, update, and delete notes in a self-hosted SiYuan knowledge base directly from the command line, without installing any SDK or client library. ## Core Features & Use Cases - Full-Text and SQL Search: Query blocks across all notebooks using the full-text search endpoint or direct SQL SELECT statements against the blocks database. - Document and Block CRUD: Create notebooks and documents with Markdown, append or update blocks, rename documents, set custom attributes, and delete content. - Markdown Export: Export any document as Markdown for backup or migration. - Use Case: After a meeting, ask the agent to create a new document in your Meetings notebook with the discussion notes, then later search across all notebooks to find related action items. ## Quick Start Ask the agent to search your SiYuan knowledge base for notes about a topic and create a new document summarizing the results in a chosen notebook.

Frequently Asked Questions about siyuan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search notes in SiYuan from the command line?

Send a POST request to /api/search/fullTextSearchBlock with your query in the JSON body and your API token in the Authorization header. For finer control, use /api/query/sql with a SELECT statement against the blocks table.

How do I create a document in SiYuan via the API?

POST to /api/filetree/createDocWithMd with the notebook ID, target path, and Markdown content. The response returns the new document ID, which you can use for subsequent block operations.

Where do I find my SiYuan API token?

Open the SiYuan desktop app and go to Settings > About to find your API token. Store it as SIYUAN_TOKEN in your environment, and optionally set SIYUAN_URL if the instance is not at the default http://127.0.0.1:6806.

Can I run UPDATE or DELETE SQL queries against the SiYuan database?

No, only SELECT statements are safe through /api/query/sql. INSERT, UPDATE, DELETE, and DROP statements are dangerous and should never be sent; use the dedicated block and filetree endpoints for modifications.

Why does my SiYuan API request fail with a non-zero code?

Every SiYuan response includes a code field where 0 means success. A non-zero code indicates an error described in the msg field, commonly caused by an invalid token, malformed block ID, or wrong endpoint parameters.

Is there an alternative to using curl for SiYuan integration?

Yes, you can install the @porkll/siyuan-mcp server via npx and configure it as an MCP server with your SIYUAN_TOKEN and SIYUAN_URL, providing native tool integration instead of raw curl calls.