当前位置: 首页 > Skill >

Obsidian Official CLI Skill

Obsidian Official CLI Skill

1.0.0 2026.11.21 浏览:408
获取Skill文件查看使用说明
作者:顾禾许可证:
本文目录展开

Obsidian CLI

Official command-line interface for Obsidian. Anything you can do in Obsidian can be done from the command line — including developer commands for debugging, screenshots, and plugin reloading.

Prerequisites

  • Obsidian 1.12+ and Catalyst license required
  • Settings → General → Command line interface → Enable
  • Follow prompt to register the obsidian command
  • Restart terminal or source ~/.zprofile (macOS)
  • Note: Obsidian must be running for CLI to work

Test setup: obsidian version

Core Patterns

Command Structure

# Single commands
obsidian <command> [parameters] [flags]

# TUI mode (interactive)
obsidian  # Enter TUI with autocomplete and history

# Vault targeting
obsidian vault=Notes <command>
obsidian vault="My Vault" <command>

Parameter Types

  • Parameters: name=value (quote values with spaces)
  • Flags: Boolean switches (just include to enable)
  • Multiline: Use for newlines, t for tabs
  • Copy output: Add --copy to copy to clipboard

File Operations

Basic File Management

# Info and listing
obsidian file                          # Active file info
obsidian file file=Recipe              # Specific file info
obsidian files                         # List all files
obsidian files folder=Projects/        # Filter by folder
obsidian folders                       # List folders

# Open and read
obsidian open file=Recipe              # Open file
obsidian open path="Inbox/Note.md" newtab
obsidian read                          # Read active file
obsidian read file=Recipe --copy       # Read and copy to clipboard

# Create new notes
obsidian create name="New Note"
obsidian create name="Note" content="# Title Body"
obsidian create path="Inbox/Idea.md" template=Daily
obsidian create name="Note" silent overwrite

# Modify content
obsidian append file=Note content="New line"
obsidian append file=Note content="Same line" inline
obsidian prepend file=Note content="After frontmatter"

# Move and delete
obsidian move file=Note to=Archive/
obsidian move path="Inbox/Old.md" to="Projects/New.md"
obsidian delete file=Note              # To trash
obsidian delete file=Note permanent

File Targeting

  • file=<name> — Wikilink resolution (matches by name)
  • path=<path> — Exact path from vault root

Search and Discovery

Text Search

obsidian search query="meeting notes"
obsidian search query="TODO" matches    # Show context
obsidian search query="project" path=Projects/
obsidian search query="urgent" limit=10 case
obsidian search query="API" format=json
obsidian search:open query="search term"  # Open in Obsidian

Tags and Properties

# Tags
obsidian tags                          # Active file tags
obsidian tags all                      # All vault tags
obsidian tags all counts sort=count    # By frequency
obsidian tag name=project              # Tag info

# Properties (frontmatter)
obsidian properties file=Note
obsidian property:read name=status file=Note
obsidian property:set name=status value=done file=Note
obsidian property:set name=tags value="a,b,c" type=list file=Note
obsidian property:remove name=draft file=Note

Links and Structure

# Backlinks and outgoing links
obsidian backlinks file=Note           # What links to this
obsidian links file=Note               # Outgoing links

# Vault analysis
obsidian orphans                       # No incoming links
obsidian deadends                      # No outgoing links
obsidian unresolved                    # Broken links
obsidian unresolved verbose counts

Daily Notes and Tasks

Daily Notes

obsidian daily                         # Open today's note
obsidian daily paneType=split          # Open in split
obsidian daily:read                    # Print contents
obsidian daily:append content="- [ ] New task"
obsidian daily:prepend content="## Morning"

Task Management

# List tasks
obsidian tasks                         # Active file
obsidian tasks all                     # All vault tasks
obsidian tasks all todo                # Incomplete only
obsidian tasks file=Recipe             # Specific file
obsidian tasks daily                   # Daily note tasks

# Update tasks
obsidian task ref="Recipe.md:8" toggle
obsidian task file=Recipe line=8 done
obsidian task file=Recipe line=8 todo
obsidian task file=Note line=5 status="-"  # Custom [-]

Templates and Bookmarks

Templates

obsidian templates                     # List all templates
obsidian template:read name=Daily
obsidian template:read name=Daily resolve title="My Note"
obsidian template:insert name=Daily    # Insert into active file
obsidian create name="Meeting Notes" template=Meeting

Bookmarks

obsidian bookmarks                     # List all
obsidian bookmark file="Important.md"
obsidian bookmark file=Note subpath="#Section"
obsidian bookmark folder="Projects/"
obsidian bookmark search="TODO"
obsidian bookmark url="https://..." title="Reference"

Plugin and Theme Management

Plugins

# List and info
obsidian plugins                       # All installed
obsidian plugins:enabled               # Only enabled
obsidian plugin id=dataview            # Plugin info

# Manage plugins
obsidian plugin:enable id=dataview
obsidian plugin:disable id=dataview
obsidian plugin:install id=dataview enable
obsidian plugin:uninstall id=dataview
obsidian plugin:reload id=my-plugin    # Development

