{"id":13409834,"url":"https://github.com/ttacon/chalk","last_synced_at":"2025-12-24T10:32:31.487Z","repository":{"id":18778945,"uuid":"21992141","full_name":"ttacon/chalk","owner":"ttacon","description":"Intuitive package for prettifying terminal/console output. http://godoc.org/github.com/ttacon/chalk","archived":false,"fork":false,"pushed_at":"2019-08-28T23:55:36.000Z","size":155,"stargazers_count":447,"open_issues_count":2,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-07-31T20:38:48.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttacon.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}},"created_at":"2014-07-18T19:38:58.000Z","updated_at":"2024-07-26T13:06:40.000Z","dependencies_parsed_at":"2022-07-14T08:08:57.640Z","dependency_job_id":null,"html_url":"https://github.com/ttacon/chalk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttacon%2Fchalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttacon%2Fchalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttacon%2Fchalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttacon%2Fchalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttacon","download_url":"https://codeload.github.com/ttacon/chalk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243600528,"owners_count":20317291,"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":[],"created_at":"2024-07-30T20:01:03.626Z","updated_at":"2025-12-24T10:32:31.447Z","avatar_url":"https://github.com/ttacon.png","language":"Go","readme":"chalk\n=============\n\nChalk is a go package for styling console/terminal output.\n\nCheck out godoc for some example usage:\nhttp://godoc.org/github.com/ttacon/chalk\n\nThe api is pretty clean, there are default Colors and TextStyles\nwhich can be mixed to create more intense Styles. Styles and Colors\ncan be printed in normal strings (i.e. ```fmt.Sprintf(chalk.Red)```), but\nStyles, Colors and TextStyles are more meant to be used to style specific\ntext segments (i.e. ```fmt.Println(chalk.Red.Color(\"this is red\")```) or\n```fmt.Println(myStyle.Style(\"this is blue text that is underlined\"))```).\n\nExamples\n=============\n\nThere are a few examples in the examples directory if you want to see a very\nsimplified version of what you can do with chalk.\n\nThe following code:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/ttacon/chalk\"\n)\n\nfunc main() {\n\t// You can just use colors\n\tfmt.Println(chalk.Red, \"Writing in colors\", chalk.Cyan, \"is so much fun\", chalk.Reset)\n\tfmt.Println(chalk.Magenta.Color(\"You can use colors to color specific phrases\"))\n\n\t// You can just use text styles\n\tfmt.Println(chalk.Bold.TextStyle(\"We can have bold text\"))\n\tfmt.Println(chalk.Underline.TextStyle(\"We can have underlined text\"))\n\tfmt.Println(chalk.Bold, \"But text styles don't work quite like colors :(\")\n\n\t// Or you can use styles\n\tblueOnWhite := chalk.Blue.NewStyle().WithBackground(chalk.White)\n\tfmt.Printf(\"%s%s%s\\n\", blueOnWhite, \"And they also have backgrounds!\", chalk.Reset)\n\tfmt.Println(\n\t\tblueOnWhite.Style(\"You can style strings the same way you can color them!\"))\n\tfmt.Println(\n\t\tblueOnWhite.WithTextStyle(chalk.Bold).\n\t\t\tStyle(\"You can mix text styles with colors, too!\"))\n\n\t// You can also easily make styling functions thanks to go's functional side\n\tlime := chalk.Green.NewStyle().\n\t\tWithBackground(chalk.Black).\n\t\tWithTextStyle(chalk.Bold).\n\t\tStyle\n\tfmt.Println(lime(\"look at this cool lime text!\"))\n}\n\n```\nOutputs\n![screenshot](https://raw.githubusercontent.com/ttacon/chalk/master/img/chalk_example.png)\n\n\nWARNING\n=============\n\nThis package should be pretty stable (I don't forsee backwards incompatible changes), but I'm not making any promises :)\n","funding_links":[],"categories":["命令行","Command Line","Build Automation","Tools","CUI","高级控制台UI","\u003cspan id=\"命令行-command-line\"\u003e命令行 Command Line\u003c/span\u003e","Go","高级控制台UI`用于构建控制台应用程序和控制台用户界面的库.`"],"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%2Fttacon%2Fchalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttacon%2Fchalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttacon%2Fchalk/lists"}