Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

docs: add stdin pipe usage for block insert/update, tag list note

hitoc9d050a0f0f9
diff --git a/siyuan/agent-harness/SIYUAN.md b/siyuan/agent-harness/SIYUAN.md
index 8d3310140..0cc07d2cd 100644
--- a/siyuan/agent-harness/SIYUAN.md
+++ b/siyuan/agent-harness/SIYUAN.md
@@ -137,3 +137,23 @@ Since SiYuan has no headless CLI backend, the harness will:
The SiYuan instance must be running with the API server enabled (default: port 6806).
The API token can be found in Settings → About.
+
+## CLI Usage Notes
+
+### Block insert/update with multi-line content
+
+`block insert` and `block update` accept data via stdin pipe when the argument is `-` or omitted:
+
+```bash
+# Pipe multi-line content
+cat note.md | cli-anything-siyuan block insert --parent <block-id>
+
+# Explicit stdin marker
+echo "hello" | cli-anything-siyuan block update <block-id> -
+
+# Requires one of: --parent <id>, --previous <id>, --next <id>
+```
+
+### Tag list
+
+`tag list` sends `ignoreMaxListHint: true` to ensure all tags are returned regardless of `Conf.FileTree.MaxListCount`. Tag-heavy workspaces return the complete list.
diff --git a/siyuan/agent-harness/cli_anything/siyuan/README.md b/siyuan/agent-harness/cli_anything/siyuan/README.md
index 222826702..c06dcd94c 100644
--- a/siyuan/agent-harness/cli_anything/siyuan/README.md
+++ b/siyuan/agent-harness/cli_anything/siyuan/README.md
@@ -68,6 +68,12 @@ cli-anything-siyuan export md <doc-id>
# Show status
cli-anything-siyuan status
+
+# Insert a block (multi-line content via stdin)
+cat note.md | cli-anything-siyuan block insert --parent <block-id>
+
+# Update a block content via stdin
+echo "new content" | cli-anything-siyuan block update <block-id>
```
### REPL mode
@@ -108,8 +114,8 @@ siyuan ❯ quit
| `doc get <id>` | Get document path by ID |
| `doc rename <id> <title>` | Rename a document |
| `doc remove <id>` | Delete a document |
-| `block insert <data>` | Insert a block |
-| `block update <id> <data>` | Update a block |
+| `block insert <data>` | Insert a block (use `-` or omit for stdin pipe) |
+| `block update <id> <data>` | Update block content (use `-` or omit for stdin pipe) |
| `block delete <id>` | Delete a block |
| `block get <id>` | Get block kramdown source |
| `block children <id>` | Get child blocks |