obsidian-metadator

Metadator

Automatically generate metadata for your Obsidian notes using Claude AI from Anthropic. The plugin analyzes your note content and generates tags, descriptions, and titles—with full customization for your workflow.

Features

Installation

From Source (Development)

  1. Clone this repository into your vault’s plugins folder:

    cd /path/to/vault/.obsidian/plugins
    git clone https://github.com/markayers/metadator.git
    cd metadator
    
  2. Install dependencies with Bun:

    bun install
    
  3. Build the plugin:

    bun run build
    
  4. Enable the plugin in Obsidian: Settings → Community Plugins → Metadator

Quick Start

Test the Plugin Immediately

A test Obsidian vault is already configured in this project directory.

  1. Open the vault in Obsidian
    • Launch Obsidian
    • Click “Open folder as vault” (or “Open another vault”)
    • Navigate to and select this project directory
    • Obsidian will open with the plugin already loaded
  2. Configure your API key
    • Get an API key: Go to console.anthropic.com
    • Sign up or log in with billing enabled
    • Create a new API key
    • In Obsidian, go to Settings → Metadator
    • Paste your API key in the “API Key” field
  3. Test with sample notes
    • Open Sample Note 1.md (about Obsidian)
    • Press Cmd/Ctrl + P to open Command Palette
    • Type “metadata” and select “Generate metadata for current note”
    • Watch the plugin analyze content and update frontmatter
    • Try Sample Note 2.md and Sample Note 3.md for other examples
  4. Reload changes during development
    • After making code changes, run bun run dev for watch mode
    • In Obsidian, press Cmd/Ctrl + R to reload the plugin

Configuration

Metadata Settings

API Settings

Update Method

Content Truncation

Enable to reduce API costs on large notes:

Token Counting Note: The plugin uses a simplified token counter that handles English words, CJK characters (Chinese, Japanese, Korean), and punctuation. It may differ slightly from Claude’s actual tokenization (typically within 10-15%). If you set maxTokens: 1000, the plugin will send approximately 1000 tokens, but Claude might count slightly differently. To be conservative, set maxTokens lower than your comfort level.

Field Names

Customize what the frontmatter fields are called:

Prompts

Write custom instructions for Claude:

Custom Metadata

Add any additional metadata fields (e.g., author: Your Name, status: draft)

Usage

Generating Metadata for One Note

  1. Open a note you want to add metadata to
  2. Open Command Palette: Cmd/Ctrl + P
  3. Search for “Metadator” and select “Generate metadata for current note”
  4. Watch the plugin analyze your content and update the frontmatter

Example

Before:

---
---

# My Morning Routine

I wake up at 6am and start with a 20-minute meditation session. Then I exercise for 30
minutes, take a cold shower, and have a healthy breakfast. This routine has improved my
energy levels and focus throughout the day.

After:

---
tags:
  - habits
  - wellness
  - productivity
description: A morning routine focused on meditation, exercise, and nutrition to boost energy and focus
title: Morning Routine for Productivity
---

# My Morning Routine

[content unchanged...]

Development

Prerequisites

Setup

# Install dependencies
bun install

# Development mode (watch mode with inline source maps)
bun run dev

# Production build (minified, optimized)
bun run build

# Type checking
bun run typecheck

# Linting and formatting
bun run check
bun run format

# Full validation (types, lint, format, build)
bun run validate

# Run unit tests
bun run test

For detailed development, architecture, and build information, see DEVELOPMENT.md.

Security & Privacy

API Key Storage

Your Anthropic API key is stored in your Obsidian vault’s plugin data folder (~/.obsidian/plugins/metadator/data.json) in plain text. This is the standard way Obsidian plugins store settings, but be aware:

If you need higher security, consider using OS keychain integration (future enhancement—see CONCERNS.md #15).

Content Processing

Note content is sent to Anthropic’s Claude API for metadata generation. This means:

Troubleshooting

Plugin Not Loading

“Please configure your Anthropic API key”

“Authentication failed”

“Rate limit exceeded”

No Metadata Generated

Changes Not Appearing

Release

  1. Update version in package.json
  2. Run bun run version to sync versions and bun run validate to verify
  3. Commit and tag: git tag X.Y.Z && git push origin main --follow-tags
  4. GitHub Actions automatically creates release with artifacts

License

MIT

Contributing

Contributions are welcome! Please follow these guidelines:

Support

If you encounter issues or have questions:

  1. Check the troubleshooting section above
  2. Review the developer console for error details
  3. Open an issue on GitHub with details and error logs