I’ve been meaning to create a command line utility for Hook.app for a while now. I’ve mentioned Hook before, but if you haven’t heard of it, it’s a powerful Mac productivity tool which creates and navigates links between documents, urls, and even things like OmniFocus tasks. I wanted to have some of its power in my terminal.
I created the
hook command to scratch this itch. It’s currently experimental, but I’d love it if any Hook users who happen to be command line lovers wanted to take it for a spin and let me know how it goes. You can find basic documentation and installation instructions on the project page. (Spoiler, it’s a Ruby gem you can install with
gem install hookapp).
It has a project page now, but if you’ll listen, I’ll tell you a little bit about it here…
This tool uses Hook’s AppleScript library to do its work. The library is still being developed and undergoing changes, so some features of the CLI are currently “aspirational.” As the library evolves, some of the less-useful commands it has may become the most useful. As a result, the CLI currently works great with files and paths, but not so great with
hook:// urls or urls from apps like MailMate, Bear, or Nvultra.1
There are subcommands for copying links to files, pasting them onto other files, cloning links between files, bidirectionally linking multiple files at once, removing hooks, and even selecting from available hooks on a file and opening them in their default application. And, of course, you can easily send a file to the Hook GUI. All of these are detailed by just running
You’ll note the delightful use of familiar system commands as aliases, e.g.
copy is also
link is also
ln, etc. It was built this way because Brett thought it was clever and for no other reason.
It’s actually just one missing detail (failure to store a title when copying a hook) that’s slowing it down there, and I’m told a fix is coming.↩