Skip to main content

Build

CLI Anything Siyuan

CLI-Anything

SiYuan (思源笔记) CLI — manage notebooks, documents, blocks, and search your knowledge base from the terminal.

  • New
  • v1.0.0
  • Reviewed Aug 18
  • No reviews yet

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.0

cli-anything-siyuan

CLI harness for SiYuan (思源笔记),
a local-first knowledge management and note-taking application.

This CLI connects to a running SiYuan kernel via its HTTP API
(http://127.0.0.1:6806) and provides structured access to notebooks,
documents, blocks, search, and export.

Prerequisites

  • SiYuan must be running (Settings → About shows the API token)
  • Python 3.10+
  • Install: pip install cli-anything-siyuan or pip install -e . from agent-harness/

Command Groups

notebook — Notebook management

Subcommand Description
list List all notebooks
create <name> Create a new notebook
rename <id> <name> Rename a notebook
remove <id> Delete a notebook
open <id> Open a notebook

doc — Document management

Subcommand Description
create <notebook> <path> [--md "content"] Create a document
list <notebook> [path] List documents
tree <notebook> [--path / --depth] Show doc tree
get <id> Get document path by ID
rename <id> <title> Rename a document
remove <id> Delete a document

block — Block operations

Subcommand Description
insert <data> [--previous / --parent] Insert a block
update <id> <data> Update a block
delete <id> Delete a block
get <id> Get block kramdown source
children <id> Get child blocks

Other commands

Command Description
sql <stmt> Execute SQL on the block database
search <query> Full-text search across blocks
export md <doc-id> Export document as Markdown
tag list List all tags
version Show SiYuan kernel version
status Show connection and session status
repl Start interactive REPL

Agent Guidance

  • Always use --json for machine-readable output
  • Power search: use sql "SELECT * FROM blocks WHERE content LIKE '%keyword%'" for SQL-level access
  • Document IDs look like 20210817205410-2kvfpfn (timestamp-based)
  • API token can be found in SiYuan Settings → About
  • Connection defaults: http://127.0.0.1:6806

Examples

bash
# List notebooks (JSON)
cli-anything-siyuan --json notebook list

# Create a document with Markdown (--md flag, watch shell escaping)
cli-anything-siyuan doc create nb1 /projects/new --md "## Title\n\nContent"

# Create a document — pipe Markdown via stdin (avoids shell escaping)
# PowerShell here-string (literal, no escaping needed):
@'
## Title
Content with `backticks` and (parentheses) and "quotes"
'@ | cli-anything-siyuan doc create nb1 /projects/new --md -

# Bash heredoc:
# cat <<'EOF' | cli-anything-siyuan doc create nb1 /projects/new --md -
# ## Title
# Content with `backticks` and (parentheses)
# EOF

# SQL search
cli-anything-siyuan sql "SELECT id, content FROM blocks WHERE content LIKE '%meeting%' LIMIT 5"

# Export
cli-anything-siyuan export md doc123

# Enter REPL
cli-anything-siyuan

Error Handling

  • Connection errors: check that SiYuan is running and the API token is correct
  • API errors: returned as {"code": N, "msg": "..."} — check the message field
  • Auth errors: verify the token in ~/.siyuan-cli.json or SIYUAN_TOKEN env var

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from CLI-Anything

View source →

Frequently asked questions about cli-anything-siyuan

What does the cli-anything-siyuan skill do?

SiYuan (思源笔记) CLI — manage notebooks, documents, blocks, and search your knowledge base from the terminal. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the cli-anything-siyuan skill?

Run `npx @skills-hub-ai/cli install cli-anything-siyuan` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/cli-anything-siyuan/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does cli-anything-siyuan work with?

cli-anything-siyuan runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the cli-anything-siyuan skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use cli-anything-siyuan after installing it?

In Claude Code, type `/cli-anything-siyuan` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the cli-anything-siyuan skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/cli-anything-siyuan)](https://skills-hub.ai/skills/cli-anything-siyuan)
HTML
<a href="https://skills-hub.ai/skills/cli-anything-siyuan"><img src="https://skills-hub.ai/api/badges/skill/cli-anything-siyuan" alt="Install on Skills Hub"></a>

More options in the badge docs.