I wanted to share a tool I built out of a desire to easily create and organize plain-text notes on the command line. textnote is a CLI for quickly creating, opening and managing daily plain-text notes. I built it to encourage myself to practice daily note taking by making it dead simple to open a prebuilt, templated, dated note file in Vim. I thought it would be good to share here with the HN community because it is intentionally lightweight and meant to be paired with other commandline tools (grep, fzf, etc) for additional functionality.
The key feature built into textnote that I couldn't find elsewhere is archiving. Running its archive command will consolidate notes into monthly archive summary files and (optionally) remove the original daily files to declutter and turn your notes organized records over time.
I hope you might find it useful and I'd love to take any feedback or suggestions that might come to mind!
Are you familiar with the $EDITOR and/or $VISUAL environment variables?
Text-based (i.e., CLI) applications which spawn a text editor should respect/support them as much as possible.
The options that I see for using $EDITOR are: (1) simply ignore the line option for non-vim editors, (2) add implementation for specific editors, each with their own "jump to line" argument if it exists, or (3) add an additional command line argument that passes args/flags on to the editor. Option (3) seems best to me but I do worry about the number of supported flags - it is quite a lot already! More seriously, this option could be a vector for malicious code execution.
Thanks again, really appreciate the feedback! I'd love to hear your thoughts.
[EDIT: add comment on malicious code execution]
I use a simple homebrewed system for my notes too, https://github.com/d5ve/noop which is just a search/edit loop, where you look for files and add/edit them.
https://github.com/d5ve/noop started out in golang too, but I ended up shelling out for so much stuff anyway, that I rewrote it in bash.
Fortunately, for textnote I only have to shell out once to open the file. I will try hard to keep it that way, otherwise I agree with you and others that bash might be the more appropriate tool. Then again, there is functionality included that would be much more difficult to accomplish in bash (templating, archiving, configuration).
Thanks again for your comments and feedback!
Why not just perform the consolidation automatically (the first time textnote is executed after the first of the month), allowing you to do away with the subcommand?
Or perhaps make automatic consolidation configurable / optional (along with any desired default options)?
* Write down almost everything could be relevant to your work/research * Use spacing to separate notes and use dates as headers. (I find dates to be better than page numbers for referencing, but your mileage may vary) * If a note is a "task", put an empty checkbox next to it. Tick the checkbox when the task is done. * When empty checkboxes are too many and/or scattered across the journal, strike them out and rewrite them, under today's date (this is known as a "migration" in BulletJournal-speak).
Last year I open sourced https://github.com/nickjj/notes which is similar'ish to this tool. It supports opening your notes in any editor (using $EDITOR), launches this month's notes with `notes` but also lets you create notes with `notes hey just writing a note` or sending notes in from stdin with `echo "cool" | notes` (useful for pasting a note).
Also, if you really wanted daily notes you could easily change the date format to include -%d. After doing notes by hand for so long I initially wrote the script with daily notes thinking it would be better but very quickly reverted back to monthly notes.
The whole thing is a 25 line bash script so it's super easy to edit if you don't like what it does by default.
As someone who's been practicing plain text notes only few years less than you, I'm contemplating going in the reverse direction now. My default for quite a while was a YYYY-MM.org file. But now that I use org-roam[0] to organize my personal wiki, and link to the entries from my daily notes, I've found the month-files are becoming "super nodes" in the resulting graph. In any given month, I can be thinking about dozens of unrelated things - and now they suddenly become connected by virtue of being considered in the same month.
It's a spurious connection that I currently exclude when visualizing/exploring the graph of my notes, but completely rejecting the connection between "transient" daily notes and permanent documents doesn't feel right either. The options I have are to either a) patch org-roam to work with headline-level granularity, instead of file-level, or b) just start using daily (YYYY-MM-DD.org) files. The latter is simpler.
So in general, my experience agrees with yours here wrt. granularity, but the extra constraint of using graph building and exploration tools on top of the notes makes daily notes much more appealing.
--
[0] - Roam Research clone for Org Mode.
The super-node'ish factor of the file ends up being kind of cool from a human review perspective because you can glance through the month and get an idea of what you did during that time frame overall.
I know you're big into Emacs (I've seen you comment about it a bit in the past), but have you looked into https://obsidian.md/ for managing your notes in the style you've described? It seems like an app designed specifically for linking and creating graph views of your notes.
Personally I have been managing most of my plaintext notes with the minimal tools required to do so: a text editor and a file system. For technical notes about software I add git into the mix[1], mostly as a means of synchronization between machines.
Thanks for sharing your post - I really like the idea of using git to sync/track notes and believe textnote can fit in with that workflow quite well. Appreciate your feedback!
* the notes are filed into dirs by year and then month, so I don't need an archive command * the "todo" section serves as my backlog and is automatically carried over from one day to the next * I have a command to take all of last week's "done" items and email them to my manager
The source code for mine is not public because it was lashed together out of duct tape and optimism.
I considered archiving at the year level, but realized that the month level of granularity is likely what I actually want because a yearly file would be quite large. I'd be curious to hear your thoughts - have you found the yearly archive file to be cumbersome?
I also love the idea of the weekly done list. My take for textnote is rather than build that functionality into the CLI, I prefer to augment it with scripts that take advantage of common commandline tooling and the plain text files. I might give your "email done list to my boss at the end of the week" workflow a try as a script on textnote files. I'll let you know how it works out.
Good stuff, really appreciate your comments!
I tried noteKit and zettlr and so many more and I am willing to give this one a try, but I am always hesitant to reverse-engineer the file-structure and create autocommit/push/pull/etc. scripts to handle all the syncing across my work devices.
As a proof of concept I once created a "personal log" (where you could just put a few lines of what you're currently doing and why and for whome) and it was basically a git-wrapper where empty commits were created and all the data was in the commit message. A simple sync-command then pull-rebased and pushed everything. Of course, the append-only nature of this model made synchronization incredibly easy.
I just wish that distributed workflow was more of a consideration for authors of personal organization tooling.
Edit: of course, also plain-text accounting, for example. The plain-text nature brings a lot of possibilities that are rarely used to the fullest.