HappenApps / Quiver

Quiver documentation and issue tracker
2.26k stars 109 forks source link

[feature request] create new from CLI #1303

Open jlorince opened 5 years ago

jlorince commented 5 years ago

Being able to open notes from the command line using open "quiver:///notes/...." is great, but for scripting purposes it would be great if there was a similar mechanism to create a new note via the URL scheme as well. Is this possible/planned?

My specific use case is to programmatically create a new note to associate with a taskwarrior task from the CLI, but I can imagine lots of use cases for this.

ylian commented 5 years ago

There is a URL action for that already, currently used in Quiver Web Clipper.

URL Scheme

Quiver registers the quiver:// URL scheme which provides a few useful actions.

The format looks like this:

quiver://actions/[action]?param1=value1&param2=value2&...

All values should be URL encoded.

/create-note

Create a new note.

Parameters:

Example:

jlorince commented 5 years ago

Awesome thank you! Is there a way to specify which notebook it goes in?

ylian commented 5 years ago

No, not at the moment.

jlorince commented 5 years ago

Ok, so it look like it goes in the inbox by default. That will work for me for now (though adding support for choosing the notebook via URL params in the future would be great!). Thanks again!

jlorince commented 5 years ago

One last question @ylian. Is there a way to specify the ID of the note when creating it or otherwise programatically retrieve it? I can have have a script create a note but I don't know how I can then get a link to the note I created from the same script. Possible?

jlorince commented 5 years ago

(also is the full URL scheme documented anywhere?)

ylian commented 5 years ago

Hmm, you can't get the ID back since the URL scheme is one-way. Maybe I should allow sending in the note ID as an optional parameter.

The URL scheme is not yet documented since only the minimum has been implemented for the web clipper.

jlorince commented 5 years ago

Yeah that would be awesome. I imagine it would work best if create-note would create a new note with the specified UUID if it didn't already exist. If you called it again with the same UUID it would open that note. That way a shell script would be able to create and reference a note (without needing to create a two-way scheme that required a note-exists method or similar). +1 for sure