siyuan-sisyphus 0.1.0 → 0.1.2
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 +2 -0
- package/dist/cli.cjs +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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, and configure permissions in the plugin settings panel, before the CLI can work.
|
|
6
|
+
|
|
5
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.
|
|
6
8
|
|
|
7
9
|
The published npm package is `siyuan-sisyphus`. It installs the primary command `siyuan-sisyphus`, and also provides the shorter alias `siyuan`.
|
package/dist/cli.cjs
CHANGED
|
@@ -129,5 +129,5 @@ ${d}`);const p=kf(e,o,r);return p.length>0&&u.push(p.join(" ")),u.join(`
|
|
|
129
129
|
`);const n=await o.ask("SiYuan API URL [http://127.0.0.1:6806]: ")||"http://127.0.0.1:6806",r=await o.ask("SiYuan API token (find it in SiYuan > Settings > About): "),s={apiUrl:n,token:r},i=Xt.dirname(t);ue.existsSync(i)||ue.mkdirSync(i,{recursive:!0,mode:448}),ue.writeFileSync(t,JSON.stringify(s,null,2)+`
|
|
130
130
|
`,{mode:384}),process.stdout.write(`
|
|
131
131
|
`),te("success","Config written."),$t([{key:"path",value:t},{key:"apiUrl",value:n},{key:"token",value:r?"configured":"empty"}]),process.stdout.write(`
|
|
132
|
-
`),ce("Next","Run `siyuan-sisyphus notebook list` to verify the connection. (`siyuan` also works.)")}finally{o.close()}}function Jk(e){const t=process.stdout,o=e.tool?Po(e.tool):null;return o?(tt(`${o} actions`,t),ee(Ee[o].map(n=>{const r=He(o,n)==="basic"?"common":"advanced",s=Ne(o,n)?" · confirmation required":"";return`${n} — ${r}${s}`}),t),G("Next Step",t),ce("Tip",`Run \`${N} help ${o} <action>\` for fields and examples.`,t),0):(e.tool&&we(`Unknown tool "${e.tool}". Showing all tools instead.`),tt("SiYuan tools",t),ee(qe.map(n=>{const r=Ee[n],s=r.filter(a=>He(n,a)==="basic").length,i=r.length-s;return`${n} — ${r.length} actions (${s} common, ${i} advanced)`}),t),G("Next Step",t),ce("Tip",`Run \`${N} list <tool>\` to see a tool’s actions.`,t),0)}async function Kk(e){const t=e.tool;if(!t)return we(`Missing tool. Usage: ${N} help <tool> [action]`),2;const o=Po(t);if(!o)return we(`Unknown tool "${t}". Available: ${qe.join(", ")}.`),2;const n=Ds(e.configPath),r=Ss(n,e.url,e.token);As(r);const s=new $n({baseUrl:r.apiUrl});r.token&&s.setToken(r.token);const i=new zn(s),a=Qk(),c=To[o],u={action:"help"};e.action&&(u.topic=e.action);try{const d=await c.callTool(s,u,a[o],i);return Ns(d,{json:e.json,debug:e.debug})}catch(d){return we(d,{debug:e.debug}),1}}function Qk(){const e=En();for(const t of qe){const o=Ee[t],n=e[t].actions;for(const r of o)n[r]=!0}return e}async function Xk(){let e;try{e=Ls(process.argv.slice(2))}catch(t){return we(t),2}switch(e.command){case"show-help":return process.stdout.write(Vs()),0;case"version":return process.stdout.write(`0.1.
|
|
132
|
+
`),ce("Next","Run `siyuan-sisyphus notebook list` to verify the connection. (`siyuan` also works.)")}finally{o.close()}}function Jk(e){const t=process.stdout,o=e.tool?Po(e.tool):null;return o?(tt(`${o} actions`,t),ee(Ee[o].map(n=>{const r=He(o,n)==="basic"?"common":"advanced",s=Ne(o,n)?" · confirmation required":"";return`${n} — ${r}${s}`}),t),G("Next Step",t),ce("Tip",`Run \`${N} help ${o} <action>\` for fields and examples.`,t),0):(e.tool&&we(`Unknown tool "${e.tool}". Showing all tools instead.`),tt("SiYuan tools",t),ee(qe.map(n=>{const r=Ee[n],s=r.filter(a=>He(n,a)==="basic").length,i=r.length-s;return`${n} — ${r.length} actions (${s} common, ${i} advanced)`}),t),G("Next Step",t),ce("Tip",`Run \`${N} list <tool>\` to see a tool’s actions.`,t),0)}async function Kk(e){const t=e.tool;if(!t)return we(`Missing tool. Usage: ${N} help <tool> [action]`),2;const o=Po(t);if(!o)return we(`Unknown tool "${t}". Available: ${qe.join(", ")}.`),2;const n=Ds(e.configPath),r=Ss(n,e.url,e.token);As(r);const s=new $n({baseUrl:r.apiUrl});r.token&&s.setToken(r.token);const i=new zn(s),a=Qk(),c=To[o],u={action:"help"};e.action&&(u.topic=e.action);try{const d=await c.callTool(s,u,a[o],i);return Ns(d,{json:e.json,debug:e.debug})}catch(d){return we(d,{debug:e.debug}),1}}function Qk(){const e=En();for(const t of qe){const o=Ee[t],n=e[t].actions;for(const r of o)n[r]=!0}return e}async function Xk(){let e;try{e=Ls(process.argv.slice(2))}catch(t){return we(t),2}switch(e.command){case"show-help":return process.stdout.write(Vs()),0;case"version":return process.stdout.write(`0.1.2
|
|
133
133
|
`),0;case"init":return await Wk(e.configPath),0;case"list":return Jk(e);case"help":return await Kk(e);case"dispatch":return await Mk(e);default:throw new Error(`Unknown command: ${String(e.command)}`)}}Xk().then(e=>process.exit(e)).catch(e=>{we(e,{debug:process.env.SIYUAN_MCP_DEBUG==="1"}),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "siyuan-sisyphus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Direct command-line control for SiYuan Note. Call any SiYuan MCP tool as a subcommand: `siyuan-sisyphus block append --parent-id ... --data \"...\"`.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"siyuan-sisyphus": "./dist/cli.cjs",
|
|
@@ -25,10 +25,13 @@
|
|
|
25
25
|
"author": "Taihong Yang",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/yangtaihong59/siyuan-plugins-mcp-sisyphus.git"
|
|
28
|
+
"url": "git+https://github.com/yangtaihong59/siyuan-plugins-mcp-sisyphus.git"
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/yangtaihong59/siyuan-plugins-mcp-sisyphus#readme",
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/yangtaihong59/siyuan-plugins-mcp-sisyphus/issues"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"siyuan-sisyphus": "^0.1.0"
|
|
33
36
|
}
|
|
34
37
|
}
|