chalk alternatives and similar packages
Based on the "Advanced Console UIs" category.
Alternatively, view chalk alternatives based on common mentions on social networks and blogs.
-
Rich Interactive Widgets for Terminal UIs
Terminal UI library with rich, interactive widgets — written in Golang -
go-prompt
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit. -
tcell
Tcell is an alternate terminal package, similar in some ways to termbox, but better in others. -
pterm
✨ #PTerm is a modern Go module to easily beautify console output. Featuring charts, progressbars, tables, trees, text input, select menus and much more 🚀 It's completely configurable and 100% cross-platform compatible. -
progressbar
A really basic thread-safe progress bar for Golang applications -
asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies. -
uiprogress
A go library to render progress bars in terminal applications -
uitable
A go library to improve readability in terminal apps using tabular data -
termtables
A Go port of the Ruby library terminal-tables for simple ASCII table generation as well as providing markdown and HTML output -
GCli
🖥 Go CLI application, tool library, running CLI commands, support console color, user interaction, progress display, data formatting display, generate bash/zsh completion add more features. Go的命令行应用,工具库,运行CLI命令,支持命令行色彩,用户交互,进度显示,数据格式化显示,生成bash/zsh命令补全脚本 -
yacspin
Yet Another CLi Spinner; providing over 80 easy to use and customizable terminal spinners for multiple OSes -
tabular
Tabular simplifies printing ASCII tables from command line utilities -
bubble-table
A customizable, interactive table component for the Bubble Tea framework -
marker
🖍️ Marker is the easiest way to match and mark strings for colorful terminal outputs! -
ctc
Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method -
crab-config-files-templating
Dynamic configuration file templating tool for kubernetes manifest or general configuration files
Learn any GitHub repo in 59 seconds
Do you think we are missing an alternative of chalk or a related project?
Popular Comparisons
README
chalk
Chalk is a go package for styling console/terminal output.
Check out godoc for some example usage: http://godoc.org/github.com/ttacon/chalk
The api is pretty clean, there are default Colors and TextStyles
which can be mixed to create more intense Styles. Styles and Colors
can be printed in normal strings (i.e. fmt.Sprintf(chalk.Red)
), but
Styles, Colors and TextStyles are more meant to be used to style specific
text segments (i.e. fmt.Println(chalk.Red.Color("this is red")
) or
fmt.Println(myStyle.Style("this is blue text that is underlined"))
).
Examples
There are a few examples in the examples directory if you want to see a very simplified version of what you can do with chalk.
The following code:
package main
import (
"fmt"
"github.com/ttacon/chalk"
)
func main() {
// You can just use colors
fmt.Println(chalk.Red, "Writing in colors", chalk.Cyan, "is so much fun", chalk.Reset)
fmt.Println(chalk.Magenta.Color("You can use colors to color specific phrases"))
// You can just use text styles
fmt.Println(chalk.Bold.TextStyle("We can have bold text"))
fmt.Println(chalk.Underline.TextStyle("We can have underlined text"))
fmt.Println(chalk.Bold, "But text styles don't work quite like colors :(")
// Or you can use styles
blueOnWhite := chalk.Blue.NewStyle().WithBackground(chalk.White)
fmt.Printf("%s%s%s\n", blueOnWhite, "And they also have backgrounds!", chalk.Reset)
fmt.Println(
blueOnWhite.Style("You can style strings the same way you can color them!"))
fmt.Println(
blueOnWhite.WithTextStyle(chalk.Bold).
Style("You can mix text styles with colors, too!"))
// You can also easily make styling functions thanks to go's functional side
lime := chalk.Green.NewStyle().
WithBackground(chalk.Black).
WithTextStyle(chalk.Bold).
Style
fmt.Println(lime("look at this cool lime text!"))
}
Outputs
WARNING
This package should be pretty stable (I don't forsee backwards incompatible changes), but I'm not making any promises :)