Building My First Gum TUI: The Git Branch Manager That Actually Sparked Joy (Part 1)
Building My First Gum TUI: The Git Branch Manager That Actually Sparked Joy (Part 1)
Or: How I Learned to Stop Worrying and Love ASCII Art
If you’re a bit interesting in this series, you might want to check where this started at The Monday Morning That Changed My Terminal Life. But if you’re here for the chaos, buckle up - this is where theory meets reality, and reality involves way too much time spent making ASCII art look perfect.
So there I was, fresh off my Gum discovery high, staring at my terminal like it held all the secrets of the universe. The question wasn’t “what should I build?” but rather “what daily annoyance can I turn into something beautiful?”
The answer came to me during one of those moments when you type git branch, squint at the output like you’re deciphering ancient hieroglyphs, then carefully copy-paste a branch name while praying to the Git gods you didn’t mess up. You know the drill.
“What if,” I thought, “I could make this actually pleasant?”
And that’s how my Git Branch Manager was born - not from some grand vision, but from pure, concentrated laziness wrapped in terminal aesthetics.
The “Help” That Actually Helped
Here’s the thing about Gum that blew my mind: gum --help is actually useful. I know, revolutionary concept in the CLI world. But seriously, I’m lazy (we’ve established this), so if I could figure it out, you definitely can.
Want to style something? Try gum style --help. Need a confirmation dialog? gum confirm --help has your back.
# Style some text with colors and borders
echo "Hello World" | gum style --foreground="#FF6B6B" --border="double"
# Get user confirmation
gum confirm "Are you sure?" && echo "Yes!" || echo "Nope!"
# Let user choose from options
gum choose "Option 1" "Option 2" "Option 3"
It’s like having documentation that doesn’t make you question your life choices.
This discovery alone saved me from my usual routine of opening seventeen browser tabs and still somehow ending up on Stack Overflow asking questions that were answered in the docs I never read.
Watch It in Action
Before we dive into the journey, here’s what this thing actually looks like:
Pretty neat, right?
And here’s something cool I learned while making this. I saw these live pictures on the Gum repo and wanted to do the same. Boom, discovered asciinema. You can either upload directly to asciinema or create a gif from the cast using their tool agg. Pretty slick way to show off your terminal apps.
The ASCII Art Rabbit Hole
Now, here’s where things got interesting. I’ve always been passionate about terminals - I spend most of my time in them anyway, so why not make them beautiful? When I first set up my nvim config, I used this beautiful ASCII art that says “neovim” on the home screen with a plugin called alpha.lua.
That’s when I realized what you could do just with ASCII. While playing with Gum, I discovered Figlet, which creates ASCII shapes:
# Install figlet first: sudo apt install figlet
figlet "Git Manager"
Initially, I used Figlet directly. But then I thought, “What if someone else wants to try this and doesn’t want to install another dependency?” So I found Text to ASCII Art Generator and just copied the ASCII art:
title=$(cat << 'EOF'
_______ __ __ ____ __ __ ___
/ ____(_) / /_ / __ )_________ ____ _____/ /_ / |/ /___ _____ ____ _____ ____ _____
/ / __/ / __/ / __ / ___/ __ `/ __ \/ ___/ __ \ / /|_/ / __ `/ __ \/ __ `/ __ `/ _ \/ ___/
/ /_/ / / /_ / /_/ / / / /_/ / / / / /__/ / / / / / / / /_/ / / / / /_/ / /_/ / __/ /
\____/_/\__/ /_____/_/ \__,_/_/ /_/\___/_/ /_/ /_/ /_/\__,_/_/ /_/\__,_/\__, /\___/_/
/____/
EOF
)
Problem solved. No extra dependencies, just copy-paste ASCII goodness.
What Started as One Thing Led to Everything
For me, all of this started with just one Discord message. Then Gum. Then discovering what I was missing and what I could play with to do more things. But I think this is just the start of my TUI world journey. I’m getting more excited about what else I can do and where I can take it.
I can’t really wait until I can mix this with Go instead of sticking to bash. The possibilities feel endless when you’re not limited by shell scripting quirks (though bash has its charm, don’t get me wrong).
What This Thing Actually Does
This TUI handles Git branches without making you want to scream. You can browse branches, switch between them, delete the ones you don’t need, and rename them. That’s it. Nothing fancy, just the daily Git stuff but prettier.
Check out the gum-git-branch-manager repo if you want to see how it all fits together.
The Learning Curve That Wasn’t
Building this taught me that creating delightful CLI experiences doesn’t require a PhD in terminal wizardry. Gum makes it surprisingly approachable to build tools that are both functional and pleasant to use.
Sometimes the best projects are the ones that solve your own daily annoyances. This tool has already saved me countless micro-frustrations, and honestly? That’s worth celebrating.
The whole experience felt less like wrestling with code and more like… well, like playing with digital LEGO blocks. Colorful, functional digital LEGO blocks that happen to manage Git branches.
So that’s Part 1 of my Gum adventure. What started as curiosity about a three-letter abbreviation turned into my first real TUI, complete with ASCII art that probably took longer to perfect than the actual functionality.
Next up: diving deeper into this TUI rabbit hole and maybe, just maybe, graduating from bash to something that won’t make me question my life choices when I need to handle arrays.
Stay tuned for Part 2, where things get even more interesting (and possibly more chaotic).
P.S. If you’re reading this thinking “who spends this much time perfecting terminal aesthetics?” - welcome to the club. We meet at the intersection of function and beauty, and yes, we absolutely judge CLIs by how pretty they are.