Notem: simple notes from the command line
I thought I’d write a quick post about notem – my first Rust project! – why I made it, who it’s for, and a little about my experience writing it in Rust.
Why
I wrote notem to solve a frequent problem in my day-to-day work: I almost always forget to take notes! In meetings, pairing sessions, and sprint planning, taking notes help me stay focused and to quickly review main takeaways after the meeting. And when working on a ticket, taking notes helps me organize my thoughts and plan of action before diving into code.
My goal was to write a tool that would drastically lower the barrier to start writing notes like these. I also wanted to have these notes organized in a simple way so I can sanely look back through old notes. Prior to notem I would open a text editor and save the file to my Desktop, cluttered among the rest of my unorganized files.
I wrote notem
as a command line tool that I can run in any terminal window.
From the command line, I type:
notem sprint planning and review
And by default that creates a new plain text file in a global folder called
notes
with today’s date in the filename and the subject of the note, all
dasherized: 2017-11-06-sprint-planning-and-review
.
Due to the naming, all files in the notes directory are sorted by created date. This directory quickly fills up, so I added a command to help me find old notes:
notem --search sprint planning
which will output the path of the same note I just created. I can quickly open
up that note with sublime using the subl
command:
subl $(notem --search sprint planning)
Who’s it for
I think this tool could be useful for anyone who, like me, struggles to incorporate note taking into their day-to-day, but almost always has a terminal window open. A new notepad is just a few keystrokes away.
But honestly this tool might only be useful for myself. It solves 80% of my problem and fits smoothly into my workflow, so if it’s useful to anyone else that’s great 😺.
What’s this Rust thing?
Rust is a systems programming language that focuses on performance and memory safety. Coming from the web development world where JavaScript is king, getting into Rust has been a great learning experience for me. I’ve used the opportunity to learn more about concepts that rarely come up when writing in an interpreted dynamic language, like memory management, thread safety, type checking, compilation.
This was a great starter project for me to learn Rust! The first incarnation of notem was a bash script so I had a clear idea of the functionality I wanted to provide and the commands to build. That helped a lot in getting over the initial barrier of “what do I write.” In making notem I also got exposed to some of the fundamental rust apis like std::env and std::fs. While notem is far from idiomatic rust, and it lacks tests and docs, it was a good first project to get my feet wet with the language.
I have a lot more to say on Rust but I’ll save that for a future post.
Check it out
If you’re interested in checking out notem you can find the source on GitHub at https://github.com/danpaz/notem, and the rust crate is published at crates.io https://crates.io/crates/notem. Thanks for reading!
-D