{"id":24309049,"url":"https://github.com/didas-git/tasai-zig","last_synced_at":"2026-05-27T21:31:53.996Z","repository":{"id":271476190,"uuid":"913505571","full_name":"Didas-git/tasai-zig","owner":"Didas-git","description":"A set of tools for dealing with the terminal.","archived":false,"fork":false,"pushed_at":"2025-04-15T15:40:05.000Z","size":217,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T16:37:36.322Z","etag":null,"topics":["zig","zig-library","zig-package","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Didas-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-01-07T20:17:39.000Z","updated_at":"2025-02-11T22:54:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"63378f85-5c77-4e16-be42-aa3864239e04","html_url":"https://github.com/Didas-git/tasai-zig","commit_stats":null,"previous_names":["didas-git/tasai-zig"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Didas-git/tasai-zig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Didas-git%2Ftasai-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Didas-git%2Ftasai-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Didas-git%2Ftasai-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Didas-git%2Ftasai-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Didas-git","download_url":"https://codeload.github.com/Didas-git/tasai-zig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Didas-git%2Ftasai-zig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["zig","zig-library","zig-package","ziglang"],"created_at":"2025-01-17T05:12:25.904Z","updated_at":"2026-05-27T21:31:53.980Z","avatar_url":"https://github.com/Didas-git.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tasai\n\nTasai is a zig library that provides multiple comptime utilities to colorize your terminal messages, logs, and much more, if it supports [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) then tasai will work.\n\nLet's make our terminals more colorful (多彩).\n\n###### If you are looking for the javascript/typescript version, it can be found [here](https://github.com/Didas-git/tasai).\n\n# Installation\n\nTasai is available using the `zig fetch` command.\n\n```sh\nzig fetch --save git+https://github.com/Didas-git/tasai-zig\n```\n\nTo add it yo your project, after running the command above add the following to your build file:\n\n```zig\nconst tasai = b.dependency(\"tasai\", .{\n    .target = target,\n    .optimize = optimize,\n});\nexe.root_module.addImport(\"tasai\", tasai.module(\"tasai\"));\n```\n\n# Usage\n\nTasai provides 2 different comptime apis\n\n## String API\n\nThe available tags are documented on the function itself.\n\n```zig\nconst print = @import(\"std\").debug.print;\nconst SGR = @import(\"tasai\").SGR;\n\n// Print \"hello\" in pink (with a hex code) and \"world\" in bold blue (the blue comes from the 8bit ANSI codes)\nprint(SGR.parseString(\"\u003cf:#ff00ef\u003ehello\u003cr\u003e \u003cf:33\u003e\u003cb\u003eworld\u003cr\u003e\u003cr\u003e\\n\"), .{});\n\n// Escaping '\u003c'\nprint(SGR.parseString(\"This will print \u003cf:red\u003e\\\\\u003c\u003cr\u003e in red\\n\"), .{});\n```\n\n## Verbose API\n\nWhile this API is rather overkill it can be rather useful given it includes all* the SGR codes and is not limited to a few set of them.\n\n###### * all the ones documented [here](https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters).\n\n```zig\nconst print = @import(\"std\").debug.print;\nconst SGR = @import(\"tasai\").SGR;\n\n// // Print \"hello\" in pink (with a hex code) and \"world\" in bold blue\nprint(\"{s} {s}\\n\", .{\n    SGR.verboseFormat(\"Hello\", \u0026.{\n            .{ .Color = .{ .Foreground = .{ .@\"24bit\" = .{ .r = 255, .g = 0, .b = 239 } } } },\n        }, \u0026.{\n            .{ .Attribute = .Default_Foreground_Color },\n        }),\n    SGR.verboseFormat(\"World\", \u0026.{\n            .{ .Attribute = .Bold },\n            .{ .Color = .{ .Foreground = .{ .@\"8bit\" = 33 } } },\n        }, \u0026.{\n            .{ .Attribute = .Not_Bold_Or_Dim },\n            .{ .Attribute = .Default_Foreground_Color },\n        }),\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidas-git%2Ftasai-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdidas-git%2Ftasai-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidas-git%2Ftasai-zig/lists"}