Project

joplin

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
joplin API - joplin api tool, jp database tool
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.0
~> 3.12.0
~> 2.0

Runtime

~> 1.1.0
~> 6.0.0
~> 0.7.2
~> 6.0.3
~> 2.9.4
~> 1.5.0
 Project Readme

Joplin

usage

Creating a note

Joplin::token = "your joplintoken here copied from the webclippper settings"

begin
  note = Joplin::Note.new
  note.title = "a new note"
  note.body = "markdown content"
  note.save!
rescue
  puts "Joplin not running?"
end

updating a note

  note = Joplin::Note.new id: "6e3811c7a73148a" # note id can be found in the information of any note
  note.title = "a new note title"
  note.save!

A note on the token

If you've got joplin installed, you can do:

require "joplin/token"
token = Joplin::Token.get

to get the token programatically. It reads from the sqlite database located in ~/.config/joplin-desktop

Saving to a specific notebook

You can specify the id of the notebook

  note = Joplin::Note.new parent_id: 'c5e6827be8c946c78210d3508cce7ea6'

CLI

jp

A general purpose Joplin utility that interacts directly with the Joplin database. It uses the JOPLIN_DATA_DIR environment variable to locate the database.

Usage:
  jp COMMAND [ARGS]

Commands:
  jp add NOTEBOOK [BODY...]                          # Add a note
  jp bkup                                            # Backup the database
  jp cal [DATE]                                      # Show calendar
  jp cat TARGET...                                   # Display note content
  jp edit TARGET                                     # Edit a note or tag stack
  jp export PATH                                     # Export notes as Markdown with front matter
  jp flashback [DATE]                                # Show notes from this day in previous years
  jp help [COMMAND]                                  # Describe available commands or one specific command
  jp info                                            # Show JP and Joplin profile information
  jp init SUBCOMMAND                                 # Print shell integration code
  jp journal [today|yesterday|YYYY-MM-DD] [TEXT...]  # Append to a daily journal note; omit DATE for today
  jp log [DATE] [SLICE]                              # Show log
  jp ls [TARGET]                                     # List notebooks, notes, or tags
  jp mv SOURCE DESTINATION                           # Rename a notebook or tag
  jp random                                          # Display a random note
  jp rm TARGET                                       # Move a note or notebook to Trash, or recursively remove a tag
  jp search QUERY                                    # Search notes for text
  jp settings SUBCOMMAND                             # Manage settings
  jp test                                            # Run tests
  jp trash SUBCOMMAND                                # Manage trashed notes and notebooks
  jp tree                                            # Print a tree of all available commands
  jp version                                         # Show version

jp export PATH preserves the notebook hierarchy, writes note metadata as YAML front matter, copies referenced resources, and rewrites resource links. Pass --no-resources (-N) to export Markdown without copying resources.

On macOS, new notes and journal entries include the current coordinates when CoreLocationCLI is installed and location access is allowed. Set CORE_LOCATION_CLI to an executable path to use a non-default installation, or to an empty string to disable location lookup.

Triggered reminders for incomplete to-dos are shown before normal command output. Raw note output and shell completion do not include these warnings.

joplin

Commands that interact with Joplin via the API.

Commands:
  joplin build           # build a note from a note containing references
  joplin clean           # clean unused resources
  joplin epub            # build a note from a note (help build), write the note, and create an epub
  joplin help [COMMAND]  # Describe available commands or one specific command
  joplin nb2n            # concate all notes in a notebook to one note. Possible PDF export
  joplin resource        # get resource for note
  joplin stats           # statistics on joplin data
  joplin tree            # Print a tree of all available commands
  joplin version         # get version of program
  joplin write           # write a note

Options:
  [--token=TOKEN]

joplin nb2n --token 'notebook name'

Will take a notebook and concatenate all notes into one for easy export to PDF

The token argument is optional and if you have it installed locally it will find the token

joplin epub

This will generate an epub from the referenced notes in the note. It will not include the actual note, but only linked markdown notes within. Rendering things like tables, mermaid diagrams etc is not supported