feat: Add obsidian-cli skill for Obsidian vault CLI operations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-05-27 16:43:40 +08:00
parent 55da2b74a4
commit 687ab5ee28
2 changed files with 767 additions and 0 deletions

View File

@@ -0,0 +1,568 @@
# Commands Reference
Full parameter reference for Obsidian CLI note content commands. Required parameters are marked `(required)`.
## Table of contents
- [General](#general)
- [Daily notes](#daily-notes)
- [Files and folders](#files-and-folders)
- [Search](#search)
- [Tasks](#tasks)
- [Properties](#properties)
- [Tags](#tags)
- [Links](#links)
- [Outline](#outline)
- [File history](#file-history)
- [Templates](#templates)
- [Vault](#vault)
- [Wordcount](#wordcount)
---
## General
### `help`
Show available commands or help for a specific command.
| Parameter | Description |
| ----------- | --------------------------------- |
| `<command>` | Show help for a specific command. |
### `version`
Show Obsidian version.
### `reload`
Reload the app window.
### `restart`
Restart the app.
---
## Daily notes
### `daily`
Open daily note.
| Parameter | Description |
| ------------------------------- | ---------------------- |
| `paneType=tab\|split\|window` | Pane type to open in |
### `daily:path`
Get daily note path. Returns the expected path even if the file hasn't been created yet.
### `daily:read`
Read daily note contents.
### `daily:append`
Append content to daily note.
| Parameter | Description |
| ------------------------------- | ---------------------------- |
| `content=<text>` | (required) Content to append |
| `paneType=tab\|split\|window` | Pane type to open in |
| `inline` | Append without newline |
| `open` | Open file after adding |
### `daily:prepend`
Prepend content to daily note.
| Parameter | Description |
| ------------------------------- | ---------------------------- |
| `content=<text>` | (required) Content to prepend|
| `paneType=tab\|split\|window` | Pane type to open in |
| `inline` | Prepend without newline |
| `open` | Open file after adding |
---
## Files and folders
### `file`
Show file info (default: active file). Returns path, name, extension, size, created/modified timestamps.
| Parameter | Description |
| ------------- | ----------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
### `files`
List files in the vault.
| Parameter | Description |
| ----------------- | ------------------------ |
| `folder=<path>` | Filter by folder |
| `ext=<extension>` | Filter by extension |
| `total` | Return file count |
### `folder`
Show folder info.
| Parameter | Description |
| ------------------------------ | -------------------------- |
| `path=<path>` | (required) Folder path |
| `info=files\|folders\|size` | Return specific info only |
### `folders`
List folders in the vault.
| Parameter | Description |
| --------------- | ------------------------ |
| `folder=<path>` | Filter by parent folder |
| `total` | Return folder count |
### `open`
Open a file.
| Parameter | Description |
| ------------- | ---------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `newtab` | Open in new tab |
### `create`
Create or overwrite a file.
| Parameter | Description |
| ------------------ | ------------------------ |
| `name=<name>` | File name |
| `path=<path>` | File path |
| `content=<text>` | Initial content |
| `template=<name>` | Template to use |
| `overwrite` | Overwrite if exists |
| `open` | Open after creating |
| `newtab` | Open in new tab |
### `read`
Read file contents (default: active file).
| Parameter | Description |
| ------------- | ----------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
### `append`
Append content to a file (default: active file).
| Parameter | Description |
| ---------------- | ---------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `content=<text>` | (required) Content to append |
| `inline` | Append without newline |
### `prepend`
Prepend content after frontmatter (default: active file).
| Parameter | Description |
| ---------------- | ----------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `content=<text>` | (required) Content to prepend |
| `inline` | Prepend without newline |
### `move`
Move or rename a file (default: active file). Auto-updates internal links if enabled.
| Parameter | Description |
| -------------- | ----------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `to=<path>` | (required) Destination path |
### `rename`
Rename a file (default: active file). Extension preserved if omitted. Use `move` to rename and move simultaneously.
| Parameter | Description |
| -------------- | ------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `name=<name>` | (required) New file name |
### `delete`
Delete a file (default: active file, trash by default).
| Parameter | Description |
| -------------- | ------------------------------ |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `permanent` | Skip trash, delete permanently |
---
## Search
### `search`
Search vault for text. Returns matching file paths.
| Parameter | Description |
| -------------------- | ------------------------------ |
| `query=<text>` | (required) Search query |
| `path=<folder>` | Limit to folder |
| `limit=<n>` | Max files |
| `format=text\|json` | Output format (default: text) |
| `total` | Return match count |
| `case` | Case sensitive |
### `search:context`
Search with matching line context. Returns grep-style `path:line: text` output.
| Parameter | Description |
| -------------------- | ------------------------------ |
| `query=<text>` | (required) Search query |
| `path=<folder>` | Limit to folder |
| `limit=<n>` | Max files |
| `format=text\|json` | Output format (default: text) |
| `case` | Case sensitive |
### `search:open`
Open search view in Obsidian.
| Parameter | Description |
| --------------- | ---------------------- |
| `query=<text>` | Initial search query |
---
## Tasks
### `tasks`
List tasks in the vault.
| Parameter | Description |
| ------------------------ | --------------------------------- |
| `file=<name>` | Filter by file name |
| `path=<path>` | Filter by file path |
| `status="<char>"` | Filter by status character |
| `total` | Return task count |
| `done` | Show completed tasks |
| `todo` | Show incomplete tasks |
| `verbose` | Group by file with line numbers |
| `format=json\|tsv\|csv` | Output format (default: text) |
| `active` | Show tasks for active file |
| `daily` | Show tasks from daily note |
### `task`
Show or update a task.
| Parameter | Description |
| -------------------- | -------------------------- |
| `ref=<path:line>` | Task reference (path:line) |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `line=<n>` | Line number |
| `status="<char>"` | Set status character |
| `toggle` | Toggle task status |
| `daily` | Target daily note |
| `done` | Mark as done |
| `todo` | Mark as todo |
---
## Properties
### `aliases`
List aliases in the vault.
| Parameter | Description |
| ------------- | -------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `total` | Return alias count |
| `verbose` | Include file paths |
| `active` | Show for active file |
### `properties`
List properties in the vault.
| Parameter | Description |
| ------------------------ | ----------------------------- |
| `file=<name>` | Show properties for file |
| `path=<path>` | Show properties for path |
| `name=<name>` | Get specific property count |
| `sort=count` | Sort by count (default: name) |
| `format=yaml\|json\|tsv` | Output format (default: yaml) |
| `total` | Return property count |
| `counts` | Include occurrence counts |
| `active` | Show for active file |
### `property:set`
Set a property on a file (default: active file).
| Parameter | Description |
| ---------------------------------------------------- | -------------------- |
| `name=<name>` | (required) Property name |
| `value=<value>` | (required) Property value |
| `type=text\|list\|number\|checkbox\|date\|datetime` | Property type |
| `file=<name>` | File name |
| `path=<path>` | File path |
### `property:remove`
Remove a property from a file (default: active file).
| Parameter | Description |
| ------------- | ------------------------ |
| `name=<name>` | (required) Property name |
| `file=<name>` | File name |
| `path=<path>` | File path |
### `property:read`
Read a property value from a file (default: active file).
| Parameter | Description |
| ------------- | ------------------------ |
| `name=<name>` | (required) Property name |
| `file=<name>` | File name |
| `path=<path>` | File path |
---
## Tags
### `tags`
List tags in the vault.
| Parameter | Description |
| ------------------------ | ----------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `sort=count` | Sort by count (default: name) |
| `total` | Return tag count |
| `counts` | Include tag counts |
| `format=json\|tsv\|csv` | Output format (default: tsv) |
| `active` | Show for active file |
### `tag`
Get tag info.
| Parameter | Description |
| ------------ | --------------------------- |
| `name=<tag>` | (required) Tag name |
| `total` | Return occurrence count |
| `verbose` | Include file list and count |
---
## Links
### `backlinks`
List backlinks to a file (default: active file).
| Parameter | Description |
| ------------------------ | ----------------------------- |
| `file=<name>` | Target file name |
| `path=<path>` | Target file path |
| `counts` | Include link counts |
| `total` | Return backlink count |
| `format=json\|tsv\|csv` | Output format (default: tsv) |
### `links`
List outgoing links from a file (default: active file).
| Parameter | Description |
| ------------- | ------------------ |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `total` | Return link count |
### `unresolved`
List unresolved links in vault.
| Parameter | Description |
| ------------------------ | ----------------------------- |
| `total` | Return unresolved link count |
| `counts` | Include link counts |
| `verbose` | Include source files |
| `format=json\|tsv\|csv` | Output format (default: tsv) |
### `orphans`
List files with no incoming links.
| Parameter | Description |
| --------- | ------------------- |
| `total` | Return orphan count |
### `deadends`
List files with no outgoing links.
| Parameter | Description |
| --------- | ---------------------- |
| `total` | Return dead-end count |
---
## Outline
### `outline`
Show headings for a file.
| Parameter | Description |
| ------------------------ | ------------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `format=tree\|md\|json` | Output format (default: tree) |
| `total` | Return heading count |
---
## File history
### `diff`
List or compare versions from local File recovery and Sync. Versions numbered newest to oldest.
| Parameter | Description |
| ---------------------- | ------------------------------ |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `from=<n>` | Version number to diff from |
| `to=<n>` | Version number to diff to |
| `filter=local\|sync` | Filter by version source |
### `history`
List versions from File recovery only.
| Parameter | Description |
| ------------- | ----------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
### `history:list`
List all files with local history.
### `history:read`
Read a local history version.
| Parameter | Description |
| --------------- | ------------------------------ |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `version=<n>` | Version number (default: 1) |
### `history:restore`
Restore a local history version.
| Parameter | Description |
| --------------- | ------------------------ |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `version=<n>` | (required) Version number|
### `history:open`
Open file recovery.
| Parameter | Description |
| ------------- | ----------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
---
## Templates
### `templates`
List templates.
| Parameter | Description |
| --------- | ---------------------- |
| `total` | Return template count |
### `template:read`
Read template content.
| Parameter | Description |
| ------------------ | --------------------------------------------------- |
| `name=<template>` | (required) Template name |
| `title=<title>` | Title for variable resolution |
| `resolve` | Resolve `{{date}}`, `{{time}}`, `{{title}}` variables |
### `template:insert`
Insert template into active file.
| Parameter | Description |
| ------------------ | ------------------------ |
| `name=<template>` | (required) Template name |
---
## Vault
### `vault`
Show vault info.
| Parameter | Description |
| ---------------------------------------- | -------------------------- |
| `info=name\|path\|files\|folders\|size` | Return specific info only |
### `vaults`
List known vaults.
| Parameter | Description |
| ---------- | -------------------- |
| `total` | Return vault count |
| `verbose` | Include vault paths |
---
## Wordcount
### `wordcount`
Count words and characters.
| Parameter | Description |
| --------------- | ---------------------------- |
| `file=<name>` | File name |
| `path=<path>` | File path |
| `words` | Return word count only |
| `characters` | Return character count only |