{"id":50965689,"url":"https://github.com/harehare/ansi.mq","last_synced_at":"2026-06-18T20:02:00.380Z","repository":{"id":364499540,"uuid":"1267992140","full_name":"harehare/ansi.mq","owner":"harehare","description":"ANSI terminal escape code utilities implemented as an mq module.","archived":false,"fork":false,"pushed_at":"2026-06-13T07:57:37.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T09:26:28.909Z","etag":null,"topics":["color","markdown","mq"],"latest_commit_sha":null,"homepage":"https://mqlang.org","language":null,"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/harehare.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-13T03:31:00.000Z","updated_at":"2026-06-13T07:57:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/harehare/ansi.mq","commit_stats":null,"previous_names":["harehare/ansi.mq"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/harehare/ansi.mq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fansi.mq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fansi.mq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fansi.mq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fansi.mq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harehare","download_url":"https://codeload.github.com/harehare/ansi.mq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fansi.mq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34505423,"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-06-18T02:00:06.871Z","response_time":128,"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":["color","markdown","mq"],"created_at":"2026-06-18T20:01:56.395Z","updated_at":"2026-06-18T20:02:00.372Z","avatar_url":"https://github.com/harehare.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eansi.mq\u003c/h1\u003e\n\nANSI terminal escape code utilities implemented as an [mq](https://github.com/harehare/mq) module.\n\n## Features\n\n- Text styles: bold, dim, italic, underline, strikethrough\n- Standard foreground colors (8 colors + bright variants)\n- Background colors (8 colors)\n- 24-bit RGB foreground and background colors\n- Strip ANSI codes from strings\n- Compute visible length (excluding escape codes)\n\n## Installation\n\nCopy `ansi.mq` to your mq module directory:\n\n```sh\ncp ansi.mq ~/.mq/\n```\n\n### HTTP Import (no local installation needed)\n\nIf `mq` was built with the `http-import` feature, you can import directly from GitHub without any local setup:\n\n```sh\nmq -I raw 'import \"github.com/harehare/ansi.mq\" | ansi::ansi_green(\"✓ OK\")' input.md\n```\n\nPin to a specific release with `@vX.Y.Z`:\n\n```sh\nmq -I raw 'import \"github.com/harehare/ansi.mq@v1.0.0\" | ansi::ansi_green(\"✓ OK\")' input.md\n```\n\n## Usage\n\n```sh\nmq -I raw 'import \"ansi\" | ansi::ansi_green(\"✓ OK\")' input.md\n```\n\n## API\n\n### Styles\n\n| Function | Effect |\n|---|---|\n| `ansi_bold(s)` | **Bold** |\n| `ansi_dim(s)` | Dim / faint |\n| `ansi_italic(s)` | *Italic* |\n| `ansi_underline(s)` | Underline |\n| `ansi_strikethrough(s)` | ~~Strikethrough~~ |\n\n### Foreground Colors\n\n| Function | Color |\n|---|---|\n| `ansi_red(s)` | Red |\n| `ansi_green(s)` | Green |\n| `ansi_yellow(s)` | Yellow |\n| `ansi_blue(s)` | Blue |\n| `ansi_magenta(s)` | Magenta |\n| `ansi_cyan(s)` | Cyan |\n| `ansi_white(s)` | White |\n| `ansi_bright_red(s)` | Bright red |\n| `ansi_bright_green(s)` | Bright green |\n| `ansi_bright_yellow(s)` | Bright yellow |\n| `ansi_bright_blue(s)` | Bright blue |\n| `ansi_bright_magenta(s)` | Bright magenta |\n| `ansi_bright_cyan(s)` | Bright cyan |\n| `ansi_bright_white(s)` | Bright white |\n\n### Background Colors\n\n| Function | Color |\n|---|---|\n| `ansi_bg_red(s)` | Red background |\n| `ansi_bg_green(s)` | Green background |\n| `ansi_bg_yellow(s)` | Yellow background |\n| `ansi_bg_blue(s)` | Blue background |\n| `ansi_bg_magenta(s)` | Magenta background |\n| `ansi_bg_cyan(s)` | Cyan background |\n| `ansi_bg_white(s)` | White background |\n\n### 24-bit Color\n\n| Function | Description |\n|---|---|\n| `ansi_rgb(s, r, g, b)` | 24-bit foreground (0–255 per channel) |\n| `ansi_bg_rgb(s, r, g, b)` | 24-bit background (0–255 per channel) |\n\n### Utilities\n\n| Function | Description |\n|---|---|\n| `ansi_strip(s)` | Remove all ANSI escape codes |\n| `ansi_len(s)` | Visible length (after stripping codes) |\n\n## Example\n\n```sh\n# Colorize mq test output labels\nmq '\n  import \"ansi\"\n  | if (contains(., \"PASS\")):\n      ansi::ansi_green(.)\n    else:\n      ansi::ansi_red(.)\n' results.md\n\n# Print a header with bold cyan text\nmq -I raw '\"Report\" | import \"ansi\" | ansi::ansi_bold(ansi::ansi_cyan(.))' /dev/null\n```\n\n## Compatibility\n\nRequires [mq](https://github.com/harehare/mq) v0.5 or later.\nTerminal support depends on the environment; most modern terminals support ANSI codes.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fansi.mq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharehare%2Fansi.mq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fansi.mq/lists"}