Joplin Terminal Application

Hi there,

after using Joplin Desktop and Android for quite some time, I've also started to use Joplin as a terminal application. I'm missing two things, maybe someone can help me:

  • How do I export (single notes) to pdf? Currently, only jex, raw, json, md, html seem to be available.
  • How do I reference other Notes? Would it be possible to copy the ID of the selected note s.t. I can paste it in the editor?

Thanks for your help. Really love Joplin! :slight_smile:

Hi! Were you able to find a solution to these? I'm also trying to move over to the terminal application.

Here is a possible solution that I could think of:

  1. You could export it in md format, and then use markdown-pdf to convert it to pdf.
  2. You can paste the id of the note into the editor like so: :/<note-id>. But there are a few issues with this:
    1. The link will open in your web-browser, not in joplin.
    2. You need the full note-id. The only way I know to get this is by using jq (a commandline json processor), usign a command similar to the following:
      • $ joplin ls -f "json" | jq -r '.[] | select(.title == "<note-name>") | .id' | xclip -selection clipboard, where <note-name> is the name of your note.
      • It's quite a long command, but this is what it does:
        • joplin ls -f "json" resturns all the notes with their IDs in json format
        • jq -r '.[] | select(.title == "<note-name>") | .id' gets the id corresponding to <note-name>
        • xclip -selection clipboard copies the id to your clipboard (at least on linux - there are similar commands for mac)
      • It's long, but you can assign aliases to make it shorter.

There's probably an easier way. I hope someone can enlighten us. But for now you can use this method. :slight_smile:

UPDATE:

I just created a bash function (you can put this in your .bashrc):

joplin-search () {
    arg="$1"
    joplin ls -f "json" | jq -r ".[] | select(.title == \"${arg}\") | .id" | xclip -selection clipboard
} 

Now, you can simply type joplin-search <note-name> to get the id.

Make sure you install the dependencies: jq and xclip.

Note:

This whole time I was ussiming you were using Linux. If you're using Mac, it shouldn't be too difficult to adapt this. If you're using Windows, I feel sorry for you :cry:.

Good luck and let me know if you need help.

1 Like

Hey, thanks for your ideas! I didn't find another solution and hence never committed to using the terminal application more. Being in fact a Linux user, maybe it's time to give if another try with your function. :slight_smile:

1 Like