fern

command module
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

README

Fern

For all of your note-taking, journalling and knowledge management needs. Fern is simple terminal user interface(TUI) that lets you easily to create, edit, manage, link, and search a Vault of your personal notes and journals. It offers an alternative to heavier GUI-based note-taking management applications like Obsidian, Notion, and LogSeq. It was designed for systems that are resource constrained and also for users that prefer the terminal for getting things done quickly and efficiently. With Fern your data is never sent to the cloud, so your private thoughts stay private and your data more secure.

Fern has support for daily, weekly, monthly and yearly Journal entries, as well as Templates, Bookmarks, and Notes. It has a RegEx compatable full-text search of Notes and Journals to find records in your Vault. It is the successor to the depreciated shell tool of the same name. We hope you'll love the ease of use of the new Fern, with more features and a beautiful interface!

Installing Fern

  1. Clone this repo.
    git clone https://codeberg.org/InodeLabs/fern
    
  2. Change into this repo directory.
    cd fern
    
  3. Install using Make
    make install    # Will be installed to your GOPATH Bin folder
    

Using Fern

Simply run fern in your terminal to launch the Fern TUI. You will be prompted to setup a new Vault or import an existing Vault on the first run.

Project Roadmap

At the moment I'm head down trying to get through the list of things that will lead up to a v1 release. I'll update this roadmap section periodically, but am currently thinking about:

  1. Snippets: Allow predefined "snippet" file's contents to be injected into the current Note's tab via Pallet Command.
  2. Right sidebar for Note/Vault stats and/or outbound and inbound links related to the active Note/Journal.
  3. Visualization of your Vaults notes/journals connections as a graph.
  4. And mor!

Command Bar

There are several command bar commands you can use as an alternative to the Pallet Commands modal for those who prefer. They do the same thing as the Pallet Commands. It's accessed by pressing : from anywhere in the app except from Editing mode (just press Esc first to go back to Normal mode). Commands support tab-completion.

New command features will usually show up in the Command Bar first, as it's less work to implement them with no UI elements to worry about additionally.

Note Commands
Command Action
:noteOpen <name> Open a note
:noteAdd <name> Create a new note
:noteRename <name> Rename current note
:noteDelete Delete current note
Journal Commands
Command Action
:journalOpen <ref> Open journal entry (today, yesterday, tomorrow, this-week, last-week, next-week, this-month, last-month, this-year, last-year, or a date like 2025-03-15)
:journalReview day|week|month|year Open a period's journal entries
:journalDelete <ref> Delete a journal entry
Template Commands
Command Action
:templateAdd <name> Create a new template
:templateOpen <name> Open a template
:templateRename <name> Rename a template
:templateDelete <name> Delete a template
Bookmark Commands
Command Action
:bookmarkAdd <name> Bookmark the current tab
:bookmarkEdit Edit all bookmarks
:bookmarkOpen <name> Open a bookmarked tab
Vault Commands
Command Action
:vaultSwitch <name> Switch to a vault
:vaultCreate <path> Create a new vault
Command Action
:search <query> Full-text search vault (regex compatible)
:w Save
:wq Save and quit
:q / :q! Quit / force quit
:reload Reload file from disk
:recover Recover from swap file after a crash

Configuration

Fern reads its config from ~/.config/fern/config (or $XDG_CONFIG_HOME/fern/config). The file is created automatically on first run with all options commented out. Uncomment and edit any line to override the default.

Keybindings

Keybindings are customizable via your Fern config file. The bindings shown are the defaults. If you don't like them, change them. Too vim-y? Make 'em emacs oriented. Don't yell at me because the key are not the way you want. :) However, if you want to see a new mapping/action setup, please do reach out!

Navigation
Key Action
Tab / Shift+Tab Cycle focus between sidebar and viewer
ctrl+b Toggle sidebar
ctrl+p Command palette
/ Search vault
: Open command bar
? Help (this reference in-app)
ctrl+q Quit
Sidebar
Key Action
1 Jump to Notes section
2 Jump to Journals section
3 Jump to Templates section
o Cycle sort field (name / date)
O Cycle sort direction (asc / desc)
View Mode
Key Action
j / k Scroll down/up
ctrl+d / ctrl+u Half-page down/up
gg Go to top
G Go to bottom
gf Open link under cursor
za / zR / zM Toggle fold/open all/close all
ctrl+e Toggle edit (normal) mode
Normal Mode (edit)
Key Action
h/j/k/l or arrow keys Move cursor left/down/up/right
ctrl+leftArrow / ctrl+rightArrow Word backward/forward
0 / $ Start / end of line
gg / G Top / bottom
ctrl+d / ctrl+u Half-page down/up
i Insert mode (before cursor)
a Insert mode (after cursor)
I Insert mode at first non-blank character
A Insert mode at end of line
R Replace mode (overwrite characters)
o / O New line below/above, enter insert mode
r Replace single character
x Delete character under cursor
dd / dw Delete line/word
cw / cW Change word
u / ctrl+z Undo
ctrl+r / ctrl+y Redo
v / V Visual / visual-line mode
p / ctrl+v Paste from register
t Toggle checkbox state
T Insert a new checkbox
gf Open link under cursor
ctrl+e Back to view mode
Insert Mode
Key Action
Insert Toggle to Replace mode
Tab Insert tab (respects tab_spaces config)
Enter New line (auto-continues lists)
ctrl+s Save and return to Normal mode
Esc Return to Normal mode (without saving)
Replace Mode

