cli-anything-mubu

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cli-anything-mubu

cli-anything-mubu

Canonical packaged entrypoint for the Mubu live bridge.
Mubu实时桥接的标准打包入口点。

Installation

安装

This CLI is packaged from the canonical
agent-harness
source tree:
bash
pip install -e .
Prerequisites:
  • Python 3.10+
  • An active Mubu desktop session on this machine
  • Local Mubu profile data available to the CLI
  • Set
    MUBU_DAILY_FOLDER
    if you want no-argument daily helpers
此CLI由标准的
agent-harness
源码树打包而来:
bash
pip install -e .
前置要求:
  • Python 3.10+
  • 本机上有活跃的Mubu桌面会话
  • CLI可访问本地Mubu配置文件数据
  • 若要使用无参数日常助手,请设置
    MUBU_DAILY_FOLDER
    环境变量

Entry Points

入口点

bash
cli-anything-mubu
python -m cli_anything.mubu
When invoked without a subcommand, the CLI enters an interactive REPL session.
bash
cli-anything-mubu
python -m cli_anything.mubu
当不带子命令调用时,CLI会进入交互式REPL会话。

Command Groups

命令组

Discover

发现

Discovery commands for folders, documents, recency, and daily-document resolution.
CommandDescription
|
docs
| List latest known document snapshots from local backups. |
|
folders
| List folder metadata from local RxDB storage. |
|
folder-docs
| List document metadata for one folder. |
|
path-docs
| List documents for one folder path or folder id. |
|
recent
| List recently active documents using backups, metadata, and sync logs. |
|
daily
| Find Daily-style folders and list the documents inside them. |
|
daily-current
| Resolve the current daily document from one Daily-style folder. |
用于文件夹、文档、最近记录及日常文档解析的发现类命令。
命令描述
|
docs
| 列出本地备份中最新的已知文档快照。 |
|
folders
| 列出本地RxDB存储中的文件夹元数据。 |
|
folder-docs
| 列出单个文件夹下的文档元数据。 |
|
path-docs
| 根据文件夹路径或文件夹ID列出文档。 |
|
recent
| 通过备份、元数据和同步日志列出最近活跃的文档。 |
|
daily
| 查找日常风格文件夹并列出其中的文档。 |
|
daily-current
| 从某个日常风格文件夹中解析当前的日常文档。 |

Inspect

查看

Inspection commands for tree views, search, links, sync events, and live node targeting.
CommandDescription
|
show
| Show the latest backup tree for one document. |
|
search
| Search latest backups for matching node text or note content. |
|
changes
| Parse recent client-sync change events from local logs. |
|
links
| Extract outbound Mubu document links from one document backup. |
|
open-path
| Open one document by full path, suffix path, title, or doc id. |
|
doc-nodes
| List live document nodes with node ids and update-target paths. |
|
daily-nodes
| List live nodes from the current daily document in one step. |
用于树形视图、搜索、链接、同步事件及实时节点定位的查看类命令。
命令描述
|
show
| 显示单个文档的最新备份树形结构。 |
|
search
| 在最新备份中搜索匹配的节点文本或笔记内容。 |
|
changes
| 从本地日志中解析最近的客户端同步变更事件。 |
|
links
| 从单个文档备份中提取外部Mubu文档链接。 |
|
open-path
| 通过完整路径、后缀路径、标题或文档ID打开单个文档。 |
|
doc-nodes
| 列出带节点ID和更新目标路径的实时文档节点。 |
|
daily-nodes
| 一步列出当前日常文档中的实时节点。 |

Mutate

修改

Mutation commands for dry-run-first atomic live edits against the Mubu API.
CommandDescription
|
create-child
| Build or execute one child-node creation against the live Mubu API. |
|
delete-node
| Build or execute one node deletion against the live Mubu API. |
|
update-text
| Build or execute one text update against the live Mubu API. |
针对Mubu API执行预演优先的原子实时编辑的修改类命令。
命令描述
|
create-child
| 构建或执行针对实时Mubu API的子节点创建操作。 |
|
delete-node
| 构建或执行针对实时Mubu API的节点删除操作。 |
|
update-text
| 构建或执行针对实时Mubu API的文本更新操作。 |

Session

会话

