Skip to content

Repository files navigation

Obsidian Auto-Processor

Automatically process notes in watched folders using OpenAI's GPT-5 API with custom slash commands. Monitor specific folders, detect new notes, run them through configurable command chains, and save processed outputs for review.

Features

  • 🤖 GPT-5 Powered - Uses OpenAI's latest GPT-5 models (mini, nano, or full)
  • 📁 Folder Watching - Automatically process new notes in specified folders
  • ⛓️ Command Chains - Run up to 3 commands in sequence with reasoning context preservation
  • 💰 Cost Tracking - Monitor API costs with monthly budget alerts
  • 🎯 Custom Commands - Parse and use your own slash command library from markdown
  • ⚙️ Flexible Configuration - Per-folder settings for model, reasoning effort, and verbosity

Installation

From Release

  1. Download the latest release from the releases page
  2. Extract files to <vault>/.obsidian/plugins/auto-processor/
  3. Reload Obsidian
  4. Enable the plugin in Settings → Community Plugins

From Source

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

    cd <vault>/.obsidian/plugins
    git clone https://github.com/yourusername/obsidian-auto-processor.git
  2. Install dependencies:

    cd obsidian-auto-processor
    npm install
  3. Build the plugin:

    npm run build
  4. Reload Obsidian and enable the plugin

Setup

1. Configure API Key

  1. Go to Settings → Auto-Processor
  2. Enter your OpenAI API key (starts with sk-)
  3. Click "Test" to verify connection

2. Load Command Library

  1. Create or use an existing slash command markdown file
  2. Format commands like this:
### /script60
**Label:** 60-second Explainer
**Category:** Structure
**Prompt:**
> Transform {{insert idea}} into a compelling 60-second explainer script.
> Focus on clarity and engagement.

---

### /punchup
**Label:** Add Punch
**Category:** Enhancement
**Prompt:**
> Add rhythm and punch to {{paste}}. Make it more engaging and dynamic.
  1. In settings, set "Library File Path" to your markdown file
  2. Click "Reload" to import commands

3. Create Watch Folder

  1. Click "+ Add Watch Folder"

  2. Configure:

    • Input Folder: Where to watch for new files (e.g., Inbox/Raw Scripts)
    • Output Folder: Where to save processed files (e.g., Processed/Review)
    • Command Chain: Comma-separated command names (e.g., script60, punchup, qprompt)
    • Enabled: Toggle to activate/deactivate
  3. Save settings

Usage

Automatic Processing

When enabled, any new markdown file added to a watched folder will be automatically processed through its command chain.

Manual Processing

Use the command palette (Ctrl/Cmd + P):

  • Process current file - Run the active file through configured commands
  • Reload command library - Refresh command definitions
  • Toggle auto-processing - Enable/disable automatic processing

Output Format

Processed files are saved with _processed.md suffix and include:

---
source: original-filename
processed: 2025-10-09T12:00:00.000Z
commands: script60 → punchup → qprompt
total_cost: $0.0124
status: success
---

# original-filename (Processed)

[Final output from last command in chain]

---

## Processing Details

### Step 1: /script60
**Cost:** $0.0042
**Tokens:** 150 input → 450 output (120 reasoning)

<details>
<summary>View Output</summary>

[Step 1 output]

</details>

[Additional steps...]

Configuration Options

API Settings

  • Model: Choose between gpt-5, gpt-5-mini (default), or gpt-5-nano
  • Reasoning Effort: minimal, low (default), medium, high
  • Verbosity: low, medium (default), high
  • Max Output Tokens: Maximum response length (default: 2000)

Cost Tracking

  • View current month spending vs. budget
  • Set monthly budget limit for warnings
  • Per-command cost breakdown in outputs

Processing Options

  • Auto-process new files: Enable/disable automatic processing
  • Show completion notifications: Display notices when processing completes

Cost Optimization

Target cost per note: $0.003-0.008

Tips:

  • Use gpt-5-mini for most tasks (75% cheaper than gpt-5)
  • Set reasoning effort to low for simple transformations
  • Use medium verbosity to balance detail and cost
  • Limit command chains to 3 steps or fewer

Development

Build Commands

# Development mode (watch for changes)
npm run dev

# Production build
npm run build

Project Structure

src/
├── main.ts                 # Plugin entry point
├── settings.ts             # Data models & defaults
├── watcher.ts              # Folder monitoring
├── processor.ts            # Command chain execution
├── commandLibrary.ts       # Markdown parser
├── ui/
│   └── settingsTab.ts      # Settings interface
└── utils/
    ├── gpt5Client.ts       # API wrapper
    └── templateParser.ts   # Variable replacement

Troubleshooting

API Connection Failed

  • Verify your API key is correct
  • Check internet connection
  • Ensure you have OpenAI API credits

Commands Not Loading

  • Check library file path is correct
  • Verify markdown format matches expected structure
  • Look for console errors in Developer Tools (Ctrl/Cmd + Shift + I)

File Not Processing

  • Confirm folder path uses forward slashes (e.g., Inbox/Raw not Inbox\Raw)
  • Check that command names in chain match library exactly
  • Ensure auto-processing is enabled
  • Verify file is markdown (.md)

Budget Exceeded Warning

  • Review cost tracking in settings
  • Consider using gpt-5-nano for lower costs
  • Reduce max_output_tokens setting
  • Lower reasoning effort to minimal or low

License

MIT

Support

For issues, feature requests, or questions:


Built with ❤️ for Obsidian

About

MindMill - Obsidian plugin for AI-powered content processing with GPT-5

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages