spinner

A lightweight Go library that adds a configurable terminal spinner or progress indicator to any CLI application, with 90 built-in character sets.

Library
Go
vv1.23.2
2,530 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
58 /100 Fair
Development Activity 52
Maintenance 24
Community 56
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
69 /100 Good
Architecture 72
Code Quality 68
Innovation 70
Learning Curve 65

spinner is a small, dependency-light Go package that renders an animated terminal indicator while a CLI command performs background work. It ships 90 predefined character sets — arrows, braille dots, block bars, ASCII faces, and more — and accepts any []string as a custom animation frame set.

Beyond the animation itself, the library exposes prefix/suffix text, ANSI color and text-attribute styling via the fatih/color package, a pluggable io.Writer so output can target stdout, stderr, or any custom sink for piping, pre/post-update hook functions, and a final message that prints once the spinner stops. It detects whether it is attached to an interactive terminal and disables itself for CI logs or redirected output, with Windows Terminal-aware cursor handling.

What You Get

  • 90 predefined character sets (arrows, braille dots, block bars, ASCII faces, and more) selectable by index, or supply your own []string
  • Color and text-attribute styling (bold, italic, underline, foreground/background colors) via the fatih/color package
  • Prefix/suffix text, a final completion message, and PreUpdate/PostUpdate hook functions that run on every animation frame
  • A pluggable io.Writer/WriterFile so output can target stdout, stderr, or a custom sink for piping and redirection
  • Automatic terminal detection that disables the spinner when output isn’t an interactive TTY, such as in CI logs

Common Use Cases

  • Showing progress during long-running CLI operations like downloads, builds, or API calls
  • Adding a status indicator to deployment or provisioning tools while waiting on remote operations
  • Piping spinner output to stderr so stdout stays clean for programmatic consumption
  • Building interactive installer or setup scripts that need visual feedback between steps

Under The Hood

Architecture The library is a single-file package (spinner.go) built around one exported Spinner struct configured via a functional-options pattern (Option func(*Spinner), with WithColor, WithSuffix, WithFinalMSG, WithHiddenCursor, WithWriter, and WithWriterFile). New() constructs the struct with sensible defaults, applies the supplied options, and Start() spawns a single goroutine that loops through the active character set, guarding all shared state with a mutex and coordinating shutdown through a buffered stopChan. Because the entire animation and state model lives in one struct with a narrow public surface, the blast radius of any change to the core loop is small and easy to reason about.

Tech Stack Written for Go 1.17+ with a minimal dependency footprint: github.com/fatih/color provides ANSI color and attribute rendering, golang.org/x/term supplies terminal-size and TTY detection, and go-colorable/go-isatty/golang.org/x/sys ride along as indirect dependencies for cross-platform terminal handling. Build and test are driven by a plain Makefile, with CircleCI running make test as the only CI step — there is no bundler, database, or web framework involved since this is a pure terminal-output library.

Code Quality spinner_test.go carries a substantial test suite — construction, start/stop/restart, enable/disable, color validation, custom writers, hook functions, character-set reversal, speed updates, and a dedicated table-driven suite for the line-wrapping/erase math, plus two benchmarks. Error handling is minimal but explicit, using a single sentinel error (errInvalidColor) rather than swallowing bad input. Naming follows idiomatic Go conventions (exported PascalCase, unexported camelCase) and every exported symbol carries a doc comment, though there’s no linter configuration or static-analysis step beyond go test in CI.

API Design The public API favors low boilerplate: spinner.New(charSet, delay) with optional functional-option arguments gets a spinner running in a couple of lines, and the CharSets slice removes any need to hand-author animation frames. Prefix/Suffix fields, Color(), UpdateCharSet(), UpdateSpeed(), and Reverse() cover the common runtime adjustments without needing to reconstruct the spinner. One minor rough edge: the Options struct is declared to describe configuration fields but isn’t actually consumed anywhere in the constructor, leaving it as documentation rather than a used type.

Used by 6 apps in this directory

Go
75%
AGPL 3.0

Coder

Code Editors · Developer Tools · Devops

16,920

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
91
Repo Health
90
Technical
65
Dependency
Built with
Go 75%
TypeScript 23%
Updated today
Go
67%
MIT

hoop

Monitoring · Security

831

A wire-protocol gateway that enforces data masking, command blocking, approval workflows, and full session recording for engineers and AI agents accessing production infrastructure.

View details
86
Repo Health
80
Technical
64
Dependency
Built with
Go 67%
Clojure 15%
JavaScript 11%
Updated today
Go
99%
Apache 2.0

Okteto

Developer Tools · Devops

3,554

Develop applications directly inside your Kubernetes cluster with real-time file sync and instant hot-reload — no more docker build/redeploy cycles.

View details
90
Repo Health
79
Technical
69
Dependency
Built with
Go 99%
Updated yesterday
Go
93%
MIT

Plandex

AI Code Assistants

15,704

An open-source, terminal-based AI coding agent built for large tasks and real codebases — with its own version control for plans, a 2M-token effective context window, and self-hosted or cloud deployment.

View details
49
Repo Health
70
Technical
67
Dependency
Built with
Go 93%
Updated 1 years ago
Go
98%
Apache 2.0

Space Cloud

Authentication · Devops

4,001

Kubernetes-native serverless platform that generates instant GraphQL and REST APIs for any database with built-in auth and real-time subscriptions

View details
50
Repo Health
74
Technical
63
Dependency
Built with
Go 98%
Updated 2 years ago
Go
90%
BSD 3

tau

Devops

5,176

Open-source, Git-native platform-as-a-service for building, deploying, and scaling fullstack apps on your own infrastructure with no DevOps required.

View details
79
Repo Health
82
Technical
64
Dependency
Built with
Go 90%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers