https://github.com/appvia/komando
Bootstrap for CLI terminal user interfaces, providing beautiful and easily testable components.
https://github.com/appvia/komando
cli golang pretty-print terminal user-interface
Last synced: 10 months ago
JSON representation
Bootstrap for CLI terminal user interfaces, providing beautiful and easily testable components.
- Host: GitHub
- URL: https://github.com/appvia/komando
- Owner: appvia
- License: apache-2.0
- Created: 2021-03-19T09:49:05.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-21T17:18:44.000Z (almost 3 years ago)
- Last Synced: 2025-04-06T00:51:07.830Z (over 1 year ago)
- Topics: cli, golang, pretty-print, terminal, user-interface
- Language: Go
- Homepage:
- Size: 132 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# komando
Build beautiful CLI experiences out of the box in Go.
Komando provides simple terminal UI components like `Header`, `StepGroup`, `NamedValue` and more to help you craft great informative CLI experiences quickly.
Stop wasting time customising lower level components to build what you need.
All components are easily testable with a Fake UI implementation and customisable using intuitive overrides.
## Quickstart
```go
package main
import (
"fmt"
"time"
komando "github.com/appvia/komando"
)
func main() {
ui := komando.ConsoleUI()
ui.Header("Initialising project...")
ui.Output("Running init framework using available steps")
sg := ui.StepGroup()
defer sg.Done()
step1 := sg.Add("Step 1 - validate")
step2 := sg.Add("Step 2 - execute")
step1.Success()
step2.Warning()
for i := 0; i < 5; i++ {
ui.Output(
fmt.Sprintf("Step [2] substep [%v] - sleep 0.5s", i),
komando.WithStyle(komando.LogStyle),
komando.WithIndentChar(komando.LogIndentChar),
komando.WithIndent(3),
)
time.Sleep(500 * time.Millisecond)
}
step3 := sg.Add("Step 3 - finalize")
step3.Error()
ui.Output("")
ui.Output("Initialisation has failed!\nhere's what to do next...", komando.WithErrorBoldStyle())
}
```
Output:
[](./docs/assets/example.gif)