CLI-Anything >-
install
source · Clone the upstream repo
git clone https://github.com/HKUDS/CLI-Anything
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/HKUDS/CLI-Anything "$T" && mkdir -p ~/.claude/skills && cp -r "$T/obsidian/agent-harness/cli_anything/obsidian/skills" ~/.claude/skills/hkuds-cli-anything-4dc290 && rm -rf "$T"
manifest:
obsidian/agent-harness/cli_anything/obsidian/skills/SKILL.mdsource content
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:
- Python 3.10+
- Obsidian must be installed and running with the Local REST API plugin enabled
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 files in the vault or a subdirectory |
| Read the content of a note |
| Create a new note |
| Overwrite an existing note |
| Delete a note from the vault |
| Append content to an existing note |
Search
Vault search commands.
| Command | Description |
|---|---|
| Search using Obsidian query syntax |
| Plain text search across the vault |
Note
Active note commands.
| Command | Description |
|---|---|
| Get the currently active note in Obsidian |
| Open a note in the Obsidian editor |
Command
Obsidian command palette commands.
| Command | Description |
|---|---|
| List all available Obsidian commands |
| Execute a command by its ID |
Server
Server status and info commands.
| Command | Description |
|---|---|
| Check if the Obsidian Local REST API is running |
Session
Session state commands.
| Command | Description |
|---|---|
| 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 cli-anything-obsidian search simple "meeting notes" # Obsidian query syntax search (tags, links, etc.) cli-anything-obsidian search query "tag:#project"
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
or--api-key
environment variableOBSIDIAN_API_KEY - Host URL: Defaults to
; configurable viahttps://localhost:27124--host
Output Formats
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (
flag): Structured JSON for agent consumption--json
# Human output cli-anything-obsidian vault list # JSON output for agents cli-anything-obsidian --json vault list
For AI Agents
When using this CLI programmatically:
- Always use
flag for parseable output--json - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Set
environment variable to avoid passingOBSIDIAN_API_KEY
on every call--api-key - Verify Obsidian is running with
before other commandsserver status
More Information
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
Version
1.0.0