https://github.com/jroimartin/gocui
Minimalist Go package aimed at creating Console User Interfaces.
https://github.com/jroimartin/gocui
cui go gocui gui
Last synced: 7 months ago
JSON representation
Minimalist Go package aimed at creating Console User Interfaces.
- Host: GitHub
- URL: https://github.com/jroimartin/gocui
- Owner: jroimartin
- License: bsd-3-clause
- Created: 2014-01-04T02:50:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2025-05-01T12:16:55.000Z (7 months ago)
- Last Synced: 2025-05-08T20:54:40.154Z (7 months ago)
- Topics: cui, go, gocui, gui
- Language: Go
- Homepage:
- Size: 252 KB
- Stars: 10,214
- Watchers: 130
- Forks: 621
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
- my-awesome-starred - jroimartin/gocui - Minimalist Go package aimed at creating Console User Interfaces. (Go)
- stars - jroimartin/gocui
- my-awesome - jroimartin/gocui - 05 star:10.4k fork:0.6k Minimalist Go package aimed at creating Console User Interfaces. (Go)
- awesome-github-repos - jroimartin/gocui - Minimalist Go package aimed at creating Console User Interfaces. (Go)
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-go-cn - gocui
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-robotic-tooling - gocui - Minimalist Go package aimed at creating Console User Interfaces. (Interaction / Command Line)
- awesome-robotic-tooling - gocui - Minimalist Go package aimed at creating Console User Interfaces. (User Interaction / Command Line Interface)
- awesome-go-cn - gocui
- awesome-luooooob - jroimartin/gocui - Minimalist Go package aimed at creating Console User Interfaces. (Go)
- awesome-go-plus - gocui - Minimalist Go library aimed at creating Console User Interfaces.  (Command Line / Advanced Console UIs)
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- fucking-awesome-go - :octocat: gocui - Minimalist Go library aimed at creating Console User Interfaces. :star: 688 :fork_and_knife: 55 (Command Line / Advanced Console UIs)
- StarryDivineSky - jroimartin/gocui
- awesome-go - gocui - | - | - | (Command Line / Advanced Console UIs)
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. Stars:`10.4K`. (Command Line / Advanced Console UIs)
- awesome-golang-repositories - gocui
- my-awesome-list - gocui - Minimalist Go package aimed at creating Console User Interfaces. (Programming Languages / Go)
- awesome-go - gocui - Minimalist Go package aimed at creating Console User Interfaces. - ★ 3643 (Command Line)
- fucking-awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-Char - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. - :arrow_down:182 - :star:777 (Command Line / Advanced Console UIs)
- awesome-go-cn - gocui
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-tuis - gocui
- awesome-go-extra - gocui - 01-04T02:50:20Z|2022-07-29T06:37:58Z| (Build Automation / Advanced Console UIs)
- awesome-go - gocui - Minimalist Go库旨在创建控制台用户界面。 (<span id="命令行-command-line">命令行 Command Line</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-go-with-stars - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-go - jroimartin/gocui
- awesome-go - gocui - Minimalist Go library aimed at creating Console User Interfaces. (Command Line / Advanced Console UIs)
- awesome-go-cn - gocui
README
# GOCUI - Go Console User Interface
[](https://pkg.go.dev/github.com/jroimartin/gocui)
Minimalist Go package aimed at creating Console User Interfaces.
## Features
* Minimalist API.
* Views (the "windows" in the GUI) implement the interface io.ReadWriter.
* Support for overlapping views.
* The GUI can be modified at runtime (concurrent-safe).
* Global and view-level keybindings.
* Mouse support.
* Colored text.
* Customizable edition mode.
* Easy to build reusable widgets, complex layouts...
## Installation
Execute:
```sh
go get github.com/jroimartin/gocui
```
## Documentation
Execute:
```sh
go doc github.com/jroimartin/gocui
```
Or visit [pkg.go.dev](https://pkg.go.dev/github.com/jroimartin/gocui) to read
it online.
## Example
```go
package main
import (
"fmt"
"log"
"github.com/jroimartin/gocui"
)
func main() {
g, err := gocui.NewGui(gocui.OutputNormal)
if err != nil {
log.Panicln(err)
}
defer g.Close()
g.SetManagerFunc(layout)
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
log.Panicln(err)
}
if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
log.Panicln(err)
}
}
func layout(g *gocui.Gui) error {
maxX, maxY := g.Size()
if v, err := g.SetView("hello", maxX/2-7, maxY/2, maxX/2+7, maxY/2+2); err != nil {
if err != gocui.ErrUnknownView {
return err
}
fmt.Fprintln(v, "Hello world!")
}
return nil
}
func quit(g *gocui.Gui, v *gocui.View) error {
return gocui.ErrQuit
}
```
## Screenshots


