Prerequisites
Bubble Tea requires Go 1.24.2 or later. You can check your Go version with:
If you need to install or upgrade Go, visit go.dev/doc/install.
Install Bubble Tea
Add Bubble Tea to your project using go get:
go get charm.land/bubbletea/v2
Make sure to use charm.land/bubbletea/v2 (with v2) to get the latest version.
Initialize your module
If you’re starting a new project, first initialize a Go module:
mkdir my-bubbletea-app
cd my-bubbletea-app
go mod init github.com/yourusername/my-bubbletea-app
go get charm.land/bubbletea/v2
Verify installation
Create a simple test file to verify your installation:
package main
import (
"fmt"
tea "charm.land/bubbletea/v2"
)
type model struct{}
func (m model) Init() tea.Cmd { return nil }
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, tea.Quit }
func (m model) View() tea.View { return tea.NewView("Hello, Bubble Tea!") }
func main() {
p := tea.NewProgram(model{})
if _, err := p.Run(); err != nil {
fmt.Printf("Error: %v", err)
}
}
Run your program
Execute the program to see “Hello, Bubble Tea!” displayed: Verify the output
You should see “Hello, Bubble Tea!” printed to your terminal, and the program should exit immediately.
Next steps
Build your first app
Follow the quickstart guide to build an interactive shopping list
Learn core concepts
Understand models, messages, and commands