---
title: OTask OmniFocus CLI is back (for now)
date: 2014-04-14 08:00
slug: otask-omnifocus-cli-is-back-for-now
categories:
- Code
tags:
- cli
- omnifocus
- otask
- productivity
---

![](https://brettterpstra.com/uploads/2014/04/otaskscreenshot.png)

It's been a nerdy weekend. Surprise.

I usually use [TaskPaper](http://www.hogbaysoftware.com/products/taskpaper) when working on coding projects, and I have an array of tools for working with it from the command line. Every once in a while I do need to add a task to [OmniFocus](https://www.omnigroup.com/omnifocus) (where I keep my non-coding todo lists) too, though. I used to use my script "OTask" for that, but it's been neglected since Mavericks came out and wasn't working for me anymore.

I've updated the script to work with Ruby 2.0 (which comes with Mavericks), and made the intallation much easier by packaging it up as a gem. You can just run `gem install otask` in Terminal to get started (may require `sudo gem install otask`). It's not super-polished, but I got it to a point where it was working smoothly for me and thought I'd share.

**Note:** If you use Xcode 5.1 and have trouble installing the gem, see [this post for a fix.](http://kaspermunck.github.io/2014/03/fixing-clang-error/)

The reason the headline says "for now" is that this script was based on appscript, which is a [dead project](http://appscript.sourceforge.net/status.html) and its days of working on OS X are numbered. Still, it's working great right now on my Mavericks machine, so I'd say it's got a _little_ time left.

In a nutshell, OTask lets you add OmniFocus tasks directly from the command line, and optionally include project (#proj) and context (@cont) tags that will resolve to the closest matching project and context names. Add `d(tomorrow 3pm)` and a due date will be set. End the task with a space and an exclamation point to flag it (`otask "finish your dinner d(5pm) !"`). Anything in parenthesis besides a due date marker is considered to be a note and is added to the task's note section.

The details of the tool and its syntax are on the [OTask project page](/projects/otask/). It's been tested with OmniFocus _and_ OmniFocus 2, which you probably don't have yet. It will work when we all get there, though. If you do have the beta of OmniFocus 2 installed, it will default to using that, I believe. It is for me, anyway.

There's a Launchbar action in the project notes, and making one for Alfred would take 2 minutes. Both launchers already have OmniFocus scripts available, though, so I'm not spending much time on that.

If you're an I-like-the-command-line-but-I-still-need-OmniFocus kind of person, [check out OTask](/projects/otask).

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
