EliteLux

charm inc reviews you can trust: Hear directly from our satisfied customers.

charm inc reviews you can trust: Hear directly from our satisfied customers.

Okay, so I wanted to talk about my little journey messing around with the stuff from Charm. It wasn’t like some big project or anything, just me tinkering, you know?

My terminal, man, it was just… plain. Black background, white text, maybe some colors from my shell prompt, but that’s it. Got the job done, sure, but felt kinda boring. I kept seeing these cool-looking terminal apps popping up here and there, screenshots on forums and stuff. Wondered how they did that.

Finding the Spark

Started digging around. Bumped into Glow first. Someone mentioned it for reading Markdown files right in the terminal. Tried it out. Pretty neat, honestly. Way better than opening a browser or editor just to read a README. That got me curious – what else did these Charm folks make?

So I looked them up. Found their site. Saw a whole bunch of tools – Bubble Tea, Bubbles, Gum, Lip Gloss. Sounded kinda fun, like building blocks for terminal stuff.

Dipping My Toes In

Gum looked interesting for scripts. Making shell scripts a bit more interactive without crazy amounts of `echo` and `read` commands. Played with it a bit. Made a simple script ask me questions with nice prompts, choose from lists. Yeah, that was useful. Saved me some hassle on a couple of quick automation things I needed.

But the real itch was that TUI thing – Terminal User Interface. That’s where Bubble Tea came in. Seemed like the main engine for building those fancy terminal apps I saw.

Trying to Build Something

Alright, decided I’d try and build a super simple To-Do list app. Right in the terminal. How hard could it be, right?

Well, first hurdle: Bubble Tea is written in Go. Now, I’ve dabbled in Go, but it ain’t my main language. So, step one was getting my Go environment set up properly again, making sure paths were right, all that jazz. Took a little bit, dusting off the cobwebs.

Then I started looking at the Bubble Tea examples. They have this structure, this `*` thing you gotta use. It has an `Init`, an `Update`, and a `View` function.

Started coding. Just wanted a list of tasks and the ability to add one. Found their pre-made Bubbles components – they had a list component! Perfect, less work for me. Tried plugging that in. Then needed an input field. They had one of those too. Hooked that up.

Getting the state management right was kinda tricky. Like, when I type in the input field, how does the main model know? Messages. When I hit Enter, how does the list update? Messages again. It’s all about sending messages between different parts. Took me a while to wrap my head around it properly. Felt a bit like juggling at first.

Spent a good hour just figuring out how to actually quit the application cleanly. You gotta send a specific `*` message in the `Update` function. Missed that in the docs initially.

And styling! Used Lip Gloss for that. It lets you define borders, padding, colors. Made things look a bit nicer than just plain text. Fiddled with that to get borders around my list and input field.

The Result?

After a few evenings of poking at it, I got a basic TUI To-Do list running. You can view tasks, type a new one in a little input field at the bottom, hit Enter, and boom, it adds it to the list. You can scroll the list. You can quit. Pretty basic, yeah, but it worked! And it ran right there in my terminal, looked kinda cool.

It’s definitely not gonna replace any real To-Do app, full of bugs probably. But the process of building it was interesting. Learned a bit more Go, learned how these TUI things are put together conceptually.

The Charm stuff seems pretty solid for this kind of thing. Lots of components you can just grab and use. Makes building terminal UIs way less painful than trying to do it all from scratch with escape codes and stuff. Still need to check out their other tools like Wish or Soft Serve sometime. Looks like they’re building a whole ecosystem for the terminal.

So yeah, that was my little adventure with Charm. Just messing around, building a small thing, figuring it out as I went. Pretty fun, actually.

Exit mobile version