• Stars
    star
    9,781
  • Rank 3,607 (Top 0.08 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created almost 11 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimalist Go package aimed at creating Console User Interfaces.

GOCUI - Go Console User Interface

Go Reference

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:

$ go get github.com/jroimartin/gocui

Documentation

Execute:

$ go doc github.com/jroimartin/gocui

Or visit pkg.go.dev to read it online.

Example

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

r2cui

_examples/demo.go

_examples/dynamic.go

Projects using gocui

  • komanda-cli: IRC Client For Developers.
  • vuls: Agentless vulnerability scanner for Linux/FreeBSD.
  • wuzz: Interactive cli tool for HTTP inspection.
  • httplab: Interactive web server.
  • domainr: Tool that checks the availability of domains based on keywords.
  • gotime: Time tracker for projects and tasks.
  • claws: Interactive command line client for testing websockets.
  • terminews: Terminal based RSS reader.
  • diagram: Tool to convert ascii arts into hand drawn diagrams.
  • pody: CLI app to manage Pods in a Kubernetes cluster.
  • kubexp: Kubernetes client.
  • kcli: Tool for inspecting kafka topics/partitions/messages.
  • fac: git merge conflict resolver
  • jsonui: Interactive JSON explorer for your terminal.
  • cointop: Interactive terminal based UI application for tracking cryptocurrencies.

Note: if your project is not listed here, let us know! :)

More Repositories

1

sw

sw is a minimal and sane web framework
Awk
86
star
2

orujo

Orujo allows the execution of several middlewares per route, working seamlessly with the standard net/http library.
Go
59
star
3

rpcmq

RPC protocol over AMQP
Go
47
star
4

ssg

ssg is a slide generation system which provides a markdown-like syntax
Perl
30
star
5

tgbot

Telegram bot
Go
13
star
6

gosw

Minimalist static website generator
Go
11
star
7

intelengine

Information gathering and exploitation architecture
Go
7
star
8

vagrants

Misc Vagrant boxes
Shell
5
star
9

caslock

Row lock mechanism for cassandra, based on lightweight transactions
Go
5
star
10

gfm

Go Feed Mailer
Go
5
star
11

gofsh

Tool to share files through a network in an easy way.
Go
5
star
12

ncn2k14_ctf

NCN 2014 CTF
Ruby
5
star
13

expos

Tiny OS for experimentation
Rust
4
star
14

fuzzemu

This project is just me trying to replicate the work done by Brandon Falk during the Fuzz Week for learning purposes and experimentation.
Rust
4
star
15

dotfiles

My dotfiles.
Emacs Lisp
4
star
16

flatelf

This crate allows to generate a flat binary with the memory representation of an ELF.
Rust
3
star
17

monmq

monmq makes easier to control distributed systems based on rpcmq
Go
3
star
18

trello

Trello client for Go
Go
3
star
19

gorecipes

Examples in Go for some common patterns.
Go
2
star
20

udis86

Go bindings for libudis86
Go
2
star
21

gopod

Podcatcher written in Go
Go
2
star
22

diff_tracer

Diff Tracer POC
Go
2
star
23

ida_scripts

IDA scripts
Python
2
star
24

9tools

Tools I use with p9p
Shell
1
star
25

syscallinfo

Package to access and represent syscalls information
Go
1
star
26

hass-shooter

Home Assistant screenshot capture web server suitable for e-ink displays
Go
1
star
27

expi

expi simplifies writing kernels for the Raspberry Pi 3 Model B.
Rust
1
star
28

quotesrv

Quotes server
Go
1
star
29

clilog

Package clilog provides a slog.Handler for command line tools.
Go
1
star
30

brainfuckers

Game for programming nerds inspired by Core War.
Rust
1
star
31

goprana

goprana is a Prana client for Go
Go
1
star
32

anololcatbot

Telegram bot for ANO
Go
1
star