keith / reminders-cli

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

Question: Working on Alfred Workfow companion #80

Closed whazlewo closed 4 months ago

whazlewo commented 4 months ago

I'm thinking about how I could build an Alfred app workflow using your CLI. I love that you have a json format option, but I'm trying to figure out how you do the indexing in the terminal output. Is it safe to assume the ordering of the output is always the same (ie that the first result in the json output is "0")?

is it safe for me to always assume that ...

0: task 1
1: task 2
2: task 3

matches up exactly with the order of the json array when using --format json?

[
    { "title": "task 1" },
    { "title": "task 2" ),
    { "title": "task 3" )
]
keith commented 4 months ago

you should probably rely on this instead https://github.com/keith/reminders-cli/pull/55

whazlewo commented 4 months ago

Oh!! You can pass the externalId OR the array index as a parameter for completing, editing, and deleting items?? That is very cool.

keith commented 4 months ago

yep, as of that change that should work for the same reason you're worrying about