Why did I build medi?
12 Aug 2025Where are my files?
I have a bunch of markdown files scattered across my computer, in different repos and folder, and other random temporary spots. It’s hard to keep track of them all. It was a frantic dance of grep
, find
, and ls
. It felt like I was fighting the filesystem, Commander One
helped to a degree but not quite.
I started to think about abstracting away the filesystem and have a central place for my files, like in a lightweight database I could access instantly from anywhere in my terminal.
I had so much fun building tbdflow so I decided to build medi
.
medi
is a fast, editor-centric, commandline notes manager I wrote in Rust. It’s my solution to abstracting away the filesystem and creating a focused, high-speed workflow for writing.
A workflow, not just a folder
The core idea behind medi
is to stop thinking about files and start thinking about content. I designed it around a few key principles:
- CLI-first: All interaction is through the terminal. It’s fast and scriptable, as an old Linux user I like pipes…
- Editor-centric:
medi
isn’t an editor but it will get you into your favorite editor ($EDITOR
) with the right content. I use Neovim myself:export EDITOR=nvim
- Local & private: Your data is yours. It lives on your machine, no cloud component and no spyware, fully OSS.
Speed is a feature
The biggest win comes from using sled
, an embedded database written in pure Rust. Instead of scanning a directory, medi
performs a direct key lookup.
# This is instantaneous, even with thousands of notes.
medi get "my-old-project-idea"
This makes finding and reading notes feel very snappy, which is what you want from a tool you use every day.
Flexible by design
A good CLI tool should adapt to your needs. medi new
supports three distinct workflows for creating notes, which has been a game-changer for me.
-
Interactively (for long-form writing):
medi new "my-next-blog-post" # Opens Neovim in a fresh .md buffer
-
With a flag (for quick thoughts):
medi new quick-reminder -m "Don't forget to buy milk"
-
From a pipe (for scripting):
git log -1 --pretty=format:"%s" | medi new latest-commit-message
Version control
Of course, plain text files have one huge advantage: Git. I didn’t want to lose the ability to version control my writing.
That’s what the import
and export
commands are for. They act as a bridge between the fast sled
database and the version-controllable world of the filesystem. My workflow is simple: I write and edit in medi
all week, and then run medi export ./notes-repo
and commit the changes. It’s the speed of a database with the safety of Git.
Check it out
Building medi
has been a great learning experience in Rust, and it has genuinely improved my daily workflow. If you’re a command-line enthusiast who deals with a lot of Markdown, I’d love for you to give it a try.
You can find the source code on GitHub or install it directly with Cargo:
cargo install medi
The project is still young, and there are plenty of ideas on the roadmap, like adding task management features and full-text search. Check out the README and let me know what you think!
Real-world usage
This blog entry was written using medi
,
medi new medi-blogpost
# writing and then saving for a break, ZZ
medi edit medi-blogpost
# save and close ZZ, or :wq if you like that better
medi get medi-blogpost > _posts/2025-08-12-why-medi.md
# Commit using tbdflow
tbdflow commit -t feat -s blog -m "add blog entry about medi"