MCPcopy Index your code
hub / github.com/FGRibreau/spinners

github.com/FGRibreau/spinners @v4.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.2.0 ↗ · + Follow
30 symbols 53 edges 11 files 14 documented · 47%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Spinners - 🛎 60+ Elegant terminal spinners for Rust

Cargo version Crates.io docs.rs Crates.io Slack

❤️ Shameless plug

200083093-cf48fcab-d95c-4a59-ac66-6e167dd33e7e

Install

See Cargo page

Usage

use spinners::{Spinner, Spinners};
use std::thread::sleep;
use std::time::Duration;

fn main() {
    let mut sp = Spinner::new(Spinners::Dots9, "Waiting for 3 seconds".into());
    sleep(Duration::from_secs(3));
    sp.stop();
}

Example

cargo run --example cycle
cargo run --example simple

Feature flags

osc-progress

Enables native terminal progress bar support via the ConEmu OSC 9;4 protocol. Terminals like Ghostty, Windows Terminal, iTerm2, Kitty, and WezTerm render these as GUI progress bars in the title/tab bar. Unsupported terminals silently ignore the sequences.

[dependencies]
spinners = { version = "4.1.0", features = ["osc-progress"] }

The progress bar is emitted as an indeterminate/pulsing indicator while the spinner is active, and cleared when the spinner is stopped or dropped. Sequences are only emitted when the output stream is a terminal, so piped output is unaffected.

Signal handling caveat: If the process is killed abruptly (e.g. SIGINT via Ctrl+C, SIGKILL), the Drop implementation may not run and the progress bar won't be cleared. Terminals like Ghostty mitigate this with a ~15-second auto-clear timeout, but for immediate cleanup, applications should install their own signal handler that stops the spinner (e.g. by dropping it or calling .stop()) before exiting.

License

MIT © François-Guillaume Ribreau, James Cordor

Core symbols most depended-on inside this repo

stop
called by 8
src/lib.rs
match_target
called by 5
src/utils/stream.rs
stop_inner
called by 2
src/lib.rs
is_terminal
called by 2
src/utils/stream.rs
osc_start
called by 2
src/utils/stream.rs
osc_stop
called by 2
src/utils/stream.rs
stop_with_symbol
called by 1
src/lib.rs
stop_with_newline
called by 1
src/lib.rs

Shape

Method 21
Function 5
Class 2
Enum 2

Languages

Rust100%

Modules by API surface

src/lib.rs13 symbols
src/utils/stream.rs10 symbols
src/utils/spinner_names.rs1 symbols
src/utils/spinner_data.rs1 symbols
examples/timer.rs1 symbols
examples/stop_symbol.rs1 symbols
examples/stop_persist.rs1 symbols
examples/simple.rs1 symbols
examples/cycle.rs1 symbols

For agents

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

⬇ download graph artifact