微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🧠

命令行驱动你的第二大脑

Obsidian (Linux) · v1.2.0
效率 安全 B 级 作者 tripleight 公开目录收录
1.2k 下载 0 安装 5.5k 收藏 5 浏览

简介

通过 notesmd-cli 自动化管理 Obsidian 知识库,支持笔记创建、搜索、链接迁移及每日日记,适合构建本地化第二大脑。

原始描述

Work with Obsidian vaults (plain Markdown notes) and automate via notesmd-cli.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/obsidian-linux/
其它 Agent解压到它自己的 skills 目录,目录名用 obsidian-linux

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

技能正文


name: obsidian description: Work with Obsidian vaults (plain Markdown notes) and automate via notesmd-cli. homepage: https://help.obsidian.md metadata: {"clawdbot":{"emoji":"💎","requires":{"bins":["notesmd-cli"]},"install":[{"id":"brew","kind":"brew","formula":"yakitrak/yakitrak/notesmd-cli","bins":["notesmd-cli"],"label":"Install notesmd-cli (brew, macOS)"},{"id":"aur","kind":"aur","package":"notesmd-cli-bin","bins":["notesmd-cli"],"label":"Install notesmd-cli (AUR, Arch/Manjaro Linux)"}]}}

Obsidian

Obsidian vault = a normal folder on disk with Markdown files.

Vault structure (typical):

  • Notes: *.md (plain text Markdown; edit with any editor)
  • Config: .obsidian/ (workspace + plugin settings; don't touch from scripts)
  • Canvases: *.canvas (JSON)
  • Attachments: whatever folder you chose in Obsidian settings (images/PDFs/etc.)

Setup

Find active vault(s)

Obsidian desktop tracks vaults in a config file (source of truth):

  • macOS: ~/Library/Application Support/obsidian/obsidian.json
  • Linux: ~/.config/obsidian/obsidian.json

notesmd-cli resolves vaults from that file; vault name is the folder name (path suffix).

Verify default vault

Always check before running commands:

notesmd-cli print-default --path-only 2>/dev/null && echo "OK" || echo "NOT_SET"

If NOT_SET, configure it:

notesmd-cli set-default "VAULT_NAME"

Don't guess vault paths — read the config file or use print-default.

notesmd-cli quick reference

Vault info

notesmd-cli print-default              # show default vault name + path
notesmd-cli print-default --path-only  # path only
notesmd-cli list                       # list notes and folders in vault
notesmd-cli list "Folder"              # list inside a folder

Search

notesmd-cli search "query"             # fuzzy search note names
notesmd-cli search-content "query"     # search inside notes (shows snippets + lines)

Read

notesmd-cli print "path/note"          # print note contents
notesmd-cli frontmatter "path/note"    # view or modify note frontmatter

Create & edit

notesmd-cli create "Folder/Note" --content "..." --open    # create note
notesmd-cli create "Folder/Note" --content "..." --append  # append to existing note
notesmd-cli create "Folder/Note" --content "..." --overwrite  # overwrite note

Note: create requires Obsidian URI handler (Obsidian must be installed). Avoid hidden dot-folder paths.

Move / delete

notesmd-cli move "old/path/note" "new/path/note"  # rename/move (updates [[wikilinks]])
notesmd-cli delete "path/note"

Multi-vault

Add --vault "Name" to any command:

notesmd-cli print "2025-01-10" --vault "Work"
notesmd-cli search "meeting" --vault "Personal"

Daily notes

notesmd-cli daily                      # open/create today's daily note
notesmd-cli daily --vault "Work"       # for a specific vault

Get current date (cross-platform)

date +%Y-%m-%d                         # today
# Yesterday (GNU first, BSD fallback):
date -d yesterday +%Y-%m-%d 2>/dev/null || date -v-1d +%Y-%m-%d
# Last Friday:
date -d "last friday" +%Y-%m-%d 2>/dev/null || date -v-friday +%Y-%m-%d
# N days ago:
date -d "3 days ago" +%Y-%m-%d 2>/dev/null || date -v-3d +%Y-%m-%d

Append to daily note

# Journal entry
notesmd-cli create "$(date +%Y-%m-%d)" --content "- Did the thing" --append

# Task
notesmd-cli create "$(date +%Y-%m-%d)" --content "- [ ] Buy groceries" --append

# Timestamped log
notesmd-cli create "$(date +%Y-%m-%d)" --content "- $(date +%H:%M) Meeting notes here" --append

# With custom folder (e.g. Daily Notes plugin folder)
notesmd-cli create "Daily Notes/$(date +%Y-%m-%d)" --content "- Entry" --append

Read a daily note

notesmd-cli print "$(date +%Y-%m-%d)"  # today
notesmd-cli print "$(date -d yesterday +%Y-%m-%d 2>/dev/null || date -v-1d +%Y-%m-%d)"  # yesterday
notesmd-cli print "2025-01-10"         # specific date

Common patterns

Create a new note with content:

notesmd-cli create "Projects/My Project" --content "# My Project\n\nNotes here." --open

Find and read a note:

notesmd-cli search "meeting"
notesmd-cli print "path/from/search/result"

Safe rename preserving links:

notesmd-cli move "old/note name" "new/folder/note name"

Search inside notes:

notesmd-cli search-content "TODO"
notesmd-cli search-content "project alpha"

Prefer direct file edits when appropriate (just edit the .md file); Obsidian picks them up automatically.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

obsidianknowledge-managementmarkdownclinote-takingzettelkastenproductivityautomationsecond-brain

同类 Skill