keith / reminders-cli

A simple CLI for interacting with macOS reminders
MIT License
663 stars 52 forks source link

add json output and expose external identifier #55

Closed nettleton closed 1 year ago

nettleton commented 1 year ago

This PR adds support for formatting the output in JSON format for easy scripting (#30). This is similar to #53 but adds a "--format" option to existing subcommands as I use the JSON output from add in some personal scripts (example).

$ reminders add MyList "some reminder" -f json | jq '.'
{
  "title": "some reminder",
  "isCompleted": false,
  "externalId": "BD2B26EF-38E1-40A7-90A4-C02ACA190145",
  "priority": 0,
  "list": "MyList"
}
  1. Extends the --format option to use the external id in place of index. I use the id for urls like "x-apple-reminderkit://REMCDReminder/$id" that open the specified reminder in the Reminders app, so being able to use the id directly instead of correlating to the array index makes things simpler.
$ reminders complete MyList BD2B26EF-38E1-40A7-90A4-C02ACA190145
Completed 'some reminder'
Kolsha commented 1 year ago

Hi! What is the status of this MR?

nettleton commented 1 year ago

@Kolsha , there seem to be 2 open PRs that add overlapping functionality (see #53). @keith - do you have a preference for one, the other, or something else?

keith commented 1 year ago

since that other one seems stalled I'm fine with going with this one

0xdevalias commented 1 year ago

since that other one seems stalled I'm fine with going with this one

While I had 'eventual' plans to get back to it, I'd definitely say landing this one sooner is the better choice. Then if I ever do get back around to it, I could just update my PR for whatever the current state of the codebase is at that time.

Kolsha commented 1 year ago

@keith, can we merge this?

keith commented 1 year ago

it requires some fixes first, at least for conflicts

nettleton commented 1 year ago

Sorry for the late response, I have resolved conflicts with main

0xdevalias commented 1 year ago

@keith What are the chances of getting this one landed now?

Kolsha commented 1 year ago

@keith ping

keith commented 1 year ago

thanks! FYI I'm moving some of this around afterwards in https://github.com/keith/reminders-cli/pull/60