An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:memo: Improve CLI installation guide https://github.com/siyuan-note/siyuan/issues/18152
Daniel9552c7fb3a5e
diff --git a/README.md b/README.mdindex 4334d2ad42..9e5812999c 100644--- a/README.md+++ b/README.md@@ -404,19 +404,36 @@ siyuan export md --id <block-id> -w ~/SiYuanRun `siyuan --help` for the full command tree. Use `-f json` (default is `-f table`) for script-friendly output. Most mutating commands also support `--dry-run` to preview changes without applying them.-### Setup--The CLI binary is `SiYuan-Kernel` under `<install>/resources/kernel`.-Windows installer adds it to PATH automatically.-On macOS/Linux, create a symlink manually:--```bash-# macOS-ln -s /Applications/SiYuan.app/Contents/Resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan--# Linux-ln -s /path/to/SiYuan/resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan-```+### Installation++The CLI binary is `<install-dir>/resources/kernel/SiYuan-Kernel`, invoked via the `siyuan` command.++- **Windows**: the installer automatically adds the kernel directory to `PATH`, so `siyuan` works out of the box. The Microsoft Store edition runs in an MSIX sandbox and cannot modify `PATH`; deploy a `siyuan.cmd` shim once (survives Store updates):+ ```powershell+ # Microsoft Store edition only — run once in PowerShell+ $shimDir = "$env:LOCALAPPDATA\Microsoft\WindowsApps" # already in PATH by default+ @(+ '@echo off'+ 'setlocal'+ 'set "ROOT="'+ 'for /f "delims=" %%i in (''powershell -NoProfile -Command "(Get-AppxPackage *SiYuan*).InstallLocation"'') do set "ROOT=%%i"'+ 'if not defined ROOT goto :noshim'+ '"%ROOT%\app\resources\kernel\SiYuan-Kernel.exe" %*'+ 'exit /b %ERRORLEVEL%'+ ':noshim'+ '1>&2 echo siyuan: Microsoft Store edition not found'+ 'exit /b 1'+ ) | Set-Content "$shimDir\siyuan.cmd"+ ```+ To remove on uninstall: `Remove-Item "$env:LOCALAPPDATA\Microsoft\WindowsApps\siyuan.cmd"`.+- **macOS**: create a symlink after installing:+ ```bash+ ln -s /Applications/SiYuan.app/Contents/Resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan+ ```+- **Linux**: create a symlink after installing:+ ```bash+ ln -s <install-dir>/resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan+ ```## 🏘️ Communitydiff --git a/README.zh-CN.md b/README.zh-CN.mdindex 11cccfc6f9..6ef49bf3f3 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -505,19 +505,36 @@ siyuan export md --id <block-id> -w ~/SiYuan运行 `siyuan --help` 查看完整命令树。使用 `-f json`(默认 `-f table`)获得适合脚本处理的输出。大多数写命令还支持 `--dry-run`,可预览将要发生的改动而不实际执行。-### 设置--CLI 二进制为 `<安装目录>/resources/kernel/SiYuan-Kernel`。-Windows 安装程序自动将内核目录添加到 PATH。-macOS/Linux 下需要手动创建软链接:--```bash-# macOS-ln -s /Applications/SiYuan.app/Contents/Resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan--# Linux-ln -s /安装路径/SiYuan/resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan-```+### 安装++CLI 可执行文件为 `<安装目录>/resources/kernel/SiYuan-Kernel`,可通过 `siyuan` 命令调用。++- **Windows**:安装程序自动将内核目录加入 `PATH`,可直接使用 `siyuan`。微软商店版运行在 MSIX 沙箱中,无法自动修改 `PATH`;可部署一个 `siyuan.cmd` 转发器(一次性,商店版更新后依然有效):+ ```powershell+ # 仅适用于微软商店版 —— 在 PowerShell 中运行一次+ $shimDir = "$env:LOCALAPPDATA\Microsoft\WindowsApps" # 该目录默认已在 PATH 中+ @(+ '@echo off'+ 'setlocal'+ 'set "ROOT="'+ 'for /f "delims=" %%i in (''powershell -NoProfile -Command "(Get-AppxPackage *SiYuan*).InstallLocation"'') do set "ROOT=%%i"'+ 'if not defined ROOT goto :noshim'+ '"%ROOT%\app\resources\kernel\SiYuan-Kernel.exe" %*'+ 'exit /b %ERRORLEVEL%'+ ':noshim'+ '1>&2 echo siyuan: 未找到微软商店版'+ 'exit /b 1'+ ) | Set-Content "$shimDir\siyuan.cmd"+ ```+ 卸载商店版时如需清理:`Remove-Item "$env:LOCALAPPDATA\Microsoft\WindowsApps\siyuan.cmd"`。+- **macOS**:安装后创建软链接:+ ```bash+ ln -s /Applications/SiYuan.app/Contents/Resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan+ ```+- **Linux**:安装后创建软链接:+ ```bash+ ln -s <安装目录>/resources/kernel/SiYuan-Kernel /usr/local/bin/siyuan+ ```## 🏘️ 社区diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260612192252-sgw2paw.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260612192252-sgw2paw.syindex 7f5930dea4..7ebd9c9643 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260612192252-sgw2paw.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260612192252-sgw2paw.sy@@ -163,6 +163,74 @@{"Type": "NodeText","Data": " works out of the box"+ },+ {+ "Type": "NodeText",+ "Data": ". The Microsoft Store edition runs in an MSIX sandbox and cannot modify "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "PATH"+ },+ {+ "Type": "NodeText",+ "Data": "; deploy a "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "siyuan.cmd"+ },+ {+ "Type": "NodeText",+ "Data": " shim once (survives Store updates)"+ }+ ]+ },+ {+ "ID": "20260708120000-enstore1",+ "Type": "NodeCodeBlock",+ "IsFencedCodeBlock": true,+ "Properties": {+ "id": "20260708120000-enstore1",+ "updated": "20260708120000"+ },+ "Children": [+ {+ "Type": "NodeCodeBlockFenceOpenMarker",+ "Data": "```"+ },+ {+ "Type": "NodeCodeBlockFenceInfoMarker",+ "CodeBlockInfo": "cG93ZXJzaGVsbA=="+ },+ {+ "Type": "NodeCodeBlockCode",+ "Data": "# Microsoft Store edition only — run once in PowerShell\n$shimDir = \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\" # already in PATH by default\n@(\n '@echo off'\n 'setlocal'\n 'set \"ROOT=\"'\n 'for /f \"delims=\" %%i in (''powershell -NoProfile -Command \"(Get-AppxPackage *SiYuan*).InstallLocation\"'') do set \"ROOT=%%i\"'\n 'if not defined ROOT goto :noshim'\n '\"%ROOT%\\app\\resources\\kernel\\SiYuan-Kernel.exe\" %*'\n 'exit /b %ERRORLEVEL%'\n ':noshim'\n '1>&2 echo siyuan: Microsoft Store edition not found'\n 'exit /b 1'\n) | Set-Content \"$shimDir\\siyuan.cmd\"\n"+ },+ {+ "Type": "NodeCodeBlockFenceCloseMarker",+ "Data": "```"+ }+ ]+ },+ {+ "ID": "20260708130000-enuninst",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260708130000-enuninst",+ "updated": "20260708130000"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "To remove on uninstall: "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\\siyuan.cmd\""}]}@@ -12602,4 +12670,4 @@]}]-}+}\ No newline at end of filediff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260612191136-feqbi1x.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260612191136-feqbi1x.syindex f3ad7ccd05..5d95920aab 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260612191136-feqbi1x.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260612191136-feqbi1x.sy@@ -163,6 +163,74 @@{"Type": "NodeText","Data": ""+ },+ {+ "Type": "NodeText",+ "Data": "。微软商店版运行在 MSIX 沙箱中,无法自动修改 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "PATH"+ },+ {+ "Type": "NodeText",+ "Data": "。可部署一个 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "siyuan.cmd"+ },+ {+ "Type": "NodeText",+ "Data": " 转发器(一次性,商店版更新后依然有效)"+ }+ ]+ },+ {+ "ID": "20260708121000-cnstore1",+ "Type": "NodeCodeBlock",+ "IsFencedCodeBlock": true,+ "Properties": {+ "id": "20260708121000-cnstore1",+ "updated": "20260708121000"+ },+ "Children": [+ {+ "Type": "NodeCodeBlockFenceOpenMarker",+ "Data": "```"+ },+ {+ "Type": "NodeCodeBlockFenceInfoMarker",+ "CodeBlockInfo": "cG93ZXJzaGVsbA=="+ },+ {+ "Type": "NodeCodeBlockCode",+ "Data": "# 仅适用于微软商店版 —— 在 PowerShell 中运行一次\n$shimDir = \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\" # 该目录默认已在 PATH 中\n@(\n '@echo off'\n 'setlocal'\n 'set \"ROOT=\"'\n 'for /f \"delims=\" %%i in (''powershell -NoProfile -Command \"(Get-AppxPackage *SiYuan*).InstallLocation\"'') do set \"ROOT=%%i\"'\n 'if not defined ROOT goto :noshim'\n '\"%ROOT%\\app\\resources\\kernel\\SiYuan-Kernel.exe\" %*'\n 'exit /b %ERRORLEVEL%'\n ':noshim'\n '1>&2 echo siyuan: 未找到微软商店版'\n 'exit /b 1'\n) | Set-Content \"$shimDir\\siyuan.cmd\"\n"+ },+ {+ "Type": "NodeCodeBlockFenceCloseMarker",+ "Data": "```"+ }+ ]+ },+ {+ "ID": "20260708130000-cnuninst",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260708130000-cnuninst",+ "updated": "20260708130000"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "卸载商店版时如需清理:"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\\siyuan.cmd\""}]}@@ -12602,4 +12670,4 @@]}]-}+}\ No newline at end of filediff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260612191214-ymtlxn2.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260612191214-ymtlxn2.syindex 2eb3063a66..502f3d9d08 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260612191214-ymtlxn2.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260612191214-ymtlxn2.sy@@ -163,6 +163,74 @@{"Type": "NodeText","Data": ""+ },+ {+ "Type": "NodeText",+ "Data": "。Microsoft Store 版本執行於 MSIX 沙箱中,無法自動修改 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "PATH"+ },+ {+ "Type": "NodeText",+ "Data": "。可部署一個 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "siyuan.cmd"+ },+ {+ "Type": "NodeText",+ "Data": " 轉發器(一次性,商店版更新後依然有效)"+ }+ ]+ },+ {+ "ID": "20260708122000-twstore1",+ "Type": "NodeCodeBlock",+ "IsFencedCodeBlock": true,+ "Properties": {+ "id": "20260708122000-twstore1",+ "updated": "20260708122000"+ },+ "Children": [+ {+ "Type": "NodeCodeBlockFenceOpenMarker",+ "Data": "```"+ },+ {+ "Type": "NodeCodeBlockFenceInfoMarker",+ "CodeBlockInfo": "cG93ZXJzaGVsbA=="+ },+ {+ "Type": "NodeCodeBlockCode",+ "Data": "# 僅適用於 Microsoft Store 版 —— 在 PowerShell 中執行一次\n$shimDir = \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\" # 該目錄預設已在 PATH 中\n@(\n '@echo off'\n 'setlocal'\n 'set \"ROOT=\"'\n 'for /f \"delims=\" %%i in (''powershell -NoProfile -Command \"(Get-AppxPackage *SiYuan*).InstallLocation\"'') do set \"ROOT=%%i\"'\n 'if not defined ROOT goto :noshim'\n '\"%ROOT%\\app\\resources\\kernel\\SiYuan-Kernel.exe\" %*'\n 'exit /b %ERRORLEVEL%'\n ':noshim'\n '1>&2 echo siyuan: 找不到 Microsoft Store 版本'\n 'exit /b 1'\n) | Set-Content \"$shimDir\\siyuan.cmd\"\n"+ },+ {+ "Type": "NodeCodeBlockFenceCloseMarker",+ "Data": "```"+ }+ ]+ },+ {+ "ID": "20260708130000-twuninst",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260708130000-twuninst",+ "updated": "20260708130000"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "解除安裝商店版時如需清理:"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\\siyuan.cmd\""}]}@@ -12602,4 +12670,4 @@]}]-}+}\ No newline at end of filediff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260612192417-fb4ueux.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260612192417-fb4ueux.syindex cb467924af..fdb2f985bc 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260612192417-fb4ueux.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260612192417-fb4ueux.sy@@ -163,6 +163,74 @@{"Type": "NodeText","Data": " を使用できます"+ },+ {+ "Type": "NodeText",+ "Data": "。Microsoft Store 版は MSIX サンドボックスで実行されるため "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "PATH"+ },+ {+ "Type": "NodeText",+ "Data": " を自動的に変更できません。"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "siyuan.cmd"+ },+ {+ "Type": "NodeText",+ "Data": " シム(一回のデプロイでストア更新後も有効)を配置できます"+ }+ ]+ },+ {+ "ID": "20260708123000-jastore1",+ "Type": "NodeCodeBlock",+ "IsFencedCodeBlock": true,+ "Properties": {+ "id": "20260708123000-jastore1",+ "updated": "20260708123000"+ },+ "Children": [+ {+ "Type": "NodeCodeBlockFenceOpenMarker",+ "Data": "```"+ },+ {+ "Type": "NodeCodeBlockFenceInfoMarker",+ "CodeBlockInfo": "cG93ZXJzaGVsbA=="+ },+ {+ "Type": "NodeCodeBlockCode",+ "Data": "# Microsoft Store 版のみ — PowerShell で一度実行\n$shimDir = \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\" # デフォルトで PATH に含まれる\n@(\n '@echo off'\n 'setlocal'\n 'set \"ROOT=\"'\n 'for /f \"delims=\" %%i in (''powershell -NoProfile -Command \"(Get-AppxPackage *SiYuan*).InstallLocation\"'') do set \"ROOT=%%i\"'\n 'if not defined ROOT goto :noshim'\n '\"%ROOT%\\app\\resources\\kernel\\SiYuan-Kernel.exe\" %*'\n 'exit /b %ERRORLEVEL%'\n ':noshim'\n '1>&2 echo siyuan: Microsoft Store 版が見つかりません'\n 'exit /b 1'\n) | Set-Content \"$shimDir\\siyuan.cmd\"\n"+ },+ {+ "Type": "NodeCodeBlockFenceCloseMarker",+ "Data": "```"+ }+ ]+ },+ {+ "ID": "20260708130000-jauninst",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260708130000-jauninst",+ "updated": "20260708130000"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "アンインストール時に削除する場合: "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\\siyuan.cmd\""}]}@@ -12602,4 +12670,4 @@]}]-}+}\ No newline at end of file