Repository navigation
Stone Tools — v0.5.0
Stone Tools: deez-notes v0.5.0
Chapter XXXV: The Other Problem
The mouse worked now. The scroll wheel turned and the preview moved and the creator's right hand had, after six years of unemployment, finally found gainful work. Balance had been restored. The desk was at peace.
For about a week.
The new problem did not arrive on a Tuesday. It arrived at 2am, as a cron job, in a different terminal entirely.
The creator had been writing a little script. Nothing fancy. Just something to drop a timestamped note into journal/ every morning with the weather, his calendar, and a quote he'd regret by noon. A reasonable ambition. A five-line shell script's worth of ambition.
He typed deez-notes journal new "..." and the terminal bloomed into a full-screen TUI, borders and panels and a blinking cursor, sitting smugly in the middle of a script that had no eyes, no hands, and no patience for blinking cursors.
The script hung. Forever. Waiting for a keypress from a human who was asleep.
Chapter XXXVI: The Cave
"Fine," said the creator. "I'll do it myself."
Famous last words. The four horsemen of technical debt ride in on exactly those four words.
He opened the notes folder in a plain shell and looked at it the way an early hominid looked at a rock: with respect, and with the dawning intent to hit something with it.
grep -rl "tags:.*work" ~/notes/ — to find the work notes. Sort of. Unless a tag spanned two lines. Or had a comment. Or the YAML was the other kind of YAML.
sed -n '/^---$/,/^---$/!p' — to strip the front matter. He wrote it. It ate a note's worth of content along with it. He fixed it. It broke on the note that had a --- horizontal rule in the body.
ls -t | head — to find the most recent. Which sorted by file mtime, not the modified: field he'd so carefully been maintaining in every single note's front matter for the last four versions.
He sat there, hunched over a pipe of awk and sed, chipping a fuzzy-finder out of flint by hand, and somewhere in the back of his skull a small, tired voice said the thing it always says:
"You already wrote this."
Chapter XXXVII: You Already Wrote This
And he had.
The front-matter parser that knew a horizontal rule from a delimiter? In core/. Written. Tested. The fuzzy matcher that found idee projet from ip? core/search.rs. The thing that read the modified: field instead of trusting the filesystem? The sort module. The folder resolver, the tag filter, the title-from-filename fallback — all of it, sitting right there, behind a wall of ratatui.
He had built a beautiful, careful, well-tested little library for understanding notes. And then he had bolted exactly one door onto it — a door shaped like a 200×50 terminal and a human pair of eyes — and walked away convinced that was the only way in.
The caveman in the shell wasn't missing tools. He was reimplementing them, worse, in sed, because the good ones had been locked inside a TUI that only opened for people.
"The logic doesn't care if a human is watching," he said, slowly, to the mouse. The mouse, as ever, said nothing. But it glowed, encouragingly.
So he opened main.rs — again — and this time he did not teach the terminal to listen. He taught it to shut up when nobody's there.
Chapter XXXVIII: A Second Door
deez-notes still opens the TUI when you run it bare. Sacred ground, undisturbed.
But hand it a verb, and it skips the alternate screen entirely — no raw mode, no panels, no blinking — does the thing, prints plain data, and gets out of the way. Same core/ underneath. The exact parser, the exact fuzzy matcher, the exact sort. No second implementation. No flint.
The 2am script got its five lines. The cron job stopped hanging. The caveman put down the rock.
What's new — the CLI
A new non-TUI command mode. A bare deez-notes still launches the TUI exactly as before; a subcommand runs headless, reads/writes through the same core, and is built for pipes and scripts.
| Command | What it does |
|---|---|
deez-notes list [--json] [--folder F] [--tag T] |
Discover notes — TAB-separated path<TAB>title, or a JSON array (path, title, tags, created, modified). |
deez-notes get <note> |
Print a note's markdown body (front matter stripped) to stdout — pipe-friendly. |
deez-notes search <query> [--json] |
Fuzzy-search by title, same output as list. |
deez-notes new <title> [--folder F] |
Create a note. Body from stdin if piped, otherwise opens $EDITOR. Prints the created path. |
deez-notes set <note> |
Overwrite a note's body (front matter preserved). Body from stdin if piped, otherwise $EDITOR. |
deez-notes rm <note> |
Delete a note. |
Note addressing (<note>): exact relative path first (e.g. projets/idee.md), then a fuzzy title fallback ("idee projet").
Pipeline-native: human output is TAB-separated for cut/awk; --json is for jq. Errors go to stderr with a non-zero exit code. The CLI path never touches the terminal, so it's safe in cron, CI, and 2am-journal.sh.
# the 2am script, finally
printf '# %s\n\n%s\n' "$(date +%F)" "$(curl -s wttr.in?format=3)" \
| deez-notes journal new "$(date +%F)"
# everything tagged work, as JSON
deez-notes list --tag work --json | jq -r '.[].path'
# read a note by fuzzy title, straight into your pager
deez-notes get "weekly review" | glow -Other changes
- Minor cleanup in
app.rs(dropped an unnecessarymut).
Install
Grab a binary below, or build from source:
cargo install --path .Full diff: v0.4.0...v0.5.0