xmind-cloud

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Xmind Cloud CLI

Xmind Cloud CLI

Setup

设置

bash
which xmind || npm install -g @xmindltd/xmind-cli
bash
which xmind || npm install -g @xmindltd/xmind-cli

Auth

身份验证

bash
xmind cloud auth status
If
{"authenticated":false}
:
bash
xmind cloud auth login
bash
xmind cloud auth status
如果返回
{"authenticated":false}
bash
xmind cloud auth login

→ Opens browser automatically, waits for authorization

→ 自动打开浏览器,等待授权

→ {"authenticated":true,"source":"config"}

→ {"authenticated":true,"source":"config"}


Alternative (if you already have a token):

```bash
xmind cloud auth token <value>

替代方式(若已有令牌):

```bash
xmind cloud auth token <value>

Session Rules

会话规则

  • Reuse sessions: before opening, check
    xmind cloud sessions
    . If the document already has an active session, reuse it.
  • Don't close after every edit: sessions persist and auto-close after 30 minutes of inactivity. Only close when the user is done or explicitly asks.
  • Daemon persists across sessions: closing a session doesn't kill the daemon. Next
    open
    is faster.
  • 复用会话:打开前先执行
    xmind cloud sessions
    检查。如果文档已有活跃会话,直接复用。
  • 编辑后不立即关闭:会话会保持,闲置30分钟后自动关闭。仅在用户完成操作或明确要求时关闭会话。
  • 守护进程跨会话持久化:关闭会话不会终止守护进程,下次执行
    open
    会更快。

Create

创建

Step 1: Discover

步骤1:发现可用技能

bash
xmind skill list
Review all available recipes, layout features, and editing helpers.
bash
xmind skill list
查看所有可用的模板、布局功能和编辑辅助工具。

Step 2: Load Skills + Execute

步骤2:加载技能并执行

Load a recipe and a feature strategy in one call:
bash
xmind skill show recipes/<name> features features/strategy/<name>
Then follow the loaded instructions:
  1. Phase 1 — Content: Follow recipe rules to plan content.
  2. Phase 2 — Render: Follow features + strategy rules to produce markdown, select skeleton and color. Substitute the execute command with cloud upload:
    bash
    cat <<'MD' | xmind cloud create --stdin --skeleton <name> --color <name>
    # Central Topic
    ## Branch
    ### Sub-branch
    MD
    Returns
    {"success":true,"fileId":"...","url":"https://app.xmind.com/<id>"}
    .
If a subtree needs a different strategy during Phase 2:
bash
xmind skill show features/strategy/<other>
一次性加载模板和功能策略:
bash
xmind skill show recipes/<name> features features/strategy/<name>
然后按照加载的说明操作:
  1. 阶段1 — 内容规划:遵循模板规则规划内容。
  2. 阶段2 — 渲染上传:遵循功能+策略规则生成Markdown,选择框架和配色。将执行命令替换为云端上传
    bash
    cat <<'MD' | xmind cloud create --stdin --skeleton <name> --color <name>
    # 中心主题
    ## 分支
    ### 子分支
    MD
    返回结果示例:
    {"success":true,"fileId":"...","url":"https://app.xmind.com/<id>"}
如果在阶段2中某子树需要不同策略:
bash
xmind skill show features/strategy/<other>

Edit

编辑

Connect (only if no active session)

连接会话(仅当无活跃会话时)

bash
xmind cloud sessions
bash
xmind cloud sessions

If empty or no session for this document:

如果会话为空或当前文档无对应会话:

xmind cloud open <link-or-fileId>
xmind cloud open <link-or-fileId>

→ {"session":"abc","fileId":"...","root":"..."}

→ {"session":"abc","fileId":"...","root":"..."}

undefined
undefined

Quick Edit

快速编辑

bash
xmind cloud read --session <id>
xmind cloud add --session <id> --parent <title> --topic <text>
xmind cloud update --session <id> --topic <old-title> --title <new-title>
xmind cloud delete --session <id> --topic <title>
cat <<'BATCH_EOF' | xmind cloud batch --session <id>
[{"op": "...", ...}]
BATCH_EOF
bash
xmind cloud read --session <id>
xmind cloud add --session <id> --parent <title> --topic <text>
xmind cloud update --session <id> --topic <old-title> --title <new-title>
xmind cloud delete --session <id> --topic <title>
cat <<'BATCH_EOF' | xmind cloud batch --session <id>
[{"op": "...", ...}]
BATCH_EOF

Guided Edit

引导式编辑

For complex edits (optimize, review, restructure, restyle), load the edit guide:
bash
xmind skill show editing/guide
Follow the guide's analysis template, then apply changes via
xmind cloud batch --session <id>
.
针对复杂编辑操作(优化、审阅、重构、重新设置样式),加载编辑指南:
bash
xmind skill show editing/guide
遵循指南的分析模板,然后通过
xmind cloud batch --session <id>
应用更改。

Upload Existing File

上传现有文件

bash
xmind cloud upload output.xmind
bash
xmind cloud upload output.xmind

Error Handling

错误处理

  • {"error":"token_expired"}
    → Token expired. Re-authenticate with
    xmind cloud auth login
    .
  • {"error":"Session not found"}
    → Re-open:
    xmind cloud open <link>
    .
  • {"error":"Authentication failed"}
    → Token invalid.
  • {"error":"exceed_files_limit"}
    → Cloud storage full.
  • {"error":"token_expired"}
    → 令牌过期。执行
    xmind cloud auth login
    重新验证身份。
  • {"error":"Session not found"}
    → 重新打开会话:
    xmind cloud open <link>
  • {"error":"Authentication failed"}
    → 令牌无效。
  • {"error":"exceed_files_limit"}
    → 云端存储空间已满。