Skip to main content
skill CX Codex

cli-anything-siyuan — Claude Code skill: what it does, how to install

The cli-anything-siyuan skill gives an agent CLI access to SiYuan for notebook, document, and block management, full-text search, SQL queries, and Markdown export.

Apache-2.0 255 installs ★ 62,125 updated 2026-09-22

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-siyuan -a claude-code
Open on GitHub

What cli-anything-siyuan does

The skill connects to a running SiYuan kernel over its HTTP API. Through the CLI, an agent can create, rename, open, and remove notebooks and documents, inspect document trees, edit blocks, search their contents, and export a document as Markdown. It also exposes tag listing, connection status, kernel version, SQL access, and an interactive REPL.

SiYuan must be running, and the API token is available in Settings → About. The CLI requires Python 3.10+ and can be installed with pip install cli-anything-siyuan or with pip install -e . from agent-harness/. Machine-readable responses use --json; authentication can read the token from ~/.siyuan-cli.json or SIYUAN_TOKEN.

The connection target is http://127.0.0.1:6806, so the CLI cannot connect until SiYuan is running with a valid token. SQL can search the blocks table directly. Markdown can also come through stdin when shell escaping would get in the way.

What it helps with

  • create a document inside a selected notebook
  • search blocks with text or SQL
  • rename or remove documents and blocks
  • export a document as Markdown
  • inspect the SiYuan connection and kernel version

Example prompts for the agent

  • Create a document in notebook nb1 at /projects/new from the Markdown in my message, and return JSON output.
  • Search the blocks table for meeting with SQL and show the first matching rows.
  • Check the SiYuan connection status, then export document doc123 as Markdown.

How to install cli-anything-siyuan

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-siyuan -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-siyuan/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-siyuan/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-anything-siyuan

How do I install cli-anything-siyuan in Claude Code?

Run npx skills add HKUDS/CLI-Anything --skill cli-anything-siyuan -a claude-code, then check ~/.claude/skills/cli-anything-siyuan/SKILL.md.

What does cli-anything-siyuan do?

It gives an agent terminal access to SiYuan notebooks, documents, and blocks. The CLI also supports content search, SQL, Markdown export, tags, status, and an interactive REPL.

What does cli-anything-siyuan need to run?

SiYuan must be running, with an API token from Settings → About. Python 3.10+ is required, and authentication can use ~/.siyuan-cli.json or SIYUAN_TOKEN.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-siyuan"
description: SiYuan (思源笔记) CLI — manage notebooks, documents, blocks, and search your knowledge base from the terminal.
---

# cli-anything-siyuan

CLI harness for [SiYuan](https://github.com/siyuan-note/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

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

Similar skills

All skills for Notes, tasks and projects →

From the same set69

The whole set →
cli-anything-joplin cli-anything-joplin is a Claude Code skill that manages Joplin notes, notebooks, to-dos and tags through the terminal backend. The agent exports data and syncs the project without opening the GUI. CX Codex +1 299installs cli-anything-ccswitch The cli-anything-ccswitch skill gives an agent terminal access to CC Switch settings, including providers, proxy state, MCP servers, skills, sessions, and usage data. CX Codex +1 272installs cli-anything-eez-studio cli-anything-eez-studio is a Claude Code skill that gives agents CLI access to EEZ Studio for editing .eez-project files, placing LVGL widgets, and building SCPI command trees. CX Codex +1 266installs cli-anything-wavetone cli-anything-wavetone prepares JSON manifests and opens WaveTone 2.61 for audio transcription. Built for agents handling tempo settings, labels, and audio checks on Windows. CX Codex +1 265installs cli-anything-jumpserver The cli-anything-jumpserver skill gives agents a CLI for JumpServer administration through its REST API, including assets, users, permissions, accounts, sessions, and audit data. CX Codex +1 258installs cli-anything-web-yu-pri cli-anything-web-yu-pri fills Japan Post Web Yu-pri declaration forms from a CLI by driving a Playwright browser. Useful when you ship parcels through Japan Post and need to enter dozens of item lines from CSV or JSON. CX Codex +1 255installs cli-anything-tigris cli-anything-tigris is a Claude Code skill that gives AI agents Tigris CLI commands for managing object storage, including buckets, snapshots, and access keys. CX Codex +1 252installs cli-anything-openrefine cli-anything-openrefine controls OpenRefine through an agent CLI to import messy datasets, apply JSON transformations, and export cleaned CSV or TSV files. CX Codex +1 249installs

Project sponsors

Companies that keep this analytics open