npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nodejs-omnifocus-bridge

v0.1.1

Published

Standalone OmniFocus reader and CLI for local macOS installs and encrypted vaults.

Downloads

266

Readme

nodejs-omnifocus-bridge

nodejs-omnifocus-bridge is a read-only OmniFocus reader for Node.js and TypeScript.

It understands both OmniFocus database formats:

  • the local macOS database used directly by the OmniFocus app
  • the encrypted OmniFocus vault format used for synced and self-hosted setups

The package also recreates OmniFocus-style availability logic, so you can work with tasks the way OmniFocus presents them instead of just parsing raw XML.

What You Get

  • a library for reading OmniFocus data into structured JavaScript objects
  • a CLI for printing that data as JSON or as a terminal-friendly ASCII tree
  • snapshot helpers for available, remaining, completed, dropped, or all task views

The project is intentionally read-only. It does not modify OmniFocus data.

Requirements

  • Node.js 20+
  • macOS for direct access to the local OmniFocus container
  • encrypted vault reading also works on non-macOS systems

Install

Install the library in a project:

npm install nodejs-omnifocus-bridge

Run the CLI without a global install:

npx --package nodejs-omnifocus-bridge omnifocus-list --help

Or install the CLI globally:

npm install -g nodejs-omnifocus-bridge

CLI Quickstart

Show available tasks from the auto-detected source:

npx --package nodejs-omnifocus-bridge omnifocus-list --filter available

Read the local macOS database explicitly:

npx --package nodejs-omnifocus-bridge omnifocus-list --source local

Read an encrypted vault from disk:

OMNIFOCUS_PASSWORD="secret" npx --package nodejs-omnifocus-bridge omnifocus-list --source vault --path /path/to/OmniFocus.ofocus

Get structured JSON instead of the ASCII view:

npx --package nodejs-omnifocus-bridge omnifocus-list --json

CLI Options

  • --filter <available|remaining|dropped|completed|all>
  • --source <auto|local|vault>
  • --path <path>
  • --password <password>: supported, but avoid it because shell history and process lists can expose secrets
  • --base-only
  • --json
  • -h, --help
  • -v, --version

If a vault password is required and OMNIFOCUS_PASSWORD is not set, the CLI prompts for it in an interactive terminal.

Environment Variables

  • OMNIFOCUS_PASSWORD
  • OMNIFOCUS_LOCAL_PATH
  • OMNIFOCUS_VAULT_PATH

Auto mode resolves sources in this order:

  1. --path
  2. OMNIFOCUS_LOCAL_PATH
  3. OmniFocus 4 default macOS container path
  4. OmniFocus 3 default macOS container path
  5. OMNIFOCUS_VAULT_PATH

Library Quickstart

import {
  createSnapshot,
  readOmniFocus,
  renderTaskChart
} from "nodejs-omnifocus-bridge";

const document = await readOmniFocus({
  source: "local"
});

const snapshot = createSnapshot(document, "available");

console.log(`Available tasks: ${snapshot.filtered.tasks.length}`);
console.log(renderTaskChart(snapshot));

Examples And Reference

Example scripts included in this repository:

Public API

The root package export is intentionally focused on the main workflow:

  • readOmniFocus
  • resolveOmniFocusSource
  • createSnapshot
  • createContextTree
  • createInboxTree
  • createProjectTree
  • renderTaskChart

Advanced APIs are still available through explicit subpath imports:

import { OmniFocusDecryptor } from "nodejs-omnifocus-bridge/crypto";
import { TaskFilterService } from "nodejs-omnifocus-bridge/filter";
import { SaxOmniFocusParser } from "nodejs-omnifocus-bridge/parser";
import { OmniFocusReader } from "nodejs-omnifocus-bridge/reader";
import { LoggerService } from "nodejs-omnifocus-bridge/utils";

Security And Privacy

  • The tool reads OmniFocus data directly from your local filesystem; it does not send task data over the network.
  • For encrypted vaults, prefer OMNIFOCUS_PASSWORD or the interactive password prompt over --password.
  • Vaults are decrypted into a temporary directory while the command runs so the existing reader pipeline can process the files.
  • The temporary directory is removed after normal execution and on common termination signals such as SIGINT and SIGTERM.
  • If the process is force-killed, the operating system may leave temporary decrypted files behind in your temp directory.

macOS Permissions

If the CLI fails with EPERM or EACCES, give your terminal app:

  • Full Disk Access
  • Files and Folders access for the OmniFocus container path

This is especially common for:

  • ~/Library/Containers/com.omnigroup.OmniFocus4/Data/Library/Application Support/OmniFocus/OmniFocus.ofocus
  • ~/Library/Containers/com.omnigroup.OmniFocus3/Data/Library/Application Support/OmniFocus/OmniFocus.ofocus

After updating permissions, restart the terminal and try again.

Development

Useful local commands:

npm run check
npm run test:coverage
npm run cli:list -- --help