AgentSkillsCN

obsidian-cli

通过 `obsidian` CLI 与 Obsidian 知识库进行交互。当您被要求:阅读或撰写每日笔记、搜索知识库内容、分析笔记之间的关联关系(反向链接、外向链接、孤岛、死胡同)、管理 frontmatter 属性与标签、从模板创建笔记、列出或检查文件、打开工作空间、追踪任务、管理书签、查看笔记大纲,或在多知识库环境中进行导航时,均可使用此技能。无论何时涉及与 Obsidian 知识库的交互、笔记管理,或知识库相关操作,均可触发此技能。

SKILL.md
--- frontmatter
name: obsidian-cli
description: >
  Interact with Obsidian vaults via the `obsidian` CLI. Use when asked to: read or
  write daily notes, search vault content, analyze note connections (backlinks,
  outgoing links, orphans, dead-ends), manage frontmatter properties and tags,
  create notes from templates, list or inspect files, open workspaces, track tasks,
  manage bookmarks, view note outlines, or navigate multi-vault setups. Trigger on
  any request involving Obsidian vault interaction, note management, or knowledge
  base operations.
allowed-tools: Bash

Obsidian CLI

All commands: obsidian <command> [options]

Core Patterns

Vault targeting (multi-vault):

bash
obsidian vault=MyVault <command>

File targeting (two methods):

bash
obsidian read file="Note Name"      # by filename (without extension)
obsidian read path="folder/note.md" # by relative path from vault root

Workflow Decision Tree

Modifying a note?

  • Add content at top → prepend / daily:prepend
  • Add content at bottom → append / daily:append
  • Change metadata → property:set / property:remove
  • Rename or relocate → move

Creating a note?

  • Template exists for this type → create name=<n> template=<t>
  • Custom content → create name=<n> content=<text>
  • Will populate later → create name=<n>

Investigating a note's connections?

  • What links here? → backlinks
  • What does it link to? → links
  • What's its structure? → outline

Auditing vault health?

  • Notes nobody links to → orphans
  • Notes that link to nothing → deadends
  • Broken links → unresolved

Finding information?

  • Full-text search → search query=<text>
  • Browse by tag → tag name=<tag>
  • Serendipity → random:read
  • Recent context → recents

Workflow Examples

bash
# Log to daily note
obsidian daily:prepend content="## Meeting Notes\n- Discussed timeline"

# Analyze connections around a note
obsidian backlinks file="Machine Learning"
obsidian links file="Machine Learning"

# Create from template
obsidian templates
obsidian create name="New Concept" template="SlipBox Template"

# Search, read, and inspect structure
obsidian search query="neural networks" format=json limit=10
obsidian read file="Neural Networks"
obsidian outline file="Neural Networks" format=tree

References

Load the relevant reference when you need full command syntax and options:

  • Investigating note relationships or auditing vault link healthgraph-analysis.mdbacklinks, links, orphans, deadends, unresolved
  • Reading, creating, or modifying note contentcontent-ops.mdread, create, append, prepend, delete, move, open, daily:*, templates, outline
  • Working with frontmatter properties, tags, or tasksmetadata.mdproperties, property:read/set/remove, tags, aliases, tasks
  • Searching, browsing vault structure, or managing workspacesearch-and-vault.mdsearch, vault, files, folders, workspace, bookmarks, recents