Contents

How to write Bubbletea CLI app in golang

Intro

In my previous post I wrote about Gum which is a program that allows writing beautiful interactive shell scripts.

If you want to go beyond simple shell scripts, you can use bubbletea with lipgloss for terminal styles and layout, also utilizing bubbles. Check also other goodies on charm.sh page for yourself!

How to write Bubbletea CLI app in golang

  1. have an idea
  2. think about screen transitions, models. key bindings
  3. explore existing “bubbles”
  4. familiarize yourself with examples
  5. start coding
  6. profit!

Really, how to start?

You can start by cloning bubbletea-app-template which is a small working example app which imports bubbles and lipgloss.

If you want to, for example, create a replacer app, you need to:

  1. clone the repo: git clone git@github.com:charmbracelet/bubbletea-app-template.git replacer
  2. change module name to yours: go mod edit -module github.com/kamchy/go/replacer
  3. start coding…