Replace mode overwrites characters in place as you type, like pressing Insert in most editors.

Key Action
Insert Toggle to Insert mode
Backspace Delete previous character
ctrl+s Save and return to Normal mode
Esc Return to Normal mode
Visual Mode
Key Action
y / ctrl+c Yank (copy) selection
d / x Cut selection
c Change (cut and enter insert mode)
r Replace selection with next typed character
s Search vault for selected text
v / V Switch between character / line selection
Esc Cancel (return to Normal mode)
Tabs
Key Action
[ / ] Previous / next tab
{ / } Move tab left / right
ctrl+w Close active tab
Split Panes
Key Action
ctrl+w v Split pane vertically
ctrl+w s Split pane horizontally
ctrl+w q / ctrl+w c Close the active pane
ctrl+h/j/k/l Change focus to another pane left/down/up/right
alt+h/j/k/l Move active tab to an adjectent pane left/down/up/right

To Contributors

We use golangci-lint and gocyclo as part of our Git pre-commit hook flow and for formatting and linting via the Makefile.

Please ensure that you have both packages installed:

# golanci-lint Docs: https://golangci-lint.run/docs/welcome/install/local/
curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin latest
# gocyclo Docs: https://github.com/fzipp/gocyclo
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest

Found a bug? Got an idea for a new feature?

Please open any tickets for bugs found or feature requests here: https://codeberg.org/InodeLabs/fern/issues.

Documentation

Overview

Fern is a vim-style markdown note manager.

Usage:

fern [--debug] [--pprof]

See the README for full documentation.

Directories

Path Synopsis
cmd
themegen command
themegen writes JSON theme files to the themes directory at project root.
themegen writes JSON theme files to the themes directory at project root.
internal
bookmark
Package bookmark manages the vault bookmark file.
Package bookmark manages the vault bookmark file.
commands
Package commands provides pure functions for vault file operations.
Package commands provides pure functions for vault file operations.
config
Package config loads, parses, and holds Fern's runtime configuration.
Package config loads, parses, and holds Fern's runtime configuration.
debug
Package debug provides lightweight file-based debug logging for development.
Package debug provides lightweight file-based debug logging for development.
journal
Package journal resolves and creates periodic journal log files.
Package journal resolves and creates periodic journal log files.
search
Package search provides full-text grep-style search over vault files.
Package search provides full-text grep-style search over vault files.
template
Package template applies date-variable substitution to note templates.
Package template applies date-variable substitution to note templates.
tests
Package tests provides helpers for use in table-driven tests.
Package tests provides helpers for use in table-driven tests.
theme
Package theme loads and resolves built-in and custom UI themes.
Package theme loads and resolves built-in and custom UI themes.
tui
Package tui is the top-level Bubble Tea application model.
Package tui is the top-level Bubble Tea application model.
tui/bookmarkeditor
Package bookmarkeditor is a TUI component for editing vault bookmarks.
Package bookmarkeditor is a TUI component for editing vault bookmarks.
tui/cmdbar
Package cmdbar is the command/status bar TUI component.
Package cmdbar is the command/status bar TUI component.
tui/common
Package common holds shared types and styles used across TUI components.
Package common holds shared types and styles used across TUI components.
tui/dialog
Package dialog is a modal yes/no confirmation dialog TUI component.
Package dialog is a modal yes/no confirmation dialog TUI component.
tui/palette
Package palette is the command-palette TUI component.
Package palette is the command-palette TUI component.
tui/searchmodal
Package searchmodal is the full-text search modal TUI component.
Package searchmodal is the full-text search modal TUI component.
tui/sidebar
Package sidebar is the file-browser sidebar TUI component.
Package sidebar is the file-browser sidebar TUI component.
tui/templateprompt
Package templateprompt is a TUI prompt for selecting note templates.
Package templateprompt is a TUI prompt for selecting note templates.
tui/viewer
Package viewer is the main markdown viewer/editor TUI component.
Package viewer is the main markdown viewer/editor TUI component.
vault
Package vault provides helpers for creating and inspecting vaults.
Package vault provides helpers for creating and inspecting vaults.
vfiles
Package vfiles maintains an SQLite index of vault files and their metadata.
Package vfiles maintains an SQLite index of vault files and their metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL