đź“‹ Add user-friendly tasks to your terminal
Tip
All output is Github Action friendly! You can view the output of each example here
go get github.com/fumeapp/taskin
Simplest way to line up and fire off tasks
taskin/examples/simple/main.go
Lines 11 to 33 in 3cd766c
Using a progress bar for a task
taskin/examples/progress/main.go
Lines 11 to 24 in 06b4d11
Customize colors, spinner, and progress bar
taskin/examples/custom/main.go
Lines 13 to 54 in 3cd766c
Nest tasks inside tasks
Lines 23 to 34 in 3cd766c
The *taskin.Task
struct passeed into your task has some useful properties that you can use to customize the task view.
Already demonstrated in most of the examples, you can change t.Title
at any time
Sometimes you might need to temporarily hide you task view in order to prompt a user for input. You can do this by toggling the task.HideView boolean.
Task: func(T *taskin.Task ) error {
t.HideView = true
if err := PromptForInput(); err != nil {
t.HideView = false
return err
}
t.HideView = false
t.Title = "Input received"
return nil
}