{
  "slug": "ansi-log-renderer",
  "name": "gizza-ai/ansi-log-renderer",
  "version": "0.1.0",
  "title": "ANSI Log Renderer — convert terminal colors to HTML — gizza.ai",
  "description": "Paste ANSI-colored terminal output or CI logs and render them as HTML, or strip escape codes to plain text. Handles 16-color, 256-color, and truecolor SGR codes.",
  "tags": [
    "ansi to html",
    "ansi log renderer",
    "terminal colors",
    "ci log html",
    "ansi escape codes",
    "strip ansi",
    "xterm colors",
    "truecolor ansi"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/ansi-log-renderer/",
    "markdown": "https://gizza.ai/tools/ansi-log-renderer/index.md",
    "descriptor": "https://gizza.ai/tools/ansi-log-renderer/tool.json",
    "deep_link_example": "https://gizza.ai/tools/ansi-log-renderer/?text=%1B%5B1%3B32m%E2%9C%93%20build%20passed%1B%5B0m%0A%1B%5B31mERROR%1B%5B0m%3A%20missing%20file&output=html&theme=dark&styles=inline"
  },
  "cli": "gizza tool ansi-log-renderer \"\u001b[1;32m✓ build passed\u001b[0m\n\u001b[31mERROR\u001b[0m: missing file\"",
  "tool": {
    "description": "Parse raw terminal output containing ANSI escape codes and render it to clean colored HTML, or strip the codes to plain text. Pass the captured terminal/log text as 'text'. output='html' (default) reproduces the SGR colors and styles — 16 basic + bright colors, the 256-color xterm palette, 24-bit RGB truecolor, and bold/dim/italic/underline/inverse/strikethrough — as styled <span>s inside a themed <pre>; non-SGR control (cursor moves, screen erase, OSC titles/hyperlinks) is dropped. output='text' strips every escape sequence and returns plain text. theme='dark'|'light' sets the default colors/background for HTML. styles='inline' (self-contained style attributes) or 'classes' (class names + a <style> block). Unicode and newlines are preserved.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "output": {
          "default": "html",
          "description": "Output format. 'html' (default) renders the colors/styles as a self-contained <pre> of styled <span>s. 'text' strips every escape sequence and returns plain readable text.",
          "enum": [
            "html",
            "text"
          ],
          "type": "string"
        },
        "styles": {
          "default": "inline",
          "description": "How HTML colors are applied. 'inline' (default) emits self-contained style=\"...\" attributes. 'classes' emits class=\"ansi-...\" spans plus a <style> block (basic colors become classes; 256/RGB colors stay inline). Ignored when output='text'.",
          "enum": [
            "inline",
            "classes"
          ],
          "type": "string"
        },
        "text": {
          "description": "The raw terminal/log output containing ANSI escape codes to render, e.g. \\x1b[31mERROR\\x1b[0m.",
          "type": "string"
        },
        "theme": {
          "default": "dark",
          "description": "Background theme for HTML output — sets the default foreground/background colors and the <pre> background. 'dark' (default) = light text on #0c0c0c; 'light' = dark text on #ffffff. Ignored when output='text'.",
          "enum": [
            "dark",
            "light"
          ],
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    }
  }
}