OmniFocus DB CLI (omnifocus-db)

** Phase 1: Foundation & DB Safety

← Back to Projects


The Concept

OmniFocus 4’s AppleScript and app-based APIs are slow—too slow for AI agents that need instant context. OmniFocus DB bypasses these layers with direct SQLite database access, providing near-instant retrieval of projects and tasks in token-efficient formats optimized for agent consumption.

Quick Facts

   
Status ** Phase 1: Foundation & DB Safety
Language N/A
Started 2026

What This Is

A high-performance, low-latency CLI tool for direct database access to OmniFocus 4. Designed specifically for AI agent context and fast triaging, it bypasses slow AppleScript/TypeScript layers to read directly from the OmniFocus SQLite database.

Core Value

The Problem

Traditional OmniFocus Access:

For AI Agents:

The Solution

Direct SQLite Access:

Traditional Path:          Direct DB Path:
Agent  AppleScript        Agent  SQLite
   1000ms                    5ms
OmniFocus App             JSON Output
   500ms
XML/Text Output

Performance Improvement: ~200x faster for typical queries

Key Features

Lightning-Fast Queries

Agent-Optimized Output

Safety Mechanisms

MCP Integration

Use Cases

AI Agent Context:

$ omnifocus-db inbox --format json
{
  "inbox_count": 3,
  "items": [
    {"id": "abc123", "name": "Review PR #456", "added": "2026-02-13T10:30:00Z"},
    {"id": "def456", "name": "Book dentist appointment", "added": "2026-02-13T09:15:00Z"},
    {"id": "ghi789", "name": "Research Rust async patterns", "added": "2026-02-12T14:20:00Z"}
  ]
}

Fast Project Overview:

$ omnifocus-db projects --active --format compact
• Work (5 active)
  - Q1 Product Launch (3 tasks)
  - Documentation Update (2 tasks)
• Personal (2 active)
  - Home Renovation Planning (2 tasks)

Agent Triaging:

User: "What's urgent in my OmniFocus?"
Agent: [omnifocus-db query in 5ms]
Agent: "You have 3 flagged items due today: PR review, dentist appointment, and team standup prep."

Architecture

┌────────────────────────────────┐
    OmniFocus 4 Application     
         (Running)              
└────────┬───────────────────────┘
          Manages
         
┌────────────────────────────────┐
   OmniFocus.sqlite Database    
    ~/Library/Group Containers/ 
└────────┬───────────────────────┘
          Direct Read
         
┌────────────────────────────────┐
    omnifocus-db CLI            
    (Python + SQLite)           
└────────┬───────────────────────┘
         
    ┌────┼────┬─────────┐
                     
┌───▼──┐  ┌──▼───┐ ┌──▼────┐
 CLI     MCP   Future 
        Server  Web   
└──────┘  └──────┘ └───────┘
         
    ┌────▼─────┐
      Agents  
    (Claude)  
    └──────────┘

Tech Stack

Requirements

Active:

Out of Scope (v1):

Integration with Agents

Direct MCP Server:

# OmniFocus DB CLI (omnifocus-db)
from mcp import use_tool

inbox = use_tool("omnifocus_db", action="inbox")
# OmniFocus DB CLI (omnifocus-db)

Claude Desktop Integration:


← Back to Projects Development Philosophy