A command-line tool to manage YAML frontmatter properties in Obsidian markdown files. This utility provides a simple interface to read, add, modify, and delete properties from markdown file headers without manually editing the frontmatter block.
This tool uses uv for Python dependency management.
# Navigate to the project root
cd /path/to/umabotools
# Install dependencies with uv
uv sync
# Run the tool
uv run python tools/mdproperties/mdproperties.py --help
All dependencies are managed in pyproject.toml.
Display all properties in YAML format:
uv run python tools/mdproperties/mdproperties.py read path/to/file.md
Example output:
PARA: Resource
tags:
- obsidian
- howto
status: published
Show properties in a friendly format with indexed lists:
uv run python tools/mdproperties/mdproperties.py list path/to/file.md
Example output:
PARA: Resource
tags:
0: obsidian
1: howto
status: published
Create a new property. Comma-separated values become lists:
# Add a single value
uv run python tools/mdproperties/mdproperties.py add path/to/file.md author "John Doe"
# Add a list (comma-separated)
uv run python tools/mdproperties/mdproperties.py add path/to/file.md keywords "python, cli, obsidian"
Note: The command will fail if the property already exists. Use modify instead.
Update existing properties or manage list items:
# Change a single value
uv run python tools/mdproperties/mdproperties.py modify path/to/file.md PARA "Project"
# Replace with a list
uv run python tools/mdproperties/mdproperties.py modify path/to/file.md tags "new-tag1, new-tag2"
uv run python tools/mdproperties/mdproperties.py modify path/to/file.md tags --add "python"
# Remove by value
uv run python tools/mdproperties/mdproperties.py modify path/to/file.md tags --remove "python"
# Remove by index
uv run python tools/mdproperties/mdproperties.py modify path/to/file.md tags --remove 0
Remove a property entirely from the frontmatter:
uv run python tools/mdproperties/mdproperties.py delete path/to/file.md deprecated_field
The tool includes built-in support for the PARA method (Projects, Areas, Resources, Archives) commonly used in Obsidian knowledge management:
PARA property is set to "Resource" when creating new frontmattertags array is created by defaultmodify command# Create a new blog post with metadata
uv run python tools/mdproperties/mdproperties.py add blog.md PARA "Project"
uv run python tools/mdproperties/mdproperties.py add blog.md tags "blog, writing"
uv run python tools/mdproperties/mdproperties.py add blog.md status "draft"
# Update as you progress
uv run python tools/mdproperties/mdproperties.py modify blog.md status "review"
uv run python tools/mdproperties/mdproperties.py modify blog.md tags --add "published"
# Check your work
uv run python tools/mdproperties/mdproperties.py list blog.md
The tool works with standard YAML frontmatter delimited by ---:
---
PARA: Resource
tags:
- obsidian
- productivity
status: active
---
# Your Markdown Content
Regular markdown content goes here.
addThe project includes comprehensive test coverage using pytest:
# Run tests
uv run pytest tools/mdproperties/test_mdproperties.py
Tests cover: - Basic CRUD operations - Complex frontmatter structures - List operations (add/remove by index and value) - Error conditions - Confirmation workflows
| Command | Purpose | Example |
|---|---|---|
read |
Display YAML frontmatter | read file.md |
list |
Show indexed properties | list file.md |
add |
Create new property | add file.md key value |
modify |
Update property | modify file.md key value |
modify --add |
Add to list | modify file.md tags --add newtag |
modify --remove |
Remove from list | modify file.md tags --remove 0 |
delete |
Remove property | delete file.md key |
Full source code: umabotools/tools/mdproperties
This project is licensed under the MIT License.
InnovUmabot | https://innovumabot.com
This tool was vibe-coded with AI with strict human supervision.