vault_patch
Replace specific text in Obsidian vault files with automatic git commit tracking. Supports single or multiple surgical replacements while maintaining file integrity.
Instructions
Surgical text replacement in a vault file with auto git commit.
Supports single or multi-replacement. For single replacement, provide old_text and new_text. For multiple replacements, provide patches — a list of {old_text, new_text} dicts applied in sequence. Do not mix both modes.
Each old_text must appear exactly once in the file (after prior patches in the list have been applied). If any patch fails validation, no changes are written.
Args: project: Project slug or '_meta' for cross-project content. path: Relative path to the file within the project. old_text: Exact text to find and replace (single mode). Empty = not set. new_text: Replacement text (single mode). Empty = not set. patches: List of {old_text, new_text} dicts (multi mode).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| path | Yes | ||
| old_text | No | ||
| new_text | No | ||
| patches | No |