{"id":13409739,"url":"https://github.com/logrusorgru/aurora","last_synced_at":"2026-01-16T20:50:42.371Z","repository":{"id":45820572,"uuid":"73023534","full_name":"logrusorgru/aurora","owner":"logrusorgru","description":"Golang ultimate ANSI-colors that supports Printf/Sprintf methods","archived":false,"fork":false,"pushed_at":"2025-01-07T06:05:32.000Z","size":586,"stargazers_count":1468,"open_issues_count":2,"forks_count":54,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-21T13:39:06.983Z","etag":null,"topics":["ansi-colors","golang","printf"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logrusorgru.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-06T22:37:12.000Z","updated_at":"2025-08-21T05:57:23.000Z","dependencies_parsed_at":"2025-01-26T00:11:27.475Z","dependency_job_id":"bc0c86c2-e569-4e4d-8eb6-f67f6529bf98","html_url":"https://github.com/logrusorgru/aurora","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/logrusorgru/aurora","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logrusorgru%2Faurora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logrusorgru%2Faurora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logrusorgru%2Faurora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logrusorgru%2Faurora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logrusorgru","download_url":"https://codeload.github.com/logrusorgru/aurora/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logrusorgru%2Faurora/sbom","scorecard":{"id":597442,"data":{"date":"2025-08-11","repo":{"name":"github.com/logrusorgru/aurora","commit":"24c528a74b3127045c0efb9b2dee7ee5ad5bd6ed"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 5/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/logrusorgru/aurora/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/logrusorgru/aurora/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/logrusorgru/aurora/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/logrusorgru/aurora/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/logrusorgru/aurora/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/logrusorgru/aurora/test.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T23:30:05.376Z","repository_id":45820572,"created_at":"2025-08-20T23:30:05.376Z","updated_at":"2025-08-20T23:30:05.376Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ansi-colors","golang","printf"],"created_at":"2024-07-30T20:01:03.101Z","updated_at":"2026-01-16T20:50:42.341Z","avatar_url":"https://github.com/logrusorgru.png","language":"Go","readme":"Aurora\n======\n\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white)](https://pkg.go.dev/github.com/logrusorgru/aurora/v3?tab=doc)\n[![Unlicense](https://img.shields.io/badge/license-unlicense-blue.svg)](http://unlicense.org/)\n[![Build Status](https://github.com/logrusorgru/aurora/workflows/build/badge.svg)](https://github.com/logrusorgru/aurora/actions?workflow=build)\n[![Coverage Status](https://coveralls.io/repos/github/logrusorgru/aurora/badge.svg?branch=master)](https://coveralls.io/github/logrusorgru/aurora?branch=master)\n[![GoReportCard](https://goreportcard.com/badge/logrusorgru/aurora)](https://goreportcard.com/report/logrusorgru/aurora)\n\nUltimate ANSI colors for Golang. The package supports Printf/Sprintf etc.\n\n\n![aurora logo](https://github.com/logrusorgru/aurora/blob/master/gopher_aurora.png)\n\n# TOC\n\n- [Installation](#installation)\n- [Usage](#usage)\n  + [Simple](#simple)\n  + [Printf](#printf)\n  + [aurora.Sprintf](#aurorasprintf)\n  + [Enable/Disable colors](#enabledisable-colors)\n  + [Hyperlinks, default colorizer, and configurations](#hyperlinks-default-colorizer-and-configurations)\n- [Chains](#chains)\n- [Colorize](#colorize)\n- [Grayscale](#grayscale)\n- [8-bit colors](#8-bit-colors)\n- [Supported Colors \u0026 Formats](#supported-colors--formats)\n  + [All colors](#all-colors)\n  + [Standard and bright colors](#standard-and-bright-colors)\n  + [Formats are likely supported](#formats-are-likely-supported)\n  + [Formats are likely unsupported](#formats-are-likely-unsupported)\n- [Limitations](#limitations)\n  + [Windows](#windows)\n  + [TTY](#tty)\n- [Licensing](#licensing)\n\n# Installation\n\n##### Version 1.x\n\nUsing gopkg.in.\n\n```\ngo get -u gopkg.in/logrusorgru/aurora.v1\n```\n\n##### Version 2.x\n\n```\ngo get -u github.com/logrusorgru/aurora\n```\n\n##### Go modules support, version v3+\n\nGet\n```\ngo get -u github.com/logrusorgru/aurora/v3\n```\n\nThe v3 was introduced to support `go.mod` and leave previous import paths as is.\nCurrently, there is no changes between them (excluding the importpath's /v3 tail).\n\n##### The latest version\n\n```\ngo get -u github.com/logrusorgru/aurora/v4\n```\n\nWith hyperlinks.\n\n# Test\n\n```\ngo test -cover -race github.com/logrusorgru/aurora/v4\n```\n\nReplace the import path with your, if it's different.\n\n# Usage\n\n### Simple\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/logrusorgru/aurora/v4\"\n)\n\nfunc main() {\n\tfmt.Println(\"Hello,\", aurora.Magenta(\"Aurora\"))\n\tfmt.Println(aurora.Bold(aurora.Cyan(\"Cya!\")))\n}\n\n```\n\n![simple png](https://github.com/logrusorgru/aurora/blob/master/simple.png)\n\n### Printf\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/logrusorgru/aurora/v4\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Got it %d times\\n\", aurora.Green(1240))\n\tfmt.Printf(\"PI is %+1.2e\\n\", aurora.Cyan(3.14))\n}\n\n```\n\n![printf png](https://github.com/logrusorgru/aurora/blob/master/printf.png)\n\n### aurora.Sprintf\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/logrusorgru/aurora/v4\"\n)\n\nfunc main() {\n\tfmt.Println(aurora.Sprintf(aurora.Magenta(\"Got it %d times\"), aurora.Green(1240)))\n}\n\n```\n\n![sprintf png](https://github.com/logrusorgru/aurora/blob/master/sprintf.png)\n\n### Enable/Disable colors\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"flag\"\n\n\t\"github.com/logrusorgru/aurora/v4\"\n)\n\n// colorizer\nvar au *aurora.Aurora\n\nvar colors = flag.Bool(\"colors\", false, \"enable or disable colors\")\n\nfunc init() {\n\tflag.Parse()\n\tau = aurora.New(WithColors(*colors))\n}\n\nfunc main() {\n\t// use colorizer\n\tfmt.Println(au.Green(\"Hello\"))\n}\n\n```\nWithout flags:\n![disable png](https://github.com/logrusorgru/aurora/blob/master/disable.png)\n\nWith `-colors` flag:\n![enable png](https://github.com/logrusorgru/aurora/blob/master/enable.png)\n\n### Hyperlinks, default colorizer, and configurations\n\n[Hyperlinks feature description](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).\n\nAdd a red hyperlinks with text \"Example\" that is referencing to\nhttp://example.com.\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\n\t\"github.com/logrusorgru/aurora/v4\"\n)\n\nfunc main() {\n\tvar conf = aurora.NewConfig()\n\tconf.AddFlags(flag.CommandLine, \"prefix.\")\n\tflag.Parse()\n\n\taurora.DefaultColorizer = aurora.New(conf.Options()...) // set global\n\n\tfmt.Println(aurora.Red(\"Example\").Hyperlink(\"http://example.com/\"))\n}\n```\nDepending flags:\n![depending flags png](https://github.com/logrusorgru/aurora/blob/master/aurora_hyperlinks_flags.png)\n![depending flags gif](https://github.com/logrusorgru/aurora/blob/master/aurora_hyperlinks.gif)\n\n# Chains\n\nThe following samples are equal\n\n```go\nx := aurora.BgMagenta(aurora.Bold(aurora.Red(\"x\")))\n```\n\n```go\nx := aurora.Red(\"x\").Bold().BgMagenta()\n```\n\nThe second is more readable\n\n# Colorize\n\nThere is `Colorize` function that allows to choose some colors and\nformat from a side\n\n```go\n\nfunc getColors() Color {\n\t// some stuff that returns appropriate colors and format\n}\n\n// [...]\n\nfunc main() {\n\tfmt.Println(aurora.Colorize(\"Greeting\", getColors()))\n}\n\n```\nLess complicated example\n\n```go\nx := aurora.Colorize(\"Greeting\", GreenFg|GrayBg|BoldFm)\n```\n\nUnlike other color functions and methods (such as Red/BgBlue etc)\na `Colorize` clears previous colors\n\n```go\nx := aurora.Red(\"x\").Colorize(BgGreen) // will be with green background only\n```\n\n# Grayscale\n\n```go\nfmt.Println(\"  \",\n\taurora.Gray(1-1, \" 00-23 \").BgGray(24-1),\n\taurora.Gray(4-1, \" 03-19 \").BgGray(20-1),\n\taurora.Gray(8-1, \" 07-15 \").BgGray(16-1),\n\taurora.Gray(12-1, \" 11-11 \").BgGray(12-1),\n\taurora.Gray(16-1, \" 15-07 \").BgGray(8-1),\n\taurora.Gray(20-1, \" 19-03 \").BgGray(4-1),\n\taurora.Gray(24-1, \" 23-00 \").BgGray(1-1),\n)\n```\n\n![grayscale png](https://github.com/logrusorgru/aurora/blob/master/aurora_grayscale.png)  \n\n# 8-bit colors\n\nMethods `Index` and `BgIndex` implements 8-bit colors.\n\n| Index/BgIndex  |    Meaning      | Foreground | Background |\n| -------------- | --------------- | ---------- | ---------- |\n|      0-  7     | standard colors |   30- 37   |   40- 47   |\n|      8- 15     | bright colors   |   90- 97   |  100-107   |\n|     16-231     | 216 colors      |   38;5;n   |   48;5;n   |\n|    232-255     | 24 grayscale    |   38;5;n   |   48;5;n   |\n\nExample\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/logrusorgru/aurora\"\n)\n\nfunc main() {\n\tfor i := uint8(16); i \u003c= 231; i++ {\n\t\tfmt.Println(i, aurora.Index(i, \"pew-pew\"), aurora.BgIndex(i, \"pew-pew\"))\n\t}\n}\n```\n\n# Supported colors \u0026 formats\n\n- formats\n  + bold (1)\n  + faint (2)\n  + doubly-underline (21)\n  + fraktur (20)\n  + italic (3)\n  + underline (4)\n  + slow blink (5)\n  + rapid blink (6)\n  + reverse video (7)\n  + conceal (8)\n  + crossed out (9)\n  + framed (51)\n  + encircled (52)\n  + overlined (53)\n- background and foreground colors, including bright\n  + black\n  + red\n  + green\n  + yellow (brown)\n  + blue\n  + magenta\n  + cyan\n  + white\n  + 24 grayscale colors\n  + 216 8-bit colors\n\n### All colors\n\n![linux png](https://github.com/logrusorgru/aurora/blob/master/aurora_colors_black.png)  \n![white png](https://github.com/logrusorgru/aurora/blob/master/aurora_colors_white.png)  \n\n### Standard and bright colors\n\n![linux black standard png](https://github.com/logrusorgru/aurora/blob/master/aurora_black_standard.png)\n![linux white standard png](https://github.com/logrusorgru/aurora/blob/master/aurora_white_standard.png)\n\n### Formats are likely supported\n\n![formats supported gif](https://github.com/logrusorgru/aurora/blob/master/aurora_formats.gif)\n\n### Formats are likely unsupported\n\n![formats rarely supported png](https://github.com/logrusorgru/aurora/blob/master/aurora_rarely_supported.png)\n\n# Limitations\n\nThere is no way to represent `%T` and `%p` with colors using\na standard approach\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/logrusorgru/aurora\"\n)\n\nfunc main() {\n\tvar (\n\t\tr = aurora.Red(\"red\")\n\t\ti int\n\t)\n\tfmt.Printf(\"%T %p\\n\", r, aurora.Green(\u0026i))\n}\n```\n\nOutput will be without colors\n\n```\naurora.value %!p(aurora.value={0xc42000a310 768 0})\n```\n\nThe obvious workaround is `Red(fmt.Sprintf(\"%T\", some))`\n\n### Windows\n\nThe Aurora provides ANSI colors only, so there is no support for Windows. That said, there are workarounds available.\nCheck out these comments to learn more:\n\n- [Using go-colorable](https://github.com/logrusorgru/aurora/issues/2#issuecomment-299014211).\n- [Using registry for Windows 10](https://github.com/logrusorgru/aurora/issues/10#issue-476361247).\n\n### TTY\n\nThe Aurora has no internal TTY detectors by design. Take a look\n [this comment](https://github.com/logrusorgru/aurora/issues/2#issuecomment-299030108) if you want turn\non colors for a terminal only, and turn them off for a file.\n\n### Licensing\n\nCopyright \u0026copy; 2016-2022 The Aurora Authors. This work is free.\nIt comes without any warranty, to the extent permitted by applicable\nlaw. You can redistribute it and/or modify it under the terms of the\nthe Unlicense. See the LICENSE file for more details.\n","funding_links":[],"categories":["Go","Command Line","Go 🐹","命令行","Tools","Build Automation","高级控制台UI","高级控制台UI`用于构建控制台应用程序和控制台用户界面的库.`","Libraries","\u003cspan id=\"命令行-command-line\"\u003e命令行 Command Line\u003c/span\u003e"],"sub_categories":["Advanced Console UIs","高级控制台用户界面","高级控制台界面","标准 CLI","高級控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogrusorgru%2Faurora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogrusorgru%2Faurora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogrusorgru%2Faurora/lists"}