Notewell - Command Line Notetaker

aka 'nw', 'notes', 'Nota Bene'

Richard Rathe, Oct 2025

My take on Yet Another CLI Note Taking App. Moving from MacOS to Linux I'm in the process of moving some of my most important textual information from Apple Notes to… ?? This Perl script is my first attempt at a do-it-yourself solution.

Notes Query Example
Notes Query Example

Basic Syntax

usage: notes [notebook]
usage: notes [notebook] [-ilmnr]
usage: notes —list
 help: notes —help

if no notebook is specified the default is used (see below)

Examples

notes [notebook]
notes [notebook] < mynotes.txt
notes [notebook] -m
notes http[s]://somewhere.com/some/page.html
notes [notebook] -r
notes [notebook] > out.txt
notes [notebook] | more
notes [notebook] -e
notes -flag
notes —command

Searching

Each notebook has an index based on fuzzy search codes (modified soundex). These codes lump word variations and similar sounding words together (eg, star, stars, and story all have the same code). This tends to broaden most searches a bit. However, searches use AND logic by default. This means that each note returned contains ALL if the search terms. You may override this behavior with the (+/-) modifiers discussed below. In addition, you should try synonyms if you are not finding what you expect (eg, cold instead of freezing).

notes [notebook] ? stars stripes
notes [notebook] ? stars +stripes
notes [notebook] ? stars -stripes
notes ?? stars stripes

Basic Setup

First, setup a directory to receive your notes (something like ~/Notes). Place the notes.pl script there and make it executable. To make it broadly available, create an alias in your preferred shell (nb, nw, notes, notewell, or something similar).

Then edit these global varibles to fit your system…

my $Root = '/home/userid/Notes';
my $Default = 'notes';
my $Editor  = 'edit';
my $Delim    = '=====';

You can also add or delete words from the %Skip hash…

my %Skip = (

To prime the system, issue the command to create the default notebook discussed above…

"notes —new"

Give it a name and title.

File Format

Notebooks are plain text files with the extension .notes. They each have a corresponding index file ending in .index. The first line should be a brief description of the notebook (eg, Default Notebook).

The actual notes are delimited by timestamp lines similar to this…

 ===== z7UnO Oct 20, 2025 20:11:05 userid ==========

Where z7UnO is the unique identifier for the note. This is generated randomly and should not repeat. The userid is the login name of the person who created the note. This leaves open the possibility of notebooks shared by several users. Notes may be complex and span several lines.

The modified soundex index has the format <code> <noteid>,<noteid>,…

9000 O7I1q
9900 iqRJX,z7UnO
A000 iqRJX,ue557,O7I1q
A160 iqRJX,O7I1q,uE476
A170 dISTL
A178 L6T7b,0moK0
A293 J53j8
…

The four letter code summarises the first four to ten characters of the word (vowels are ignored). Common plural forms are also ignored (eg, star and stars have the same code). The first letter must be a direct match so it is worth trying both C and K, etc. The first four digits of numbers are also indexed. This allows you to search for dates like 1917 directly. Shorter numbers will overlap: 9, 90, 900, 9000 are all coded the same.


This is a slide!