| name | ofocus |
| description | Interact with OmniFocus on macOS via CLI. Manage tasks, projects, folders, tags, and perspectives using the ofocus command-line tool. |
OmniFocus CLI Skill
Use the ofocus CLI to interact with OmniFocus on macOS. When an agent runs it, machine output defaults to the token-efficient TOON encoding (the agent is auto-detected) — you do not need to pass --format toon.
Prerequisites
- macOS with OmniFocus installed
- Install:
npm install -g ofocus
Output Format
- Machine output defaults to TOON when an AI agent is detected (Claude Code, Cursor, Gemini CLI, …) — the same envelope as JSON (
success plus data or error) in ~40% fewer tokens, no fields dropped. You normally don't pass a format flag.
- Pass
--format json (or set $OFOCUS_FORMAT=json) when you need standard JSON — e.g. to pipe into a JSON tool like jq. An explicit --format always overrides detection.
--format ids emits one task ID per line (no envelope), for piping an --ids-only result into xargs.
--human is for human-readable display, not for parsing.
Command Quick Reference
Tasks
ofocus inbox <title> [--note <note>] [--due <due>] [--defer <defer>] [--flag] [--tags <val...>] [--estimated-minutes <estimatedMinutes>] [--repeat-frequency <repeatFrequency>] [--repeat-interval <repeatInterval>] [--repeat-method <repeatMethod>] [--repeat-days-of-week <val...>] [--repeat-day-of-month <repeatDayOfMonth>]
ofocus complete <taskId>
ofocus subtask <title> --parent-task-id <parentTaskId> [--note <note>] [--due <due>] [--defer <defer>] [--flag] [--tags <val...>] [--estimated-minutes <estimatedMinutes>]
ofocus defer <taskId> [--days <days>] [--to <to>]
ofocus delete <taskId>
ofocus template-delete <templateName>
ofocus drop <taskId>
ofocus duplicate <taskId> [--include-subtasks]
ofocus attachments <taskId>
ofocus perspectives
ofocus template-list
ofocus move-to-parent <taskId> --parent-task-id <parentTaskId>
ofocus deferred [--deferred-after <deferredAfter>] [--deferred-before <deferredBefore>] [--blocked-only] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
ofocus perspective <name> [--limit <limit>]
ofocus projects-for-review
ofocus subtasks <parentTaskId> [--completed] [--flagged] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
ofocus tasks [--project <project>] [--tag <tag>] [--tag-mode <tagMode>] [--folder <folder>] [--exclude-ids <val...>] [--flagged] [--not-flagged] [--completed] [--not-completed] [--dropped] [--not-dropped] [--blocked] [--available] [--in-inbox] [--has-due] [--no-due] [--has-defer] [--has-note] [--has-attachments] [--has-subtasks] [--has-repetition] [--effectively-completed] [--effectively-dropped] [--status <status>] [--due-before <dueBefore>] [--due-after <dueAfter>] [--due-on <dueOn>] [--due-within <dueWithin>] [--defer-before <deferBefore>] [--defer-after <deferAfter>] [--defer-on <deferOn>] [--defer-within <deferWithin>] [--completed-before <completedBefore>] [--completed-after <completedAfter>] [--estimate-lt <estimateLt>] [--estimate-gt <estimateGt>] [--estimate-eq <estimateEq>] [--name-contains <nameContains>] [--name-starts <nameStarts>] [--name-equals <nameEquals>] [--name-regex <nameRegex>] [--note-contains <noteContains>] [--note-regex <noteRegex>] [--case-sensitive] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--nulls-first] [--count] [--first] [--last] [--ids-only] [--group-by <groupBy>] [--stats] [--limit <limit>] [--offset <offset>] [--all]
ofocus quick <input> [--note <note>]
ofocus search <query> [--scope <scope>] [--include-completed] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
ofocus update <taskId> [--title <title>] [--note <note>] [--due <due>] [--defer <defer>] [--flag] [--project <project>] [--tags <val...>] [--estimated-minutes <estimatedMinutes>] [--clear-estimate] [--repeat <repeat>] [--clear-repeat]
Batch
ofocus complete-batch <taskIds...>
ofocus defer-batch <taskIds...> [--days <days>] [--to <to>]
ofocus delete-batch <taskIds...>
ofocus update-batch <taskIds...> [--title <title>] [--note <note>] [--due <due>] [--defer <defer>] [--flag] [--project <project>] [--tags <val...>] [--estimated-minutes <estimatedMinutes>]
Projects
ofocus create-project <name> [--note <note>] [--folder-id <folderId>] [--folder-name <folderName>] [--sequential] [--status <status>] [--due-date <dueDate>] [--defer-date <deferDate>]
ofocus delete-project <projectId>
ofocus drop-project <projectId>
ofocus projects [--folder <folder>] [--status <status>] [--sequential] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
ofocus update-project <projectId> [--name <name>] [--note <note>] [--status <status>] [--folder-id <folderId>] [--folder-name <folderName>] [--sequential] [--due-date <dueDate>] [--defer-date <deferDate>]
Folders
ofocus create-folder <name> [--parent-folder-id <parentFolderId>] [--parent-folder-name <parentFolderName>]
ofocus delete-folder <folderId>
ofocus folders [--parent <parent>] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
ofocus update-folder <folderId> [--name <name>] [--parent-folder-id <parentFolderId>] [--parent-folder-name <parentFolderName>]
Tags
ofocus create-tag <name> [--parent-tag-id <parentTagId>] [--parent-tag-name <parentTagName>]
ofocus delete-tag <tagId>
ofocus tags [--parent <parent>] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
ofocus update-tag <tagId> [--name <name>] [--parent-tag-id <parentTagId>] [--parent-tag-name <parentTagName>]
Forecast
ofocus forecast [--days <days>] [--include-deferred] [--fields <val...>] [--exclude-fields <val...>] [--sort <val...>] [--reverse] [--limit <limit>] [--offset <offset>] [--all]
Focus
ofocus focus <target> [--by-id]
ofocus focused
ofocus unfocus
Review
ofocus review <projectId>
Templates
ofocus template-create <templateName> [--project-name <projectName>] [--folder <folder>] [--base-date <baseDate>]
ofocus template-get <templateName>
ofocus template-save <name> <sourceProject> [--description <description>]
Attachments
ofocus attach <taskId> <filePath>
ofocus detach <taskId> <attachmentName>
Sync
ofocus sync-status
ofocus sync
TaskPaper
ofocus export [--project <project>] [--include-completed] [--include-dropped]
ofocus import-taskpaper --content <content> [--default-project <defaultProject>] [--create-projects]
Utilities
ofocus archive [--completed-before <completedBefore>] [--dropped-before <droppedBefore>] [--project <project>] [--dry-run]
ofocus compact
ofocus url <id>
ofocus stats [--project <project>] [--period <period>] [--since <since>] [--until <until>]
ofocus open <id>
Productivity
ofocus changes [--watch <watch>] [--fresh] [--pending] [--generation-since <generationSince>] [--reset] [--refresh-inline] [--semantic]
Other
ofocus apply-repetition <taskId> --frequency <frequency> [--interval <interval>] [--repeat-method <repeatMethod>] [--days-of-week <val...>] [--day-of-month <dayOfMonth>] [--days-of-week-positions <val...>] [--months-of-year <val...>]
ofocus clear-repetition <taskId>
ofocus eval [script] [--file <file>] [--args <args>]
Before using this tool, prefer the declarative commands (tasks, projects, folders, tags, forecast, search, deferred, etc.) with --filter, --sort, --fields, --group-by, --count — they cover the vast majority of queries with no scripting required.
If eval is genuinely necessary, narrate the intent in plain language first, then show the script — the user should be able to read the explanation and verify it matches the code before running it.
The script runs unsandboxed in the user's OmniFocus and can mutate any task, project, folder, tag, or perspective. Treat this like running shell code on the user's machine.
Scripts must end with a return <expression>; statement and are capped at 64 KB. The return value must be JSON-serializable. Errors from OmniJS are surfaced verbatim.
ofocus review-interval-get <projectId>
ofocus review-interval-set <projectId> --interval-days <intervalDays>
ofocus link <taskId> --event <event> [--type <type>] [--note <note>]
ofocus links [--task <task>] [--event-id <eventId>] [--prune]
ofocus next-actions
ofocus next-occurrences <taskId> [--count <count>] [--from <from>]
ofocus occurrences [--days <days>]
ofocus readiness --event-id <eventId> [--event <event>] [--now <now>]
ofocus resolve <query> [--kind <kind>] [-- <>]
ofocus stalled-projects
ofocus this-week
ofocus today
ofocus <taskId> --event-id <eventId> [-- <>]