Themes and CSS

# Themes
obsidian themes                        # List installed
obsidian theme                         # Active theme
obsidian theme:set name=Minimal
obsidian theme:install name="Theme Name" enable

# CSS Snippets
obsidian snippets                      # List all
obsidian snippet:enable name=my-snippet
obsidian snippet:disable name=my-snippet

Advanced Features

Obsidian Sync

obsidian sync:status                   # Status and usage
obsidian sync on/off                   # Resume/pause
obsidian sync:history file=Note
obsidian sync:restore file=Note version=2
obsidian sync:deleted                  # Deleted files

File History

obsidian history file=Note             # List versions
obsidian history:read file=Note version=1
obsidian history:restore file=Note version=2
obsidian diff file=Note from=2 to=1   # Compare versions

Developer Tools

# Console and debugging
obsidian devtools                      # Toggle dev tools
obsidian dev:console                   # Show console
obsidian dev:errors                    # JS errors
obsidian eval code="app.vault.getFiles().length"

# Screenshots and DOM
obsidian dev:screenshot path=screenshot.png
obsidian dev:dom selector=".workspace-leaf"
obsidian dev:css selector=".mod-active" prop=background

# Mobile and debugging
obsidian dev:mobile on/off
obsidian dev:debug on/off

Utility Commands

Workspace and Navigation

# Workspace management
obsidian workspace                     # Current layout
obsidian workspace:save name="coding"
obsidian workspace:load name="coding"
obsidian tabs                          # Open tabs
obsidian tab:open file=Note

# Random and unique
obsidian random                        # Open random note
obsidian random folder=Inbox newtab
obsidian unique                        # Create unique name
obsidian wordcount file=Note           # Word count

Command Palette

obsidian commands                      # List all command IDs
obsidian commands filter=editor        # Filter commands
obsidian command id=editor:toggle-bold
obsidian hotkeys                       # List hotkeys

TUI Mode

Interactive terminal UI with enhanced features:

obsidian                               # Enter TUI mode

TUI Shortcuts:

  • Navigation: ←/→ (Ctrl+B/F), Home/End (Ctrl+A/E)
  • Editing: Ctrl+U (delete to start), Ctrl+K (delete to end)
  • Autocomplete: Tab/↓ (enter), Shift+Tab/Esc (exit)
  • History: ↑/↓ (Ctrl+P/N), Ctrl+R (reverse search)
  • Other: Enter (execute), Ctrl+L (clear), Ctrl+C/D (exit)

Troubleshooting

Setup Issues

  • Use latest installer (1.11.7+) with early access (1.12.x)
  • Restart terminal after CLI registration
  • Ensure Obsidian is running before using CLI

Platform-Specific

macOS: PATH added to ~/.zprofile

# For other shells, add manually:
export PATH="$PATH:/Applications/Obsidian.app/Contents/MacOS"

Linux: Symlink at /usr/local/bin/obsidian

# Manual creation if needed:
sudo ln -s /path/to/obsidian /usr/local/bin/obsidian

Windows: Requires Obsidian.com terminal redirector (Catalyst Discord)

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,033
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,012
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,012
Skill 文件
  • SKILL.md
    • Obsidian CLI
    • Prerequisites
    • Core Patterns
      • Command Structure
      • Parameter Types
    • File Operations
      • Basic File Management
      • File Targeting
    • Search and Discovery
      • Text Search
      • Tags and Properties
      • Links and Structure
    • Daily Notes and Tasks
      • Daily Notes
      • Task Management
    • Templates and Bookmarks
      • Templates
      • Bookmarks
    • Plugin and Theme Management
      • Plugins
      • Themes and CSS
    • Advanced Features
      • Obsidian Sync
      • File History
      • Developer Tools
    • Utility Commands
      • Workspace and Navigation
      • Command Palette
    • TUI Mode
    • Troubleshooting
      • Setup Issues
      • Platform-Specific
  • 项目或源文件

相关 Skill

更多
obsidian-cli-skills obsidian-cli-skills Obsidian CLI 工具,支持通过命令行管理 Obsidian 知识库,包括笔记创建、搜索、移动(自动更新 Wiki 链接)、删除、frontmatter 编辑及日记等功能。
Obsidian Official CLI Obsidian Official CLI 官方 Obsidian CLI(v1.12+),提供完整的命令行界面,支持笔记、任务、搜索、标签、属性、链接等功能。
Obsidian Remote Obsidian Remote 通过内置的 Obsidian CLI 完全控制正在运行的 Obsidian 桌面应用,取代旧版随 OpenClaw 打包的 obsidian-cli 技能——
Obsidian CLI Obsidian CLI 用于官方 Obsidian CLI(v1.12+)的技能,实现完整的保险库自动化,包括文件、每日笔记、搜索、任务、标签、属性、链接、书签、基础等。
Obsidian CLI (kepano/obsidian-skills) Obsidian CLI (kepano/obsidian-skills) Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.