A cross-platform Go-library for updating progress in terminal.
go get -u github.com/apoorvam/goterminal
func main() {
// get an instance of writer
writer := goterminal.New()
for i := 0; i < 100; i = i + 10 {
// add your text to writer's buffer
fmt.Fprintf(writer, "Downloading (%d/100) bytes...\n", i)
// write to terminal
writer.Print()
time.Sleep(time.Millisecond * 200)
// clear the text written by previous write, so that it can be re-written.
writer.Clear()
}
// reset the writer
writer.Reset()
fmt.Println("Download finished!")
}

Another example which uses the go-colortext library to re-write text along with using colors. Here is output of example:

Examples can be found here.
Writer instance.Print() to print text on Terminal. This can be called any number of times.Clear() to move the cursor to position where first Print() started so that it can be over-written.Reset() writer, so it clears its state for next Write.$ claude mcp add goterminal \
-- python -m otcore.mcp_server <graph>