跳到正文
Skillpedia
任务与项目58k · #3233

cli-anything-obsidian

它能做什么

这个技能让 AI 智能体处理你的 Obsidian 笔记,这些笔记以文件形式保存在库中。适合把知识和写作内容保存在 Obsidian 中的人。

适用场景

  • ✓当你想让智能体为现有笔记添加摘要或新段落的时候。
  • ✓当你需要在笔记库中搜索某个主题相关笔记的时候。
  • ✓当你想根据你和智能体共同写好的草稿创建新笔记的时候。

技能链接

https://github.com/HKUDS/CLI-Anything/blob/main/obsidian/agent-harness/cli_anything/obsidian/skills/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/HKUDS/CLI-Anything/blob/main/obsidian/agent-harness/cli_anything/obsidian/skills/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我在 Obsidian 库中搜索关于预算的笔记,并在我的月度回顾笔记中添加一份摘要。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体向你电脑上的 Obsidian Local REST API 发送请求,因此可以读取、写入和搜索笔记。Obsidian 必须处于打开状态,并启用该插件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

cli-anything-obsidian

Knowledge management and note-taking via the Obsidian Local REST API. Designed for AI agents and power users who need to manage notes, search the vault, and execute commands without the GUI.

Installation

This CLI is installed as part of the cli-anything-obsidian package:

pip install cli-anything-obsidian

Prerequisites:

Usage

Basic Commands

# Show help
cli-anything-obsidian --help

# Start interactive REPL mode
cli-anything-obsidian

# List vault files
cli-anything-obsidian vault list

# Run with JSON output (for agent consumption)
cli-anything-obsidian --json vault list

REPL Mode

When invoked without a subcommand, the CLI enters an interactive REPL session:

cli-anything-obsidian
# Enter commands interactively with tab-completion and history

Command Groups

Vault

Vault file management commands.

Command Description
list List files in the vault or a subdirectory
read Read the content of a note
create Create a new note
update Overwrite an existing note
delete Delete a note from the vault
append Append content to an existing note

Search

Vault search commands.

Command Description
query Search using Obsidian query syntax
simple Plain text search across the vault

Note

Active note commands.

Command Description
active Get the currently active note in Obsidian
open Open a note in the Obsidian editor

Command

Obsidian command palette commands.

Command Description
list List all available Obsidian commands
execute Execute a command by its ID

Server

Server status and info commands.

Command Description
status Check if the Obsidian Local REST API is running

Session

Session state commands.

Command Description
status Show current session state

Examples

List and Read Notes

# List all vault files
cli-anything-obsidian vault list

# List files in a subdirectory
cli-anything-obsidian vault list "Daily Notes"

# Read a note
cli-anything-obsidian vault read "Projects/my-project.md"

Create and Update Notes

# Create a new note
cli-anything-obsidian vault create "Projects/new-project.md" --content "# New Project"

# Update (overwrite) a note
cli-anything-obsidian vault update "Projects/new-project.md" --content "# Updated Content"

# Append to a note
cli-anything-obsidian vault append "Projects/new-project.md" --content "\n## New Section"

Search

# Plain text search (GET /search/simple/)
cli-anything-obsidian search simple "meeting notes"

# Dataview DQL query — default --type dql, sent as
# application/vnd.olrapi.dataview.dql+txt
cli-anything-obsidian search query 'TABLE file.link FROM "Projects"'

# JsonLogic query — application/vnd.olrapi.jsonlogic+json
cli-anything-obsidian search query --type jsonlogic \
  '{"==":[{"var":"frontmatter.status"},"active"]}'

Commands

# List available commands
cli-anything-obsidian command list

# Execute a command by ID
cli-anything-obsidian command execute "editor:toggle-bold"

Interactive REPL Session

Start an interactive session for exploratory use.

cli-anything-obsidian
# Enter commands interactively
# Use 'help' to see available commands

API Key Configuration

# Via flag
cli-anything-obsidian --api-key YOUR_KEY vault list

# Via environment variable (recommended for agents)
export OBSIDIAN_API_KEY=YOUR_KEY
cli-anything-obsidian vault list

State Management

The CLI maintains lightweight session state:

  • API key: Configurable via --api-key or OBSIDIAN_API_KEY environment variable
  • Host URL: Defaults to https://localhost:27124; configurable via --host

Output Formats

All commands support dual output modes:

  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (--json flag): Structured JSON for agent consumption
# Human output
cli-anything-obsidian vault list

# JSON output for agents
cli-anything-obsidian --json vault list

Fo

常见问题

运行它需要什么处于运行状态?

Obsidian 必须处于打开状态,并且 Local REST API 插件必须已启用。

它可以删除笔记吗?

可以。delete 命令会从库中删除笔记,因此请谨慎使用。

它可以运行 Obsidian 命令吗?

可以。说明中提到,该工具无需图形应用即可运行命令。

详情

作者的原始描述

Command-line interface for Obsidian — Knowledge management and note-taking via Obsidian Local REST API. Designed for AI agents and power users who need to manage notes, search the vault, and execute commands without the GUI.

repo: HKUDS/CLI-Anything

热度

GitHub 星标
58k
排名
#3233
许可证
Apache-2.0
更新时间
2026/9/21

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能