命令行(lnote)

查看指南lnote 命令行 指南

同样的 MCP 操作也存在于用于脚本和自动化的控制台可执行文件 lnote 中 (也可通过 lightnote cli <command> 访问)。所有操作都限定在根文件夹内, 用 --root 设置(默认: 当前文件夹)。

示例:

lnote list --recursive
lnote read --path src/main.cpp --start-line 1 --end-line 40
lnote write --path note.md --content "Hello"
echo content | lnote write --path note.md --content -
lnote search --query TODO --regex
lnote query --sql "SELECT * FROM read_parquet('data.parquet') LIMIT 10"
lnote describe --path data.parquet
lnote search-notes --query "我在哪里写过预算的事"
lnote audit-links
lnote xlsx-read --path sheet.xlsx --sheet 0
lnote data-diff --a before.parquet --b after.parquet --mode changed --keys id
lnote db-describe --connection data.lnc --table customers
lnote db-export --connection dados.lnc --sql "SELECT * FROM clientes" --out clientes.parquet
lnote due-tasks
lnote export --sql "SELECT * FROM read_csv_auto('e.csv') WHERE state='NY'" --out ny.parquet
lnote zip-list --path export.isx
lnote zip-read --path export.isx --entry job/definition.xml
lnote task-projects
lnote tasks --project Backlog
lnote create-task --project Backlog --title "Review the text" --effort 2
lnote move-task --project Backlog --task-id 5 --status-id 2
lnote git-status
lnote http --url https://api.example.com --method GET
lnote notify --message "Processing finished"

全局选项: --root <folder>、--json (结构化的 {ok,data,error} 输出)、--help(或 lnote <command> --help)、--version。对未知命令会 给出建议(“did you mean…?”)。

批量更新旧数据:lnote upgrade <文件夹> 可一次性升级由旧版 LightNote 写入的文件——目前是旧扩展名 .lnsh 和 .lnsm,它们已改为 .lns 和 .lne。 应用在你打开每个文件时本来就会自动完成此操作;该命令适用于文件多达数十个、 不想逐个打开的情况。使用 --dry-run 可在不改动任何内容的前提下预览将要发生的变更。 这只是便利功能而非必需:不用它,旧文件照样能正常打开。