{"id":23846191,"url":"https://github.com/anishde12020/spintron","last_synced_at":"2025-10-12T11:38:56.820Z","repository":{"id":41957975,"uuid":"479744126","full_name":"AnishDe12020/spintron","owner":"AnishDe12020","description":"Extensible Go terminal spinner with advanced functions with 82 built-in spinners","archived":false,"fork":false,"pushed_at":"2023-05-22T22:03:58.000Z","size":3323,"stargazers_count":15,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-20T10:15:20.216Z","etag":null,"topics":["cli-spinner","cli-spinners","go-spinners","progress-indicator","spinner","spinners","terminal-spinner","terminal-spinners"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/AnishDe12020/spintron","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnishDe12020.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"AnishDe12020","custom":["blog.anishde.dev/sponsor"]}},"created_at":"2022-04-09T14:05:39.000Z","updated_at":"2023-09-08T08:23:11.000Z","dependencies_parsed_at":"2024-06-19T05:30:02.879Z","dependency_job_id":"b6b992f3-6656-4663-9bb8-58c0500a9c05","html_url":"https://github.com/AnishDe12020/spintron","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishDe12020%2Fspintron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishDe12020%2Fspintron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishDe12020%2Fspintron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnishDe12020%2Fspintron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnishDe12020","download_url":"https://codeload.github.com/AnishDe12020/spintron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232256782,"owners_count":18495647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-spinner","cli-spinners","go-spinners","progress-indicator","spinner","spinners","terminal-spinner","terminal-spinners"],"created_at":"2025-01-02T20:53:31.314Z","updated_at":"2025-10-12T11:38:51.797Z","avatar_url":"https://github.com/AnishDe12020.png","language":"Go","funding_links":["https://github.com/sponsors/AnishDe12020","blog.anishde.dev/sponsor"],"categories":[],"sub_categories":[],"readme":"![Peek 2022-04-16 19-13](https://user-images.githubusercontent.com/63192115/163711658-5da3f280-eb32-42de-8c02-cb33618d67b3.gif)\n[![Go Reference](https://pkg.go.dev/badge/github.com/AnishDe12020/spintron.svg)](https://pkg.go.dev/github.com/AnishDe12020/spintron)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/AnishDe12020/spintron)\n\n## Features\n- Start/Stop\n- Customizable character sets (spinners)\n- Custom spinner color, background\t\n- Custom spinner text\n- Restarting and reversing the spinner\n- Prefixed text, symbol and padding before the spinner\n- Changing spinner settings while it is active\n- Getting the spinner settings values\n- Chain, pipe or redirect output\n- Shows the seconds elasped since the spinner started (can be disabled)\n- Ability to Stop and persist the spinner with custom text and a symbol\n- Pre-built `Succeed`, `Fail` and `Info` functions that stops and persists the spinner with pre-defined cross-platform symbol and text\n\n## Usage\n```go\nimport \"github.com/AnishDe12020/spintron\"\n\nfunc main() {\n\ts := spintron.New(spintron.Options{\n\t\tText: \"Working...\",\n\t})\n\n\ts.Start() // Starts the spinner with the initial text\n\t// Some work that will take time. E.g. Downloading a file. Let us have a dummy\n\t// function for now\n\terr := DownloadFile()\n\n\tif err != nil {\n\t\ts.Fail(\"Failed to download the file\") // Stops the spinner and shows a error sign with the given text\n\t} else {\n\t\ts.Success(\"Downloaded the file successfully\") // Stops the spinner and shows a success sign with the given text\n\t}\n}\n```\n## Options\nWhen a new spinner is created, it can be created with a struct of options. Here are the ones available - \n### Color (string) (default: cyan)\nThe color of the spinner\n### Text (string)\nThe text after the spinner\n### HideCursor (bool) (defaukt: true)\nHide the cursor or not\n### Symbol (string)\nA symbol that will come before the prefix text\n### PrefixText (string)\nText that will come before the spinner\n### CharacterSet (string) (default: dots2)\nCharacter set used for the spinner\n### Writer (io.Writer) (default: color.Output)\nstdOut writer\n### Delay (time.Duration) (default: 100 ms)\nDelay between frames in the character set\n### Padding (int)\nNumber of chatacters in padding on the left of the spinner\n### DisableElaspedSeconds (bool) (default: false)\nDisable the elasped seconds timer\n\n\n## Examples\n### Reversing the spinner\n```go\ntime.Sleep(time.Second * 2) // Simulate a long running process\ns.Reverse() // Reverse the spinner's character set\ns.Text = \"I have been reversed\"\ntime.Sleep(time.Second * 2) // Simulate a long running process\ns.Stop() // Stops the spinner\n```\n### Updating the spinner color\n```go\ntime.Sleep(time.Second * 2)                // Simulate a long running process\ns.UpdateCharSet(spintron.CharSets[\"moon\"]) // Update spinner to use a different character set\ns.Text = \"My character set has been updated\"\ntime.Sleep(time.Second * 2) // Simulate a long running process\ns.Stop()                    // Stops the spinner\n```\n### Updating the spinner speed\n```go\ntime.Sleep(time.Second * 2)                         // Simulate a long running process\ns.UpdateSpeed(time.Duration(50) * time.Millisecond) // Update spinner to use a different speed, here making it twice that of the default speed\ns.Text = \"My speed has been updated to make me faster\"\ntime.Sleep(time.Second * 2) // Simulate a long running process\ns.Stop()                    // Stops the spinner\n```\n### Adding padding to the spinner\n```go\ntime.Sleep(time.Second * 2) // Simulate a long running process\ns.Padding = 10              // Add a padding of 10 characters to the left of the spinner\ns.Text = \"My padding has been updated\"\ntime.Sleep(time.Second * 2) // Simulate a long running process\ns.Stop()                    // Stops the spinner\n```\n### Stop and persist the spinner\n```go\ntime.Sleep(time.Second * 2)   // Simulate a long running process\ns.StopAndPersist(\"👀\", \"Heya\") // Stops the spinner and persists it with a custom symbol and text\n```\n### Succeeding, Failing or stopping the spinner with an info message\n```go\ns.Succeed(\"Done!\") // Stops the spinner and persists it with a success sign and message\n```\n```go\ns.Fail(\"Uh oh! Something went wrong!\") // Stops the spinner and persists it with an error sign and message\n```\n```go\ns.Info(\"Star the repo\") // Stops the spinner and persists it with an info sign and message\n```\n\n## Credits\n\nAll commits uptil [561dc95](https://github.com/AnishDe12020/spinner/commit/561dc95eeadf7fc57c2fe6ce2253f0f3361c0f75) are made by [Brian Downs](https://github.com/briandowns) and the contributors to the [original repository, briandowns/spinner](https://github.com/briandowns/spinner). The project has since been renamed to Spintron to differentiate from the original project.\n\nThis is a fork of the [original Go Spinner repository](https://github.com/briandowns/spinner) [Brian Downs](https://github.com/briandowns) licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishde12020%2Fspintron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanishde12020%2Fspintron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishde12020%2Fspintron/lists"}