当前位置: 首页 > Skill >

Obsidian Official CLI

Obsidian Official CLI

Obsidian Official CLI

官方 Obsidian CLI(v1.12+),提供完整的命令行界面,支持笔记、任务、搜索、标签、属性、链接等功能。

4.0.2 2026.11.22 965
获取Skill文件查看使用说明
作 者:叶宁 许可证: 更新时间:2026.11.22
本文目录展开

Obsidian Official CLI

Official command-line interface for Obsidian (v1.12+). 115 commands.

Prerequisites

  • Obsidian 1.12+ (free, public release since v1.12)
  • Obsidian must be running (CLI connects via IPC)
  • Enable CLI: Settings → General → Enable CLI

Setup

Add Obsidian to PATH:

macOS:

export PATH="$PATH:/Applications/Obsidian.app/Contents/MacOS"

Windows:

$env:PATH += ";$env:LOCALAPPDATAObsidian"

Linux:

  • Snap: Already in PATH
  • Flatpak: alias obsidian='flatpak run md.obsidian.Obsidian'
  • AppImage: Move to ~/.local/bin and chmod +x

Test: obsidian version

Syntax

  • Parameters: name=value or name="value with spaces"
  • Flags: just the name, e.g. open, overwrite
  • Newlines: use n in content strings
  • Target vault: obsidian vault="My Vault" <command> (must be first)
  • Target file: file=<name> (wikilink-style) or path=<folder/file.md> (exact)
  • Copy output: append --copy to any command

Common Commands (with examples)

Daily Notes

obsidian daily                                    # Open today
obsidian daily:append content="- [ ] Buy milk"    # Add to today
obsidian daily:prepend content="# Important"      # Add to top
obsidian daily:read                               # Read today's content
obsidian daily:path                               # Get daily note path

Files

obsidian create name="Note" content="# Hello"     # Create note
obsidian create name="Note" template=Meeting       # Create from template
obsidian read file="Note"                          # Read note
obsidian append file="Note" content="More text"    # Append to note
obsidian prepend file="Note" content="Top text"    # Prepend to note
obsidian move file="Note" to="Archive/Note.md"     # Move note
obsidian rename file="Note" name="New Name"        # Rename note
obsidian delete file="Note"                        # Delete note
obsidian open file="Note"                          # Open note

Search

obsidian search query="meeting notes"              # Search vault
obsidian search:context query="TODO"               # Search with context
obsidian search:open query="project"               # Open search view

Tasks

obsidian tasks daily todo                          # Incomplete tasks in daily
obsidian tasks todo                                # All incomplete tasks
obsidian task daily line=3 toggle                  # Toggle task at line 3

Tags & Properties

obsidian tags counts                               # List all tags
obsidian tags counts sort=count                    # Sort by frequency
obsidian property:set name="status" value="done" file="Note"
obsidian property:read name="status" file="Note"
obsidian property:remove name="status" file="Note"
obsidian properties file="Note"                    # List all properties

Links

obsidian backlinks file="Note"                     # Incoming links
obsidian links file="Note"                         # Outgoing links
obsidian orphans                                   # No incoming links
obsidian deadends                                  # No outgoing links
obsidian unresolved                                # Broken links

Developer

obsidian devtools                                  # Open dev tools
obsidian eval code="app.vault.getFiles().length"   # Run JavaScript
obsidian dev:screenshot path=screenshot.png         # Screenshot
obsidian plugin:reload id=my-plugin                # Reload plugin

All Commands (115 total)

General (4)

  • help - Show help / help for specific command
  • version - Show Obsidian version
  • reload - Reload the app window
  • restart - Restart the app

Daily Notes (5)

  • daily - Open daily note
  • daily:path - Get daily note path
  • daily:read - Read daily note contents
  • daily:append - Append content to daily note
  • daily:prepend - Prepend content to daily note

Files & Folders (12)

  • file - Show file info
  • files - List files in vault
  • folder - Show folder info
  • folders - List folders in vault
  • open - Open a file
  • create - Create a new file
  • read - Read file contents
  • append - Append content to a file
  • prepend - Prepend content to a file
  • move - Move or rename a file
  • rename - Rename a file
  • delete - Delete a file

Search (3)

  • search - Search vault for text
  • search:context - Search with matching line context
  • search:open - Open search view

Tasks (2)

  • tasks - List tasks in the vault
  • task - Show or update a task

Tags (2)

  • tags - List tags in the vault
  • tag - Get tag info

Properties (4)

  • properties - List properties in the vault
  • property:set - Set a property on a file
  • property:remove - Remove a property from a file
  • property:read - Read a property value

Aliases (1)

  • aliases - List aliases in the vault

Links (5)

  • backlinks - List backlinks to a file
  • links - List outgoing links from a file
  • unresolved - List unresolved links
  • orphans - Files with no incoming links
  • deadends - Files with no outgoing links

Outline (1)

  • outline - Show headings for a file

Bookmarks (2)

  • bookmarks - List bookmarks
  • bookmark - Add a bookmark

Bases / Database (4)

  • bases - List all base files
  • base:views - List views in a base
  • base:create - Create a new item in a base
  • base:query - Query a base and return results

Templates (3)

  • templates - List templates
  • template:read - Read template content
  • template:insert - Insert template into active file

Commands & Hotkeys (4)

  • commands - List available command IDs
  • command - Execute an Obsidian command
  • hotkeys - List hotkeys
  • hotkey - Get hotkey for a command

Tabs & Workspaces (7)

  • tabs - List open tabs
  • tab:open - Open a new tab
  • workspace - Show workspace tree
  • workspaces - List saved workspaces
  • workspace:load - Load a saved workspace
  • workspace:save - Save current layout
  • workspace:delete - Delete a saved workspace

