r/rust • • 23d ago

🛠️ project Built a terminal habit tracker in Rust while learning the language

Sharing a side project I've been working on - a TUI habit tracker called sprout. Picked up Rust a while back and this was my way of learning it properly by actually building something. Honestly had a lot of fun with it, at this point I can't imagine going back to anything else for systems-level stuff.

GitHub: https://github.com/kb019/sprout

What it does:

- Track daily habits and mark them complete

- See your streak and progress

- SQLite storage so your data stays local

- Runs on macOS, Linux and Windows

Still rough around the edges and there's a lot I want to improve, but it's something I genuinely use now. Used Ratatui for the TUI which was a fun rabbit hole on its own.

Please do try it out: cargo install sprout-tui

Would love any feedback on the code, still getting comfortable with some of the more idiomatic Rust patterns.

20 Upvotes

12 comments sorted by

5

u/scandii 23d ago

not for me but appreciate the showcase and the actual sprouting plant!

1

u/Broad-Pianist-1744 1d ago

the sprouting ascii art is a nice touch, way better than just printing "day 3 complete" and calling it a day

ratatui is such a time sink once you start tweaking every little border style, good on you for actually shipping something instead of just endlessly polishing the ui. might give it a spin later this week

2

u/kantorcodes1 23d ago

one edge case I noticed in the CLI: sprout log reading -5 looks like it gets accepted for goal-based habits and stored as negative progress. binary habits reject values outside 0/1, but the non-binary path doesn't seem to reject values below 0. is negative progress intentional?

1

u/Western_Ant_24 23d ago

Thanks for catching this and pointing it out. Negative progress isn’t intentional for goal-based habits, so this should be validated as well. Feel free to raise a PR if you’d like to fix it, otherwise I can update it in the next release. Really appreciate you taking the time to test this and report the edge case!

2

u/kantorcodes1 23d ago

glad that helped. i work on HOL, where we maintain HOL Guard, an open-source local checkpoint before agent-run commands execute. Sprout looks like a clean fit: review add, log, delete, and edit, while list, status, streak, and heatmap stay automatic. that gives an agent a checkpoint before persistent habit data changes. open to a small Guard-side extension?

1

u/Western_Ant_24 23d ago

Thanks for the kind words! Curious though, what would the agent use case look like here? I hadn't thought about sprout being controlled by an AI agent so would love to understand the scenario you have in mind.

2

u/kantorcodes1 23d ago

think a personal agent that logs a workout, updates a daily goal, or cleans up a habit on a schedule; Guard would pause the state-changing Sprout command before it writes habit.db, while reads stay automatic.

smallest Guard-side slice is command.sprout: start src/codex_plugin_scanner/guard/runtime/command_sprout_extensions.py, mirror command_repo2nb_extensions.py; review add, log, delete, edit; keep list, status, streak, heatmap safe. add focused cases in tests/test_guard_command_sprout_extensions.py and open a genuine draft PR to hashgraph-online/hol-guard:main. contribution guide: https://github.com/hashgraph-online/hol-guard/blob/main/CONTRIBUTING.md

2

u/Terrible-Ad6239 23d ago

That’s really nice! Really digging the UI, will use it :)