notesmd
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNotesMD CLI
NotesMD CLI
Interact with Obsidian vaults using . Works without Obsidian running — operates directly on the vault's Markdown files.
notesmd-cli使用与Obsidian库交互。无需运行Obsidian即可工作——直接操作库中的Markdown文件。
notesmd-cliVault basics
库基础
Obsidian vault = a normal folder on disk containing files.
*.mdVault config lives at on macOS.
~/Library/Application Support/obsidian/obsidian.jsonObsidian库 = 磁盘上包含文件的普通文件夹。
*.md在macOS上,库配置文件位于。
~/Library/Application Support/obsidian/obsidian.jsonSetup
配置
Set default vault (once):
bash
notesmd-cli set-default "{vault-name}"Check current default:
bash
notesmd-cli print-default
notesmd-cli print-default --path-onlyAll commands accept to target a specific vault.
--vault "{vault-name}"设置默认库(仅需一次):
bash
notesmd-cli set-default "{vault-name}"查看当前默认库:
bash
notesmd-cli print-default
notesmd-cli print-default --path-only所有命令都支持通过指定目标库。
--vault "{vault-name}"Commands
命令
Read
读取
bash
notesmd-cli print "{note-name-or-path}"
notesmd-cli list # vault root
notesmd-cli list "subfolder"bash
notesmd-cli print "{note-name-or-path}"
notesmd-cli list # 库根目录
notesmd-cli list "subfolder"Search
搜索
bash
notesmd-cli search # fuzzy search note names
notesmd-cli search-content "term" # search inside note contentAdd to open selected note in instead of Obsidian.
--editor$EDITORbash
notesmd-cli search # 模糊搜索笔记名称
notesmd-cli search-content "term" # 在笔记内容中搜索添加参数可在中打开选中的笔记,而非Obsidian。
--editor$EDITORCreate / Update
创建/更新
bash
notesmd-cli create "{note-name}" --content "..."
notesmd-cli create "{note-name}" --content "..." --overwrite # replace existing
notesmd-cli create "{note-name}" --content "..." --append # append to existing
notesmd-cli create "{note-name}" --open # open after createbash
notesmd-cli create "{note-name}" --content "..."
notesmd-cli create "{note-name}" --content "..." --overwrite # 替换已有笔记
notesmd-cli create "{note-name}" --content "..." --append # 追加到已有笔记
notesmd-cli create "{note-name}" --open # 创建后打开Move / Rename
移动/重命名
Updates across the vault automatically.
[[wikilinks]]bash
notesmd-cli move "{old-path}" "{new-path}"自动更新整个库中的链接。
[[wikilinks]]bash
notesmd-cli move "{old-path}" "{new-path}"Delete
删除
bash
notesmd-cli delete "{note-path}"bash
notesmd-cli delete "{note-path}"Daily note
每日笔记
bash
notesmd-cli dailybash
notesmd-cli dailyOpen in Obsidian
在Obsidian中打开
bash
notesmd-cli open "{note-name}"
notesmd-cli open "{note-name}" --section "{heading}"bash
notesmd-cli open "{note-name}"
notesmd-cli open "{note-name}" --section "{heading}"Frontmatter
Frontmatter管理
bash
notesmd-cli frontmatter "{note}" --print
notesmd-cli frontmatter "{note}" --edit --key "status" --value "done"
notesmd-cli frontmatter "{note}" --delete --key "draft"bash
notesmd-cli frontmatter "{note}" --print
notesmd-cli frontmatter "{note}" --edit --key "status" --value "done"
notesmd-cli frontmatter "{note}" --delete --key "draft"Tips
小贴士
- Note paths are relative to vault root (e.g. )
"Folder/Note" - For direct edits, modify the file directly — Obsidian picks up changes
.md - Prefer over
notesmd-cli moveto keep wikilinks consistentmv - flag uses
--editorenv var (defaults to$EDITOR)vim - For CLI bugs or unexpected behavior, refer to notesmd-cli
- 笔记路径相对于库根目录(例如)
"Folder/Note" - 如需直接编辑,可修改文件——Obsidian会自动识别更改
.md - 优先使用而非
notesmd-cli move命令,以保持wikilinks链接一致mv - 参数使用
--editor环境变量(默认为$EDITOR)vim - 若遇到CLI工具的bug或异常行为,请参考notesmd-cli