Personal journal CLI (j) plus a Neovim helper for search/tag/extract workflows.
Run:
bun run dev
Build + install:
bun run build(writesdist/j)bun run install:local(installsdist/jto~/.local/bin/j)
Common usage:
jopens today's entry (creates if missing)j -3orj --offset=3opens the entry from 3 days agoj --date/-dbrowse entries with fzf (optionally--tag=work)j --search <text>/-s <text>search by content (rg + fzf)j --search <text> --jsonJSON search results for scripts/pluginsj --timeline/-lbrowse a timeline with previews (optionally--tag=work)j --continue/-copen the most recently opened entry or notej --tag=workbrowse entries for that tagj --note=slug/-n slugopen a notej --sections <source>list sections for extractionj --extract <source> --sections=1,3 --slug <target>extract sections to a note--jsonoutput structured JSON and skip fzf/nvim (used by the plugin)--limit <n>cap JSON list/search results (default 200 for--search --json)
Source/section notes:
sourcecan be a date (YYYY-MM-DD), a note slug,notes/<slug>, or an absolute path.- Sections are blocks separated by blank lines or separator lines (
---,***,___). - Tag matching looks only at line 2, either
tags:or hashtags (e.g.#work).
External tools used by the CLI:
nvim(opens with+ZenModeand setsg:journal_mode=1)fzf(interactive selection)rg(search)bat(preview, optional; falls back tocat)sh,sed,tail,head(preview helpers)
Data locations:
- Journal entries:
~/journal/YYYY-MM-DD.md - Notes:
~/journal/notes/*.md - State:
${XDG_STATE_HOME:-~/.local/state}/lm/j-state.json
{
"behzade/j.nvim",
dependencies = {
"folke/snacks.nvim",
"folke/zen-mode.nvim",
},
build = function()
require("journal").install()
end,
config = function()
require("journal").setup()
end,
}Keymaps:
<leader>jllive search (shows latest 20 entries, narrows as you type)<leader>jtbrowse tags<leader>jxextract sections to a note
The plugin expects the j CLI to be available on PATH and uses snacks.nvim pickers.
If j is not on PATH, run :JournalInstall (or use lazy.nvim build) to download a release binary to stdpath("data")/j.nvim/bin.