Command line interface for Drafts

Hello!

Here’s my attempt at making a CLI for Drafts :slight_smile:

It is written in Go and currently supports:

  • Create draft (from argument or stdin)
  • Select draft via interactive search (using fzf)
  • Append/prepend to selected draft
  • Edit selected draft in $EDITOR

It’s not the smoothest user experience as each command essentially does a roundtrip to Drafts and back to the terminal. But it was a fun challenge to make it work. Some implementation details can be found in the GitHub readme for the curious.

I set up an installation process using Homebrew, which I’ve tested on an M1 Mac. Should work on Intel as well, but would be great if someone can confirm this.

4 Likes

Worked on my M1 work machine, will test on my Intel Mac later tonight.

1 Like

Works on my M2 pro.

Is it possible to run a Drafts action from the CLI?

No, might be easy to add though.

1 Like