Skip to content
Dogue edited this page Nov 2, 2023 · 9 revisions

Configuration

By default, Jottem stores all of your notes in .local/share/jottem inside your home directory. This can be overridden with the $JOTTEM_ROOT environment variable. The default location for the RocksDB index is in .cache/jottem, also inside your home directory. This can be overridden by setting the $JOTTEM_DB_PATH variable.

Jottem defaults to opening notes with vi due it being available on almost every Linux distro, however there is an implicit assumption that you have the $EDITOR variable set to whichever editor you prefer.

Smart Matching

In the sections below you will see that most of Jottem's subcommands take an argument that is sometimes referred to as a path. In this context a "path" can be a relative path to a note, such as foo/bar, or it can be simply a title for a note such as baz.

When creating a new note, PATH is treated as a relative path, meaning that create foo will create a note titled foo in the root notes folder, whereas create foo/bar will create a folder called foo and then create a note called bar inside of it.

With subcommands that act on existing notes, PATH can be a title or a relative path and Jottem will match it to existing notes correctly. This means that if you wish to edit a note stored at foo/bar, you need only type edit bar and Jottem will open the correct note.

Disambiguation

Jottem does not enforce that notes have unique titles (aside from the filesystem limitation that you can't have two files with the same name in the same place). This means that you could have multiple notes with identical titles such as foo/bar and baz/bar. In this case, if you were to run edit bar, Jottem will prompt you to select one of the matches interactively. This behavior is present for all commands that take a single existing note as an argument.

Usage

Creating notes

# create a note called "foo" in the root notes folder
jottem create foo

# create a note called "baz" inside a subdirectory called "bar"
jottem create bar/baz

Editing notes

If you attempt to edit a note that doesn't yet exist, Jottem will interactively prompt you to create it if you wish. Running jottem edit without providing an argument will run an interactive prompt to choose a note with fuzzy search.

# edit a note called "foo", even if it's inside a subdirectory
jottem edit foo

# choose a note to edit using a fuzzy finder prompt
jottem edit

Deleting notes

Deleting notes works as you might expect. There is no trash or undo, so use care.

# delete a note called "foo"
jottem delete foo

Finding notes

Searching for notes can be done either by relative path/title, or by tags. You can also simply list all notes.

# find a note by its title
jottem find -p foo

# find a note by its relative path
jottem find -p bar/baz

# find all notes that have the "foo" tag
jottem find -t foo

# list all notes
jottem find -a

Managing tags

Tags can be added to a new note during creation, or modified after creation.

# setting tags when creating a note
jottem create foo --tags bar,baz

# adding tags to an existing note
jottem tag add foo bar,baz

# removing tags from a note
jottem tag remove foo bar,baz

Moving and renaming notes

Notes can be moved or renamed using the move subcommand.

# move a note to a different subdir
jottem move foo/bar baz/bar

# rename a note in place without moving
jottem move --rename foo/bar baz

Exporting the index

The index database can be exported as JSON data. This currently doesn't have a use other than as a past debugging tool, but I believe in not holding data hostage, so I left it in. It may come into play as part of a backup system in the future.

# export the index and pretty print it with jq
jottem export | jq .