侘寂 wabi-sabi
← All Posts
2025.12.22 · Projects

Building a CLI tool for garden logging

Small Software for a Small Garden

The garden behind my apartment is not large — a few raised beds, some herbs in ceramic pots, a single persimmon tree that produces more fruit than I can eat. But even a small garden generates a surprising amount of information. When did I plant the spring onions? How long until the shiso is ready to harvest? Which bed had the tomato blight last August? I tried notebooks, spreadsheets, even a notes app on my phone. None of them fit the way I think about the garden.

So I built a CLI tool. Not because the world needed another command-line application, but because the terminal is where I feel most at home, and the garden is where I feel most at peace. Combining them seemed natural. The tool is called niwa — the Japanese word for garden — and it does very little. You can log a planting, record a harvest, note an observation. That is almost all.

Go and SQLite — Enough and No More

I chose Go because it compiles to a single binary. No runtime dependencies, no package manager at the other end. You download it, you put it in your path, and it works. There is a quiet satisfaction in software that requires nothing of the person who uses it. SQLite handles the data — a single file that lives next to your other garden notes, easy to back up, easy to inspect.

The schema is deliberately simple. A table for plants, a table for events, a table for observations. No foreign key cascades, no complex joins. I wanted the data model to be as legible as a handwritten garden journal. When I query the database directly, which I sometimes do, the SQL reads almost like natural language. This is not accidental. Simple tools should produce simple artifacts.

The Satisfaction of Enough

There is a temptation, when building software for yourself, to keep adding features. A weather integration. Photograph attachments. Soil moisture tracking via IoT sensors. I have resisted all of these. Niwa does what it does, and it does it well enough. The Japanese concept of 足るを知る (taru wo shiru) — knowing what is sufficient — applies to software as much as it applies to life.

Each evening after watering, I open a terminal and type a few lines. The persimmon is flowering. The basil needs more sun. The first cucumber of the season. These small records accumulate into something meaningful — a portrait of a garden across time, written in the language I know best.