Get the FREE Ultimate OpenClaw Setup Guide →

obsidian-cli

Scanned
npx machina-cli add skill cwaits6/obsidian-cli-skill/obsidian-cli --openclaw
Files (1)
SKILL.md
7.3 KB

Obsidian CLI Skill

Batch automation of your Obsidian vault using the Obsidian CLI. Analyzes notes, assigns properties based on content, and orchestrates migrations, base creation, template generation, and other vault operations.

Instructions

  1. Read config first. Before any operation that depends on property schema, batch settings, or vault preferences, read the user's config:

    ~/.claude/plugins/marketplaces/obsidian-cli-skill/plugins/obsidian-cli/config.yaml
    

    If config.yaml does not exist, fall back to config.yaml.example in the same directory.

  2. Always consult reference files before constructing any command. Never guess syntax, parameter names, or examples. Commands use param=value parameters plus bare flags (total, verbose, silent). Avoid GNU-style --flag syntax except where Obsidian explicitly documents it as global behavior. Use the command routing table below to find the right reference.

  3. Propose before executing. Present changes for user review and get explicit approval before modifying any files. Follow output-format-standard.md for all output formatting.

  4. If a command isn't in the references, it may not exist. Consider native Obsidian workflows instead — see native-workflows.md.

Workflow

All operations follow this pattern:

  1. Analyze — Read notes/requirements and config.yaml
  2. Propose — Present changes for review (follow output format standard)
  3. Approve — User reviews and approves before any files are modified
  4. Execute — Run approved operations via Obsidian CLI

Approval mode is controlled by batch_settings.approval_mode in config.yaml:

  • batch — Approve the entire phase at once, then all operations execute without further prompts
  • single — Approve each note individually before proceeding

Batch splitting: If notes exceed batch_settings.max_batch_size, split into multiple batches — propose and get approval for each batch separately.

Command Routing

Before proposing any command, read the corresponding reference file:

OperationReference File
File create/read/move/deleteobsidian-cli-files.md
Property set/read/removeobsidian-cli-properties.md
Search, links, backlinksobsidian-cli-search.md
Bases (.base files)obsidian-cli-bases.md
Daily notesobsidian-cli-daily.md
Templatesobsidian-cli-templates.md
Publishobsidian-cli-publish.md
Pluginsobsidian-cli-plugins.md
Tags, aliasesobsidian-cli-tags-aliases.md
Tasksobsidian-cli-tasks.md
Vault info, foldersobsidian-cli-vault.md
Workspace, tabs, layoutsobsidian-cli-workspace.md
Web viewer, unique notesobsidian-cli-web-unique.md
All other operationscommand-routing.md

Workflows

Migrate and Enrich Notes

Two-phase workflow: property assignment → rename/move. Read config.yaml for batch and approval settings, then follow migration-workflow.md for the complete process, proposal formats, and rules.

Create Obsidian Bases

Read config.yaml for property schema, consult obsidian-bases.md for .base structure and CLI commands. Propose the base structure for approval before creating.

Generate Templater Templates

Consult templater-plugin.md for syntax and patterns. Propose template content for approval before creating.

Execution Strategy

For batch operations (>5 files), split reasoning from execution:

  1. Plan phase (current model): Read notes, analyze content, build the proposal, get user approval
  2. Execute phase: Delegate to the batch-executor agent to execute approved CLI commands. This agent runs on Haiku with Bash-only tool access for fast, low-cost execution.

The planning model handles all decisions. The execution agent receives a numbered list of pre-approved commands and runs them sequentially, reporting results per the output format standard.

For single-file operations or operations requiring judgment (e.g., choosing property values), execute directly without delegation.

Fallback: If subagent delegation is not available (e.g., on Claude.ai web), execute commands directly in sequence.

Error Handling

If an obsidian CLI command fails:

  1. Report the failure inline using the error format from the output format standard
  2. Continue with remaining operations — do not stop the entire batch for one failure
  3. Include all failures in the final summary
  4. If the CLI binary is not found, stop and tell the user to enable Obsidian CLI (requires Obsidian 1.12.1+)

Examples

User: "Migrate my Research notes to Notes with properties" Action: Read config.yaml → read all files in Research/ → analyze content → present compact property proposal → on approval, set properties → present rename & move proposal → on approval, move files. Follow migration-workflow.md.

User: "Add type: reference to all files in my Docs folder" Action: Read obsidian-cli-properties.md → list files in Docs/ → present proposal → on approval, run obsidian property:set for each file.

User: "Create a Base that shows all how-to notes by topic" Action: Read config.yaml for property schema → read obsidian-cli-bases.md → propose .base file structure → on approval, create the file.

Source

git clone https://github.com/cwaits6/obsidian-cli-skill/blob/main/plugins/obsidian-cli/skills/obsidian-cli/SKILL.mdView on GitHub

Overview

obsidian-cli batch-automates your Obsidian vault from the command line. It analyzes notes and vault config, assigns properties or frontmatter, creates Bases (.base files), generates templates, and performs bulk file operations, searches, and plugin/workspace management. All actions follow a config-driven, approval-based workflow to ensure safe, auditable vault changes.

How This Skill Works

The tool follows a Analyze-Propose-Approve-Execute funnel. It reads the vault config (config.yaml) and reference docs, determines required commands, and proposes changes in a structured format before executing. Commands use param=value parameters plus bare flags (total, verbose, silent); approvals are controlled by batch_settings.approval_mode and batch_size, with batch splitting for large operations.

When to Use It

  • Migrate or reorganize notes within an Obsidian vault
  • Assign properties or frontmatter to multiple notes consistently
  • Create Obsidian Bases (.base files) or templater templates for a vault
  • Bulk rename or move files, or perform batch vault operations
  • Search vault content, analyze links/backlinks, or manage plugins/themes/workspaces

Quick Start

  1. Step 1: Ensure config.yaml exists (or copy config.yaml.example) and review vault settings
  2. Step 2: Read the proposed changes from the Obsidian CLI and approve via the output format standard
  3. Step 3: Run Execute to apply changes to the vault using param=value commands with optional total/verbose/silent flags

Best Practices

  • Always read and validate config.yaml before running operations
  • Only propose changes and obtain explicit approval before execution
  • Use batch mode or single-item approval to control safety and rollback
  • Consult reference files (obsidian-cli-*.md) before constructing any command
  • Test on a small subset of notes before applying to the entire vault

Example Use Cases

  • Migrate notes to a new folder structure and update paths automatically
  • Tag or set frontmatter properties based on note content (e.g., status, type)
  • Generate a daily note template and create a Base for onboarding new vaults
  • Bulk rename notes to a consistent naming scheme and update links
  • Audit vault for broken links and organize plugins/workspaces

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers