Presenters

Source

Bringing the Terminal to Life: From Retro Interfaces to AI Powerhouses 🚀

Ever feel like the terminal is just a black box for typing commands? Think again! What if you could build rich, interactive applications right in your terminal, complete with buttons, scroll bars, and even gorgeous streaming markdown for your AI interactions? That’s exactly what we’re diving into today, thanks to the incredible work of Will Mcgugan.

Will, a seasoned developer with a passion that started with a ZX Spectrum 48K Plus back in the 80s, has been on a journey to push the boundaries of what’s possible in the terminal. From crafting visually appealing command-line interfaces to building a groundbreaking platform for interacting with AI, his story is a masterclass in innovation and the power of embracing limitations.

💡 From Pretty Output to Interactive Worlds: The Birth of Rich and Textual

It all started with a desire to make terminal output more than just plain text. Will’s first major creation in this space was rich, a library designed to format terminal output beautifully. Think:

  • Styled Text: Bold, italics, and a splash of color to make your messages pop.
  • Structured Data: Perfectly rendered tables and appealing panels to organize information.
  • Dynamic Elements: Progress bars to track tasks and even live updates for real-time dashboards.

rich proved to be a hit, enabling developers to build more engaging command-line tools and gain better visibility into their data. But as users started craving more interactivity – the ability to click buttons, manipulate sliders, and navigate through content – it became clear that rich, while excellent for output, had its limits.

This is where textual entered the scene. Building on the foundation of rich, textual transforms the terminal into a canvas for fully dynamic interfaces. It’s not just about presenting information; it’s about interacting with it.

  • It’s a GUI in the Terminal: While the term TUI (Text User Interface) is commonly used, Will argues that textual interfaces are more accurately described as GUIs (Graphical User Interfaces). They sport familiar components like buttons, text inputs, and scroll bars, offering a visual experience that rivals traditional graphical applications.
  • Retro Charm, Modern Power: These interfaces boast a distinct “retro” aesthetic but are powered by sophisticated rendering and input handling.
  • Beyond the Terminal: And here’s where things get really exciting! With textual serve, your terminal applications can be effortlessly deployed as web applications, accessible to anyone with a browser. No complex setup required, just a single command to bring your terminal creations to the web! 🌐

🛠️ The Nitty-Gritty: Building Interactive Experiences from Scratch

Creating these dynamic terminal experiences isn’t for the faint of heart. As Will discovered, the terminal offers very little out of the box. Unlike web development where you get pre-built components, in the terminal, you’re starting with the absolute basics: printing text and receiving input.

  • The Terminal’s Limitations: You don’t get buttons or text fields for free. Every element, every interaction, has to be painstakingly built from the ground up.
  • Creative Constraints: This lack of built-in features, however, is precisely what fuels creativity. Having to figure out how to render a button using only text characters forces innovative solutions. It’s a testament to the idea that limitations can be a catalyst for genius. 💡
  • Mouse Support and Beyond: Even seemingly simple features like mouse support require careful implementation. Terminals, rooted in teletypewriters, weren’t designed for pointing and clicking. textual leverages specific protocols to interpret mouse movements and clicks, translating them into application events.
  • The “What’s Under the Mouse?” Problem: A fascinating challenge is determining what’s under the mouse cursor. The terminal itself doesn’t know. textual solves this by maintaining an in-memory data structure that maps rendered widgets to their screen coordinates. When a click occurs, it consults this map to identify the clicked element. 🎯
  • Abstraction is Key: All this underlying complexity – the layout engine, the input parsing, the coordinate detection – is abstracted away by textual. Developers can focus on building their application logic, responding to events like on_button_pressed without getting bogged down in the low-level details.

🧠 The Future is Now: Introducing Toad and AI Interaction

Fresh off the incredible success of textual, Will is now channeling his expertise into his latest venture: Toad. And it’s not just another AI chatbot interface; it’s a sophisticated platform designed to bridge the gap between developers and the rapidly evolving world of Large Language Models (LLMs).

  • Elevating the CLI Experience: Will observed that existing terminal applications for AI agents, while functional, were often clunky, prone to flickering, and lacked proper interactivity. He knew it could be done much better.
  • A Unified AI Interface: Toad aims to be the ultimate terminal interface for AI agents. It provides a beautiful, user-friendly experience for interacting with various LLMs, supporting features like:
    • Beautiful Streaming Markdown: Watch your AI-generated content unfold in real-time with elegant formatting.
    • Advanced Diff Views: Seamlessly compare code changes with a visually appealing diff interface.
    • Effortless Agent Integration: Toad leverages the Agent Client Protocol (ACP), allowing it to connect with a wide array of AI agents, regardless of their underlying LLM. 🤝
  • Local and Online LLMs: The beauty of Toad is its flexibility. It can seamlessly connect to cloud-based LLMs like Gemini and Claude, but it’s also designed to work with locally run models. As local LLMs become more powerful and accessible, Toad is poised to be at the forefront of this shift. 💻
  • “No Compromises” Philosophy: Will’s vision for Toad is built on a “no compromises” principle. If a command or TUI runs in a standard terminal, it should run flawlessly within Toad. This includes the ability to launch and interact with other terminal applications inside Toad itself – imagine running htop or even your favorite text editor within your AI interaction environment! 👾

🌱 The Road Ahead

With the first public release of Toad on the horizon, Will is busy squashing bugs, refining features, and ensuring a smooth, “no surprises” experience for users. The development of Toad is a testament to Will’s dedication to pushing the boundaries of what’s possible, proving that the terminal, often seen as a relic of the past, is actually a vibrant and powerful platform for the future of technology.

Stay tuned for more updates, and be sure to check out Will’s Discord server for a chance to test Toad as it evolves! ✨

Appendix