Files
mnote/rust/crates/mnote-cli
lix-2026 e8ba12e461 收口 Rust Web 入口与 AI 写入链
- 将 3000 主入口继续收口到 mnote-web,补齐 /favicon.ico、/api/auth、session alias、AI run 等 Rust Web 路由边界。

- 更新登录页与 Convex Auth 代理,支持测试账号快速登录写入真实 Convex Auth cookie。

- 推进页面设置、Wolai 对齐、Phase 7 AI kernel/CLI-first 设计文档与相关 smoke 脚本。

- 更新 leptos-tiptap 生成资产、mnote-cli/bridge-runtime、前端依赖和 dev/prod 启动脚本。
2026-05-06 21:44:20 +08:00
..

mnote-cli

当前 crate 是 Phase 2 的最小 CLI 协议入口。

当前目标不是直接替代全部执行链,而是先冻结这五类命令面的命名和 --json 输出协议:

  • page
  • block
  • search
  • sidebar
  • tool

当前最小子命令面:

  • page get
  • page title
  • page save
  • block insert
  • block patch
  • search documents
  • search blocks
  • sidebar dataset
  • tool run

最小示例:

cargo run --manifest-path /mnt/Data1T/mnote/rust/Cargo.toml -p mnote-cli -- --json page get --page-id page_demo --workspace-id ws_demo
cargo run --manifest-path /mnt/Data1T/mnote/rust/Cargo.toml -p mnote-cli -- --json page title --page-id page_demo --workspace-id ws_demo --title "新标题"
cargo run --manifest-path /mnt/Data1T/mnote/rust/Cargo.toml -p mnote-cli -- --json page save --page-id page_demo --workspace-id ws_demo --content-json '[{\"id\":\"block_1\"}]'
cargo run --manifest-path /mnt/Data1T/mnote/rust/Cargo.toml -p mnote-cli -- --json sidebar dataset --workspace-id ws_demo
cargo run --manifest-path /mnt/Data1T/mnote/rust/Cargo.toml -p mnote-cli -- --json tool run --tool-name doc_get --kind query --mode explain-plan --args-json '{"pageId":"page_demo"}'

当前输出的重点字段:

  • domain / action
  • context.requestId / context.traceId
  • operation.kind
  • operation.nameoperation.toolName
  • operation.executionMode / operation.toolsetId / operation.effect
  • operation.transport.functionName
  • operation.transport.payloadJson
  • operation.transport.argsJson

tool run 当前会先校验 Rust 内置 tool registry,并统一暴露 validateOnly / dryRun / explain-plan 等安全模式字段。后续阶段会继续把这些 CLI 面接到真实执行器,但命令命名和 JSON 契约应尽量保持稳定。