https://github.com/flowexec/tuikit
Opinionated set of Go TUI development types and tools
https://github.com/flowexec/tuikit
charmbracelet go tui
Last synced: 25 days ago
JSON representation
Opinionated set of Go TUI development types and tools
- Host: GitHub
- URL: https://github.com/flowexec/tuikit
- Owner: flowexec
- License: apache-2.0
- Created: 2024-02-04T22:09:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-01T08:04:58.000Z (about 1 month ago)
- Last Synced: 2026-01-14T23:10:05.632Z (27 days ago)
- Topics: charmbracelet, go, tui
- Language: Go
- Homepage:
- Size: 275 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Terminal UI Kit
[](https://goreportcard.com/report/github.com/flowexec/tuikit)
[](https://pkg.go.dev/github.com/flowexec/tuikit)
[](https://github.com/flowexec/tuikit/releases)
This repo contains types, interfaces, and utilities for building terminal user interfaces in Go.
It's an opinionated framework that uses [charm](https://charm.sh) TUI components and packages for rendering
and handling terminal events.
## Usage
First, install the package:
```bash
go get -u github.com/flowexec/tuikit@latest
```
You can then use the package in your Go code:
```go
package main
import (
"context"
"github.com/flowexec/tuikit"
"github.com/flowexec/tuikit/views"
)
func main() {
ctx := context.Background()
// Define your application metadata
app := &tuikit.Application{Name: "MyApp"}
// Create and start the container
container, err := tuikit.NewContainer(ctx, app)
if err != nil {
panic(err)
}
if err := container.Start(); err != nil {
panic(err)
}
// Create and set your view - the example below used the Markdown view type.
// There are other view types available in the views package.
view := views.NewMarkdownView(container.RenderState(), "# Hello, world!")
if err := container.SetView(view); err != nil {
panic(err)
}
// Wait for the container to exit. Before getting here, you can handle events, update the view, etc.
container.WaitForExit()
}
```
Also see the [sample app](sample/main.go) for examples of how different views can be used.