insanum / sncli

Simplenote CLI
MIT License
397 stars 35 forks source link

Command line tag API #45

Closed ashiklom closed 7 years ago

ashiklom commented 7 years ago

Syntax like this would be cool.

sncli tag set <key> "tag1"   # Note would be tagged with "tag1"
sncli tag get <key>   # Returns "tag1"
sncli tag set <key> "tag2"   # Note would be tagged with just "tag2"
sncli tag add <key> "tag3"   # Note would now be tagged as "tag2,tag3"
sncli tag rm <key> "tag2"    # Note would now be tagged as "tag3"

This could be implemented in stages:

I can take a stab at implementing this.

samuelallan72 commented 7 years ago

This does sound cool! I would say though that a tags interface as in issue #43 that allowed for viewing and managing tags would be more helpful to begin with perhaps?

Either way, whatever you work on, pull requests are welcome! This would require some major work I would say, which I don't have time to help out with at the moment unfortunately. All the best. :smile:

ashiklom commented 7 years ago

I would say though that a tags interface as in issue #43 that allowed for viewing and managing tags would be more helpful to begin with perhaps?

I see no reason we can't do both! I'm interested in this CLI version because I'd like to develop some bash shortcut programs for common tasks. For instance, I wrote a small bash script called sn-daily that searches for a note called <YYYY-MM-DD> -- Daily with tag daily and opens it for editing if it exists or creates it if it doesn't. I need the Tag API described here to create the note with the given tag.

This would require some major work I would say

The CLI API described here doesn't seem like such a big task, mostly because your code is already well organized :smile:. I've already implemented sncli -k <key> tag get in a local branch, and I have plan for implementing tag set, relying ~80-90% on your existing functions, which I'll do once I have a free half hour or so.

samuelallan72 commented 7 years ago

Oh ha of course - here's me thinking it would require more server requests :facepalm: (maybe I was thinking about the graphical tags interface at the time, which may be a larger task). Well we have @insanum to thank for the awesome codebase. :+1:

samuelallan72 commented 7 years ago

Implemented in PR #46