siyuan-sisyphus 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -6
- package/dist/cli.cjs +68 -52
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | [中文](./README_zh_CN.md)
|
|
4
4
|
|
|
5
|
-
> ⚠️ **Prerequisite: This CLI requires the `siyuan-plugins-mcp-sisyphus` plugin from this repo.** Install and enable the plugin in SiYuan first,
|
|
5
|
+
> ⚠️ **Prerequisite: This CLI requires the `siyuan-plugins-mcp-sisyphus` plugin from this repo.** Install and enable the plugin in SiYuan first, then open the plugin settings panel and configure permissions before running CLI tool commands. The CLI now checks this requirement and will fail fast if the plugin is missing or not initialized.
|
|
6
6
|
|
|
7
7
|
Direct command-line control for [SiYuan Note](https://b3log.org/siyuan). Think of it like `obsidian-cli` but for SiYuan — every MCP tool (block, document, notebook, av, search, tag, file, system, flashcard, mascot) is exposed as a subcommand you can call directly from a shell.
|
|
8
8
|
|
|
@@ -35,9 +35,10 @@ npx -p siyuan-sisyphus siyuan-sisyphus --help
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
siyuan-sisyphus init
|
|
38
|
-
# …answer the
|
|
38
|
+
# …answer the prompts (profile name + API URL + token). This writes ~/.siyuan-sisyphus/config.json (0600).
|
|
39
39
|
|
|
40
40
|
siyuan-sisyphus notebook list # verify connectivity
|
|
41
|
+
siyuan-sisyphus config list # see saved profiles
|
|
41
42
|
siyuan-sisyphus list # see all available tools
|
|
42
43
|
siyuan-sisyphus list block # see all actions for a tool
|
|
43
44
|
siyuan-sisyphus help block append
|
|
@@ -50,6 +51,7 @@ siyuan-sisyphus <tool> <action> [--flag value ...] Execute any MCP tool-action
|
|
|
50
51
|
siyuan-sisyphus list [tool] List tools or a tool's actions
|
|
51
52
|
siyuan-sisyphus help <tool> [action] Detailed help for a tool or action
|
|
52
53
|
siyuan-sisyphus init Interactive config setup
|
|
54
|
+
siyuan-sisyphus config list|get|set|use ... Manage saved SiYuan profiles
|
|
53
55
|
siyuan-sisyphus --help | -h Top-level help
|
|
54
56
|
siyuan-sisyphus --version | -v Print version
|
|
55
57
|
```
|
|
@@ -68,16 +70,28 @@ siyuan-sisyphus --version | -v Print version
|
|
|
68
70
|
| Flag | Purpose |
|
|
69
71
|
|---|---|
|
|
70
72
|
| `--config <file>` | Load config from `<file>` instead of `~/.siyuan-sisyphus/config.json` |
|
|
73
|
+
| `--profile <name>` | Use a saved profile for this invocation |
|
|
71
74
|
| `--url <url>` | Override SiYuan API URL |
|
|
72
75
|
| `--token <token>` | Override SiYuan API token |
|
|
73
76
|
| `--json` | Emit compact single-line JSON (for scripting with `jq`, etc.) |
|
|
74
77
|
| `--debug` | Include stack traces and ignored-flag warnings |
|
|
75
78
|
|
|
79
|
+
### Paging
|
|
80
|
+
|
|
81
|
+
Paginated results use the same `page` / `pageSize` contract as the MCP tools. In an interactive terminal, human-readable output shows the full current MCP page and lets you browse pages without switching to JSON:
|
|
82
|
+
|
|
83
|
+
- Press `Enter` or `n` for the next page.
|
|
84
|
+
- Press `p` for the previous page.
|
|
85
|
+
- Press `q`, `Esc`, or `Ctrl+C` to quit paging.
|
|
86
|
+
|
|
87
|
+
For pipes and scripts, keep pagination explicit with `--page`, `--page-size`, and `--json`.
|
|
88
|
+
|
|
76
89
|
## Examples
|
|
77
90
|
|
|
78
91
|
```bash
|
|
79
92
|
# Notebooks
|
|
80
93
|
siyuan-sisyphus notebook list
|
|
94
|
+
siyuan-sisyphus --profile work notebook list
|
|
81
95
|
siyuan-sisyphus notebook create --name "Work" --icon 1f4d4
|
|
82
96
|
|
|
83
97
|
# Documents
|
|
@@ -92,6 +106,7 @@ siyuan-sisyphus block get-kramdown --id 20240318xyz
|
|
|
92
106
|
|
|
93
107
|
# Search
|
|
94
108
|
siyuan-sisyphus search fulltext --query "TODO" --page-size 20
|
|
109
|
+
siyuan-sisyphus search fulltext --query "TODO" --page 2 --page-size 20
|
|
95
110
|
siyuan-sisyphus search query-sql --stmt "SELECT id, content FROM blocks WHERE type='h' LIMIT 5"
|
|
96
111
|
|
|
97
112
|
# Piping to jq
|
|
@@ -101,7 +116,7 @@ siyuan-sisyphus document search-docs --notebook <id> --query "proposal" --json |
|
|
|
101
116
|
|
|
102
117
|
## Configuration
|
|
103
118
|
|
|
104
|
-
Precedence:
|
|
119
|
+
Precedence: **`--url`/`--token` > `--profile` > environment variable > active config profile > default**.
|
|
105
120
|
|
|
106
121
|
### Environment variables
|
|
107
122
|
|
|
@@ -110,15 +125,36 @@ Precedence: **CLI flag > environment variable > config file > default**.
|
|
|
110
125
|
| `SIYUAN_API_URL` | SiYuan base URL (default `http://127.0.0.1:6806`) |
|
|
111
126
|
| `SIYUAN_TOKEN` | SiYuan API token |
|
|
112
127
|
|
|
128
|
+
### Profile commands
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
siyuan-sisyphus config list
|
|
132
|
+
siyuan-sisyphus config set work --url http://127.0.0.1:6807 --token <siyuan-token>
|
|
133
|
+
siyuan-sisyphus config use work
|
|
134
|
+
siyuan-sisyphus config get work
|
|
135
|
+
siyuan-sisyphus --profile default notebook list
|
|
136
|
+
```
|
|
137
|
+
|
|
113
138
|
### Config file shape (`~/.siyuan-sisyphus/config.json`)
|
|
114
139
|
|
|
115
140
|
```json
|
|
116
141
|
{
|
|
117
|
-
"
|
|
118
|
-
"
|
|
142
|
+
"currentProfile": "default",
|
|
143
|
+
"profiles": {
|
|
144
|
+
"default": {
|
|
145
|
+
"apiUrl": "http://127.0.0.1:6806",
|
|
146
|
+
"token": "<siyuan-token>"
|
|
147
|
+
},
|
|
148
|
+
"work": {
|
|
149
|
+
"apiUrl": "http://127.0.0.1:6807",
|
|
150
|
+
"token": "<siyuan-token>"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
119
153
|
}
|
|
120
154
|
```
|
|
121
155
|
|
|
156
|
+
Older single-endpoint files with top-level `apiUrl` and `token` are still read as the `default` profile.
|
|
157
|
+
|
|
122
158
|
## Relation to the SiYuan plugin
|
|
123
159
|
|
|
124
160
|
The CLI and the SiYuan plugin (`siyuan-plugins-mcp-sisyphus`) share the same tool-handler code under the hood, but the two entry points are independent:
|
|
@@ -128,7 +164,7 @@ The CLI and the SiYuan plugin (`siyuan-plugins-mcp-sisyphus`) share the same too
|
|
|
128
164
|
|
|
129
165
|
If you already used the older config path `~/.siyuan-mcp/config.json`, the CLI still reads it as a fallback until you create a new config under `~/.siyuan-sisyphus/config.json`.
|
|
130
166
|
|
|
131
|
-
|
|
167
|
+
The CLI respects the same plugin UI configuration as MCP clients: disabled tools/actions are hidden from `list`/`help` and cannot be executed. Notebook-level permissions are also enforced by reading the same `/data/storage/petal/...` configuration through the API.
|
|
132
168
|
|
|
133
169
|
## License
|
|
134
170
|
|