File History & Diff (6)

  • diff - List or diff local/sync versions
  • history - List file history versions
  • history:list - List files with history
  • history:read - Read a file history version
  • history:restore - Restore a file history version
  • history:open - Open file recovery

Sync (7)

  • sync - Pause or resume sync (on/off)
  • sync:status - Show sync status
  • sync:history - List sync version history
  • sync:read - Read a sync version
  • sync:restore - Restore a sync version
  • sync:open - Open sync history
  • sync:deleted - List deleted files in sync

Publish (6)

  • publish:site - Show publish site info
  • publish:list - List published files
  • publish:status - Show publish status
  • publish:add - Publish files
  • publish:remove - Unpublish files
  • publish:open - Open published site

Themes & Snippets (9)

  • themes - List installed themes
  • theme - Show active theme or get info
  • theme:set - Set active theme
  • theme:install - Install a community theme
  • theme:uninstall - Uninstall a theme
  • snippets - List installed CSS snippets
  • snippets:enabled - List enabled CSS snippets
  • snippet:enable - Enable a CSS snippet
  • snippet:disable - Disable a CSS snippet

Plugins (9)

  • plugins - List installed plugins
  • plugins:enabled - List enabled plugins
  • plugins:restrict - Toggle restricted mode
  • plugin - Get plugin info
  • plugin:enable - Enable a plugin
  • plugin:disable - Disable a plugin
  • plugin:install - Install a community plugin
  • plugin:uninstall - Uninstall a community plugin
  • plugin:reload - Reload a plugin

Vault (3)

  • vault - Show vault info
  • vaults - List known vaults
  • vault:open - Open a vault (TUI only)

Random Notes (2)

  • random - Open a random note
  • random:read - Read a random note

Unique Notes (1)

  • unique - Create unique note

Web Viewer (1)

  • web - Open URL in web viewer

Word Count (1)

  • wordcount - Count words and characters

Recently Opened (1)

  • recents - List recently opened files

Developer (10)

  • devtools - Toggle Electron dev tools
  • eval - Execute JavaScript
  • dev:screenshot - Take a screenshot
  • dev:console - Show captured console messages
  • dev:errors - Show captured errors
  • dev:css - Inspect CSS with source locations
  • dev:dom - Query DOM elements
  • dev:cdp - Run Chrome DevTools Protocol command
  • dev:debug - Attach/detach CDP debugger
  • dev:mobile - Toggle mobile emulation

Troubleshooting

"Cannot connect to Obsidian"

  • Ensure Obsidian is running
  • Enable CLI in Settings → General → Enable CLI

"Command not found: obsidian"

  • Add Obsidian to PATH (see Setup above)

"File not found"

  • file=Name resolves like wikilinks (no path, no .md)
  • path=folder/file.md for exact paths

中文说明

前置条件

  • Obsidian 1.12+(免费公开版本)
  • Obsidian 必须运行中
  • 启用 CLI:设置 → 通用 → 启用 CLI

常用命令

obsidian daily                    # 打开今日日记
obsidian create name="笔记"       # 创建笔记
obsidian search query="关键词"    # 搜索
obsidian tasks daily todo         # 列出未完成任务
obsidian tags counts              # 列出标签

推荐文章

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

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

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

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

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

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

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

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

2026.10.24 1,001
PHP集成RabbitMQ实现消息队列的完整步骤

使用 php-amqplib 库,通过建立连接、声明交换机与队列并绑定,即可在 PHP 中实现消息的发送与消费。

2026.05.24 1,001
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
Skill 文件
  • SKILL.md
    • Obsidian Official CLI
    • Prerequisites
    • Setup
    • Syntax
    • Common Commands (with examples)
      • Daily Notes
      • Files
      • Search
      • Tasks
      • Tags & Properties
      • Links
      • Developer
    • All Commands (115 total)
      • General (4)
      • Daily Notes (5)
      • Files & Folders (12)
      • Search (3)
      • Tasks (2)
      • Tags (2)
      • Properties (4)
      • Aliases (1)
      • Links (5)
      • Outline (1)
      • Bookmarks (2)
      • Bases / Database (4)
      • Templates (3)
      • Commands & Hotkeys (4)
      • Tabs & Workspaces (7)
      • File History & Diff (6)
      • Sync (7)
      • Publish (6)
      • Themes & Snippets (9)
      • Plugins (9)
      • Vault (3)
      • Random Notes (2)
      • Unique Notes (1)
      • Web Viewer (1)
      • Word Count (1)
      • Recently Opened (1)
      • Developer (10)
    • Troubleshooting
    • 中文说明
      • 前置条件
      • 常用命令
  • 项目或源文件

相关 Skill

更多
obsidian-cli-skills obsidian-cli-skills Obsidian CLI 工具,支持通过命令行管理 Obsidian 知识库,包括笔记创建、搜索、移动(自动更新 Wiki 链接)、删除、frontmatter 编辑及日记等功能。
Obsidian Remote Obsidian Remote 通过内置的 Obsidian CLI 完全控制正在运行的 Obsidian 桌面应用,取代旧版随 OpenClaw 打包的 obsidian-cli 技能——
Obsidian CLI Obsidian CLI 用于官方 Obsidian CLI(v1.12+)的技能,实现完整的保险库自动化,包括文件、每日笔记、搜索、任务、标签、属性、链接、书签、基础等。
Obsidian Official CLI Skill Obsidian Official CLI Skill 使用官方 Obsidian CLI (v1.12+) 操作 Obsidian 保险库。在终端打开、搜索、创建、移动和管理笔记。适用于笔记管理、文件操作、内容搜索、任务、属性、链接、插件、主题、同步等 Obsidian 命令行交互。
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.