Session and state commands for current document/node context and local command history.
CommandDescription
|
status
| Show the current session state. |
|
state-path
| Show the session state file path. |
|
use-doc
| Persist the current document reference. |
|
use-node
| Persist the current node reference. |
|
use-daily
| Resolve and persist the current daily document reference. |
|
clear-doc
| Clear the current document reference. |
|
clear-node
| Clear the current node reference. |
|
history
| Show recent command history stored in session state. |
用于当前文档/节点上下文及本地命令历史的会话与状态类命令。
命令描述
|
status
| 显示当前会话状态。 |
|
state-path
| 显示会话状态文件路径。 |
|
use-doc
| 持久化当前文档引用。 |
|
use-node
| 持久化当前节点引用。 |
|
use-daily
| 解析并持久化当前日常文档引用。 |
|
clear-doc
| 清除当前文档引用。 |
|
clear-node
| 清除当前节点引用。 |
|
history
| 显示会话状态中存储的最近命令历史。 |

Recommended Agent Workflow

推荐的Agent工作流

text
discover daily-current '<daily-folder-ref>' --json
        ->
inspect daily-nodes '<daily-folder-ref>' --query '<anchor>' --json
        ->
session use-doc '<doc_path>'
        ->
mutate update-text / create-child / delete-node --json
        ->
--execute only after payload inspection
text
discover daily-current '<daily-folder-ref>' --json
        ->
inspect daily-nodes '<daily-folder-ref>' --query '<anchor>' --json
        ->
session use-doc '<doc_path>'
        ->
mutate update-text / create-child / delete-node --json
        ->
--execute only after payload inspection

Safety Rules

安全规则

  1. Prefer grouped commands for agent use; flat legacy commands remain for compatibility.
  2. Use
    --json
    whenever an agent will parse the output.
  3. Prefer
    discover
    or
    inspect
    commands before any
    mutate
    command.
  4. Live mutations are dry-run by default and only execute with
    --execute
    .
  5. Prefer
    --node-id
    and
    --parent-node-id
    over text matching.
  6. delete-node
    removes the full targeted subtree.
  7. Even same-text updates can still advance document version history.
  8. Pass a daily-folder reference explicitly or set
    MUBU_DAILY_FOLDER
    before using no-arg daily helpers.
  1. Agent使用时优先选择分组命令;为兼容保留扁平化旧命令。
  2. 当Agent需要解析输出时,请使用
    --json
    参数。
  3. 在执行任何
    mutate
    命令前,优先使用
    discover
    inspect
    命令。
  4. 实时修改默认仅预演,需添加
    --execute
    参数才会执行。
  5. 优先使用
    --node-id
    --parent-node-id
    而非文本匹配。
  6. delete-node
    会删除目标节点的完整子树。
  7. 即使是相同文本的更新仍会推进文档版本历史。
  8. 使用无参数日常助手前,请显式传入日常文件夹引用或设置
    MUBU_DAILY_FOLDER
    环境变量。

Examples

示例

Interactive REPL Session

交互式REPL会话

Start an interactive session with persistent document and node context.
bash
cli-anything-mubu
启动带有持久化文档和节点上下文的交互式会话。
bash
cli-anything-mubu

Enter commands interactively

交互式输入命令

Use 'help' to see builtins

使用'help'查看内置命令

Use session commands to persist current-doc/current-node

使用会话类命令持久化当前文档/当前节点

undefined
undefined

Discover Current Daily Note

发现当前日常笔记

Resolve the current daily note from an explicit folder reference.
bash
cli-anything-mubu --json discover daily-current '<daily-folder-ref>'
通过显式文件夹引用解析当前日常笔记。
bash
cli-anything-mubu --json discover daily-current '<daily-folder-ref>'

Dry-Run Atomic Update

预演原子更新

Inspect the exact outgoing payload before a live mutation.
bash
cli-anything-mubu mutate update-text '<doc-ref>' --node-id <node-id> --text 'new text' --json
在执行实时修改前检查确切的输出负载。
bash
cli-anything-mubu mutate update-text '<doc-ref>' --node-id <node-id> --text 'new text' --json

Session State

会话状态

The CLI maintains lightweight session state in JSON:
  • current_doc
  • current_node
  • local command history
Use the
session
command group to inspect or update this state.
CLI通过JSON维护轻量级会话状态:
  • current_doc
  • current_node
  • 本地命令历史
使用
session
命令组查看或更新此状态。

For AI Agents

面向AI Agent的说明

  1. Start with
    discover
    or
    inspect
    , not
    mutate
    .
  2. Use
    session status --json
    to recover persisted context.
  3. Use grouped commands in generated prompts and automation.
  4. Verify postconditions after any live mutation.
  5. Read the package
    TEST.md
    and
    README.md
    when stricter operational detail is needed.
  1. discover
    inspect
    命令开始,而非
    mutate
  2. 使用
    session status --json
    恢复持久化上下文。
  3. 在生成提示和自动化流程中使用分组命令。
  4. 执行任何实时修改后验证后置条件。
  5. 如需更严格的操作细节,请阅读包中的
    TEST.md
    README.md

Version

版本

0.1.1
0.1.1