URL Shortener TUI: A Hobby Project

Today, I open sourced my hobby project that I have been working on the sidelines over the past few weeks.
The idea came to me on my commute to work one gloomy Sydney morning. I was reading a tech blog and wanted to share it with a friend on WhatsApp. I copied and pasted what looked like half a page long URL that did not even render a preview.
That was when it struck me. What happened to the good old Bitly? Why would WhatsApp not automatically shorten links in conversations?
That was my light-bulb moment.
I have been dabbling in agentic AI for a few months now, and it has been astonishingly fun. It allows me to build things I have always had ideas for but never quite had the right skills to implement.
At heart, I am a data engineer. I understand data. How to extract it, transform it, and make it meaningful for the business. While I did graduate as a computer science engineer, I was never deeply immersed in the full stack skill set required to bring a complete product to life. Building a frontend, designing a backend, and stitching everything together with middleware always felt like a different discipline altogether.
Thats when I thought why not try building my own version of bitly! It doesn’t have to be big, I do not intend to commercialise it. My intent was purely to learn. Learn the nuances of what Agentic AI had to offer, their quirks to watch out for, while also learning to build software in python!
Full Disclosure: I did not build this alone in the traditional sense. I built it with an agentic AI loop: delegate, review, correct, retest, repeat. The project became less about writing every line myself, and more about learning how to direct an AI collaborator with enough precision that the output is both correct and production-ready.
What did I end up building?
At a high level, the project includes:
- A Textual-based TUI for creating, searching, editing, and deleting short links. Also, supports mouse clicks and multiple themes!
- A threaded HTTP redirect server for GET /<code> routing
- Persistent storage with a repository abstraction
- Multiple backend options (SQLite by default, plus PostgreSQL/MySQL support)
- Settings management for base URL, server port, and runtime toggles
- Tests covering core flows, redirect behaviour, storage layers, and TUI interactions
It sounds simple on paper. In practice, it was a compact systems project with UI, concurrency, storage, and distribution concerns all meeting in one place.

The quirks I learnt
Vague instructions produce potential mistakes
Agentic AI is very good at producing something that looks complete.
That is not the same as something that is complete.
I repeatedly saw this pattern:
1. Request sounds obvious
2. AI implements a reasonable interpretation of instructions
3. Behaviour in real usage still breaks when executed
4. I add new constraints and exact acceptance criteria
5. The fix then lands correctlyThe quality jump happened when I switched from “fix this” to “fix this, and here is what success must look like.” More often than not, that extra line helps you get closer to completeness.
Conveniently skips thorough validations despite instructed to
At one point, pressing `n` to create a new URL did nothing in real usage.
Bindings existed. Actions existed. All unit tests passed. Still broken.
The issue was key routing and focus behaviour in the TUI. The AI had provided a superficially correct fix, but not a robust one.
I had to be explicit:
1. reproduce the issue
2. trace event flow and focus ownership
3. add a regression test specifically for the `n` key binding
4. only then call it doneI discovered that for a critical user action, it is usually a good practice to require deterministic routing and a regression test.
Theme switching worked, but only for the palette!
Textual’s theme system makes implementing theme switching relatively straightforward. However, what I discovered later was that it initially only changed the palette accents, not the full UI colours.
From a code perspective, the toggle worked exactly as expected. The setting switched between themes without any issues. From a user perspective though, the experience did not really change anything on the UI.
The root cause turned out to be hardcoded dark colours in the stylesheet. Because of this, large parts of the interface ignored the theme switch entirely.
The proper fix required refactoring the styles to use theme tokens across the interface, allowing the dark and light modes to affect the entire experience rather than just accent elements.
In reality, two implementations were at play. One was Textual’s built-in theme system, and the other was the styling applied within the project itself. It is an easy detail to overlook, but definitely something worth watching for when implementing styling.
Incomplete Logic persisting from first pass
I found several areas where the structure was present but the logic was not truly finished. Examples included empty state handling and silent exception paths.
At first glance, the AI generated output looked neat and complete. However, when I began reviewing the code more closely, it became clear that many parts were only scaffolding.
In the first pass of building a project, placeholder classes, functions, and exception handlers are often generated to shape the architecture. As development progresses, these placeholders can easily remain unnoticed and never get fully implemented.
I uncovered several of these during a thorough code review and explicitly asked for them to be completed, along with proper unit tests. This helped move the code from structural completeness to functional completeness.
Prompt Engineering: My Style
My prompts for first pass have remained broad. My intention is still for the AI to build me a structure, after some deliberate decision making for core features that I would like to see in the project.
As I make progress, the prompts become more operational in nature. They are focused on specific feature, implementation logic, providing direction, system design decisions, architectural decisions.
Here are some prompt styles that has worked better for me, so far:
- "Investigate deeply, identify root cause, explain it, fix it, add/adjust tests, and run full suite."
- "Do not stop after applying a fix. Reproduce and prove."
- "If no test exists for core flow, add one."
- "Commit only after all tests pass."This changed the AI from a code generator into a more disciplined execution partner.
What Agentic AI did well
- speed of iteration once requirements, constraints and acceptance criteria were clear
- handling repetitive changes quickly
- broad project passes (tests, docs, structure) without hallucinations
- converting feedback into immediate implementation cycles
Where Human in the Loop is required
- deciding what “done” actually means
- distinguishing cosmetic correctness from functional correctness
- enforcing test driven approach
- maintaining product roadmap and end user perspective
- setting security boundaries
Finally…
The most useful learning for me was this:
Agentic AI systems are not to be treated as someone who can code on your behalf. They are essentially an execution system that requires precise control.
When guided well, it is genuinely high leverage. When guided vaguely, it is fast at generating rework.
This project taught me that the real skill is no longer about implementation. It is instruction quality, validation discipline, and deciding what should be treated as complete.
If you are building with Agentic AI, that is where the compounding advantage can be realised.