1
0
Fork 0
A simple and small terminal component library
Find a file
2025-08-04 00:06:53 +02:00
.gitignore Initial Commit 🚀 2025-08-03 18:28:24 +02:00
footer.go Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00
go.mod Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00
go.sum Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00
header.go Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00
helpers.go Initial Commit 🚀 2025-08-03 18:28:24 +02:00
keyValue.go Initial Commit 🚀 2025-08-03 18:28:24 +02:00
LICENSE Initial Commit 🚀 2025-08-03 18:28:24 +02:00
list.go Initial Commit 🚀 2025-08-03 18:28:24 +02:00
message.go Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00
quote.go Initial Commit 🚀 2025-08-03 18:28:24 +02:00
README.md Add table component 2025-08-03 18:28:57 +02:00
ruler.go Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00
table.go Add table component 2025-08-03 18:28:57 +02:00
text.go Initial Commit 🚀 2025-08-03 18:28:24 +02:00
titles.go Replace crypto/ssh/terminal with term 2025-08-04 00:06:53 +02:00

tcl

tcl stands for terminal component library and provides some "compoents" for nicely formatted terminal outputs.

Table of content

Installation

go get go.lks.li/tcl

Documentation

Run godoc -http=:6060 and then open localhost:6060/pkg/git.lks.li/1H0/tcl/

Examples

tcl.Footer()
tcl.FooterC("1H0")

footers

Headers

tcl.Header("your app @ v 0.1.0")

headers

Key-Value Pairs

tcl.KeyValue("Lorem", "Ipsum", 0)
tcl.KeyValue("Dolor", "Sit", 0)
tcl.ListItemU("Lorem", 0)
tcl.KeyValue("Amet", "Consectetur", 1)

key-value

Lists

Single Unordered List Items

tcl.ListItemU("Lorem", 0)
tcl.ListItemU("Ipsum", 0)
tcl.ListItemU("Dolor", 0)
tcl.ListItemU("Sit", 1)
tcl.ListItemU("Amet", 1)
tcl.ListItemU("Consectetur", 2)

ul-items

Single Ordered List Items

tcl.ListItemO("Lorem", 0, 1)
tcl.ListItemO("Ipsum", 0, 2)
tcl.ListItemO("Dolor", 0, 3)
tcl.ListItemO("Sit", 1, 1)
tcl.ListItemO("Amet", 1, 2)
tcl.ListItemO("Consectetur", 2, 1)

ol-items

Unordered List by Array

tcl.ListU([]string{"Lorem", "Ipsum", "Dolor"}, 0)
tcl.ListU([]string{"Sit", "Amet"}, 1)
tcl.ListU([]string{"Consectetur"}, 2)

ul-list

Ordered List by Array

tcl.ListO([]string{"Lorem", "Ipsum", "Dolor"}, 0)
tcl.ListO([]string{"Sit", "Amet"}, 1)
tcl.ListO([]string{"Consectetur"}, 2)

ol-list

Messages

tcl.Message("Lorem", "This is a 'black' message", "black")
tcl.Message("Lorem", "This is a 'blue' message", "blue")
tcl.Message("Lorem", "This is a 'cyan' message", "cyan")
tcl.Message("Lorem", "This is a 'green' message", "green")
tcl.Message("Lorem", "This is a 'magenta' message", "magenta")
tcl.Message("Lorem", "This is a 'red' message", "red")
tcl.Message("Lorem", "This is a 'white' message", "white")
tcl.Message("Lorem", "This is a 'yellow' message", "yellow")
tcl.Message("Lorem", "This is a 'default' message", "")

messages

Quotes

tcl.Quote("Lorem ipsum dolor sit amet.")

quotes

Rulers

tcl.Ruler("/")
tcl.Ruler("- ")
tcl.Ruler("=")
tcl.Ruler(" - ")
tcl.Ruler(" = ")
tcl.Ruler("")

rulers

Text

tcl.Text("Lorem Ipsum Dolor Sit Amet.")

texts

Titles

tcl.Title("The normal title")
tcl.TitleC("The centered title")
tcl.FullTitle("A Title that spans the whole width")
tcl.SubTitle("The subtitle")

titles

Tables

tcl.Table([]string{"Col 1", "Col 2", "Col 3"}, [][]string{
  {"Lorem", "Ipsum", "Dolor"},
  {"Lorem", "Ipsum", "Dolor"},
  {"Lorem", "Ipsum", "Dolor"},
})

Tables

ToDo

  • Nested Lists
  • Tests
  • Ability to loop over Struct and print entrys as key-value pairs
  • Tables
  • Customizable Colors and other settings like indentation

Credits

  • @fatih and the maintainers of the fatih/color for providing the main dependency of this package

License

The GNU GENERAL PUBLIC LICENSE - see LICENSE