🏷 cli 🏷 knowledge-management
Fern is a lightweight tool for managing knowledge notes from the command line. I’d grown tired of the resource-hungry GUIs like Obsidian and LogSeq. I never used most features like the knowledge graph, whiteboards, or plugins. The fact that I couldn’t work on my notes without these programs was worrying. While they were using plain text markdown files, a lot would break should I want to switch to another app or the devs/company behind it decided they wouldn’t maintain it.
I had tried to use a few Vim plugins on and off for Markdown and linking, but I never managed to get a decent setup that I was happy with. There was the performance overhead I’d incur with these, often larger size, plugins running whenever Markdown files were open. Lastly, I realized my text editor needn’t be responsible for managing notes. Let the text editor handle the editing and leave the management, searching, and linking to another tool!
With this in mind, I carved out a few days to try and hack out a tool that I could:
- It works with plain Markdown files with as little imposed structure as possible.
- It can be understood by a single developer quickly.
- It is runnable from any UNIX-based OS and only supports cross-platform compatible features.
- It should allow a user to open and search for files.
- It runs on resource-constrained systems.
A Quick Overview
Installing Fern is simple! Just clone the repository, run the installation script, and initialize your first Fern Vault.
$ ./install.sh
$ fern vault create <path_to_vault>
Fern operates as an executable shell script in the local user’s bin directory and invoked with a target object of interest, an action to take, and any arguments needed:
fern OBJECT [ACTION [ARGS...]]
Fern is a Swiss Army knife tool that operates a “Vault” for the user. This Vault holds a few types of files: Notes, Journals, and Templates.
Fern Notes
For most users, notes could be something they use to keep information on similar topics or project details organized. There’s no expectation of what should be kept in files or how links need to be expressed. Users can use Markdown links, wiki-style links, or even footnotes. Fern does not care.
Daily Journal
Journals are files organized by date, like a daily journal or engineer’s log. It’s another way to structure the flow of note-taking. Journal entries are opened with a select keywords for commonly used dates (“today”, “tomorrow”, or “yesterday”) or by passing a specific date string (i.e., YYYY-MM-DD
). Users are free to use Notes or Journals alone or both together. For my note-taking, journals are where I tend to dump the stream of ideas, random notes, and other things like to-dos that come up throughout my day. Later, I go back through a journal and organize items into separate notes if needed.
Templates to save time
The last piece of the Fern Vault is Templates. These user-created files serve as templates for future Notes, saving users time pre-populating notes they create more frequently with similar boilerplate content. Fern requires a single template file for new Journals titled daily-journal.md
. This file is setup with all new Vaults as an empty file. Users can add their templates as needed.
Finding Vault Information
Creating notes and opening them is useless if you cannot find the right file or the internal information again easily. Fern offers a few ways to help there.
Bookmarks
Bookmarks can be added and removed for files that you want to easily reference the filenames of when you need to open them. Today, Bookmarks only apply to Notes, as dates are much more accessible thanks to all having the same YYYY-MM-DD
file naming. Notes can be anything, and thus, I felt they needed a way to more easily track the filenames that were often used. Displaying a list of Bookmarks allows users to find the file of interest and then open that file with a second command.
Search
Fern offers a grep-backed search for your notes and journals. It supports regex patterns for searching. There are two “modes” for searching. Quiet mode, the default, avoids overwhelming users with too much output on broader searches or those with many hits, returning only a list of files matching the pattern. Verbose mode, set by passing the --verbose
flag, displays the matching contents of the search along with the line numbers to help users better find their file of interest at the cost of more output text.
What’s next for Fern?
As of the time of writing, Fern (v0.0.8
) is a tiny sapling. I am hoping to add more features, especially around:
- bug fixes and further stabilize the core features
- support for managing multiple Vaults
- more useful search tools
- improve the overall UX
- have templates be injectable into a note or journal.
- expand OS support to Plan 9 (9 Front) and Windows (in that order).
If you want notices of new versions and changes, you can subscribe to the announcements mailing list: https://lists.sr.ht/~bugwhisperer/fern-announce.
If you need help installing or using Fern, please email the discussion mailing list, and I’ll be happy to help you: https://lists.sr.ht/~bugwhisperer/fern-discuss. Alternatively, you can feel free to DM me on Mastodon.