MCPcopy Index your code
hub / github.com/apoorvam/goterminal

github.com/apoorvam/goterminal @v1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0 ↗ · + Follow
18 symbols 37 edges 7 files 8 documented · 44% 1 cross-repo links updated 7y agov1.0 · 2019-03-12★ 61
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

goterminal GoDoc

A cross-platform Go-library for updating progress in terminal.

Installation

  go get -u github.com/apoorvam/goterminal

Usage

    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!")
    }

Example

output

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

output

Examples can be found here.

More on usage

  • Create a Writer instance.
  • Add your text to writer's buffer and call Print() to print text on Terminal. This can be called any number of times.
  • Call 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.

Core symbols most depended-on inside this repo

Shape

Method 7
Function 4
Struct 4
TypeAlias 3

Languages

Go100%

Modules by API surface

writer_win.go8 symbols
writer.go5 symbols
writer_posix.go2 symbols
writer_test.go1 symbols
examples/download_progress.go1 symbols
examples/color_terminal.go1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add goterminal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page