# I'm trying out gum (charm.sh) for my shell scripts and it's cool

**URL:** <https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189>\
**Category:** General\
**Created:** [February 4, 2024, 1:33am UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189 "2024-02-04T01:33:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shom](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/shom/32/291_2.png) [@shom](https://forum.systemcrafters.net/u/shom)\
**Post date:** [February 4, 2024, 1:33am UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/1 "2024-02-04T01:33:42Z")

</div>

Hey all, I have seen some of the charm.sh applications and the BubbleTea framework before but I didn’t know about [Gum](https://github.com/charmbracelet/gum). It calls a single Go binary to enable fairly extensive interactions for a shell script. You don’t write any Go.

I’m going to test it out for a couple interactive helper scripts that I use. Just wanted to share in case anyone was interested. Sorry it’s old gnuws!

---

<div class="post-metadata">

**Author:** ![daviwil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/daviwil/32/1_2.png) [@daviwil](https://forum.systemcrafters.net/u/daviwil)\
**Post date:** [February 4, 2024, 6:15am UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/2 "2024-02-04T06:15:22Z")

</div>

I don’t think it’s been discussed in the community so far, looks useful for script UIs! Let us know if you make anything cool with it

---

<div class="post-metadata">

**Author:** ![shom](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/shom/32/291_2.png) [@shom](https://forum.systemcrafters.net/u/shom)\
**Post date:** [February 4, 2024, 8:38am UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/3 "2024-02-04T08:38:55Z")

</div>

I don’t know about cool but I did scratch my own itch. I made a small script to add photos to my Hugo static site and capturing tagging information easier. The forum doesn’t support the video formats I tried uploading so here’s a link to 1 min demo on Mastodon:

> **[shom 🐧📷🤿🏔️🪚 (@shom@fosstodon.org)](https://fosstodon.org/@shom/111872284324937199)**
>
> Attached: 1 video
> 
> I decided to try out the Gum (single Go binary) by @charmcli@mastodon.social to make adding photos easier to my Hugo static site. This is all done with pretty basic bash scripting (the only kind I'm capable of)! It was impressively...

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [February 4, 2024, 8:54am UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/4 "2024-02-04T08:54:52Z")

</div>

Cool!

But you could also stay within Emacs and use `completing-read` 😉

```lisp
(defun forum/shom/completing-read-example ()
  "Just a quick example how to use `completing-read' instead of gum."
  (interactive)
  (let* ((kind (completing-read "Film Poster: " '("color" "b&w")))
         (format (completing-read "" '("35mm" "medium format")))
         (camera (completing-read "" '("Canon Q17 GIII"
                                       "Kiev 60"
                                       "Olympus 35 RC"))))
    (message "Kind: %s, %s from %s" kind format camera)))

```

![check](https://canada1.discourse-cdn.com/flex029/uploads/systemcrafters/original/1X/1976aa2728ea0a42877ee12683e4ed4f12a7faa6.webp)

Kidding aside, that certainly looks like a nice tool for getting a selection within your own shell scripts 👍

---

<div class="post-metadata">

**Author:** ![benoitj](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/benoitj/32/127_2.png) [@benoitj](https://forum.systemcrafters.net/u/benoitj)\
**Post date:** [February 4, 2024, 3:22pm UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/5 "2024-02-04T15:22:02Z")

</div>

This could make a really nice git shell replacement…

---

<div class="post-metadata">

**Author:** ![shom](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/shom/32/291_2.png) [@shom](https://forum.systemcrafters.net/u/shom)\
**Post date:** [February 4, 2024, 10:05pm UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/6 "2024-02-04T22:05:34Z")

</div>

My bad for suggesting there was a mythical place called outside Emacs, I’ll consider myself banished from the kingdom 😉

Thanks for showing me completing-read, that’s cool, I might use it for other things.

---

<div class="post-metadata">

**Author:** ![shom](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/shom/32/291_2.png) [@shom](https://forum.systemcrafters.net/u/shom)\
**Post date:** [February 4, 2024, 10:08pm UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/7 "2024-02-04T22:08:19Z")

</div>

Yeah, there are some neat git use cases, especially searching for commit hashes based on commit messages, etc. I generally use magit for everything that’s non-trivial git. While that’s true, I’m also trying to earn my way back into the good graces of the community 😝

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [February 5, 2024, 11:53am UTC](https://forum.systemcrafters.net/t/im-trying-out-gum-charm-sh-for-my-shell-scripts-and-its-cool/189/8 "2024-02-05T11:53:40Z")

</div>

You’re welcome 🙂 . Keep in mind that the appearance and behavior of `completing-read` depends on other packages. My demo shows how `completing-read` looks like when used with `vertico`.
