{
  "slug": "diff-viewer",
  "name": "gizza-ai/diff-viewer",
  "version": "0.1.0",
  "title": "Diff Viewer — gizza.ai",
  "description": "Render a pasted unified diff as inline text, side-by-side columns, a stat summary, or structured JSON — private and browser-only.",
  "tags": [
    "diff viewer",
    "unified diff viewer",
    "patch viewer",
    "git diff viewer",
    "side by side diff",
    "diff stats",
    "patch to json"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/diff-viewer/",
    "markdown": "https://gizza.ai/tools/diff-viewer/index.md",
    "descriptor": "https://gizza.ai/tools/diff-viewer/tool.json",
    "deep_link_example": "https://gizza.ai/tools/diff-viewer/?diff=diff%20--git%20a%2Fsrc%2Fmain.rs%20b%2Fsrc%2Fmain.rs%0A---%20a%2Fsrc%2Fmain.rs%0A%2B%2B%2B%20b%2Fsrc%2Fmain.rs%0A%40%40%20-1%2C3%20%2B1%2C4%20%40%40%0A%20fn%20main%28%29%20%7B%0A-%20%20%20%20println%21%28%22hi%22%29%3B%0A%2B%20%20%20%20println%21%28%22hello%22%29%3B%0A%2B%20%20%20%20println%21%28%22world%22%29%3B%0A%20%7D&view=inline&ignore_whitespace=true"
  },
  "cli": "gizza tool diff-viewer 'diff --git a/src/main.rs b/src/main.rs\n--- a/src/main.rs\n+++ b/src/main.rs\n@@ -1,3 +1,4 @@\n fn main() {\n-    println!(\"hi\");\n+    println!(\"hello\");\n+    println!(\"world\");\n }'",
  "tool": {
    "description": "Render a pasted unified diff as a readable view. Input is an already-computed unified diff — the output of `git diff`, `diff -u`, or a `.patch` file (this is a viewer, not a text comparator; use text-diff to compare two texts). Pass the patch in 'diff'. view='inline' (default) returns a clean unified diff with a `N files changed, A insertions(+), D deletions(-)` summary; view='side-by-side' lays old and new text in two columns; view='stats' returns a `git diff --stat`-style per-file bar graph plus totals; view='json' returns a structured report (files → hunks → lines, each with old/new line numbers). Handles multi-file patches, new/deleted/renamed/binary files, and hunk section headings; ignore_whitespace=true folds whitespace-only changes into context. Errors when the input contains no recognizable diff.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "diff": {
          "description": "The unified diff to render — paste the output of `git diff`, `diff -u`, or a `.patch` file. Handles multi-file patches, new/deleted/renamed/binary files, and hunk section headings. This is a viewer for an already-computed diff, not a comparator of two texts.",
          "type": "string"
        },
        "ignore_whitespace": {
          "default": false,
          "description": "Fold whitespace-only changes into unchanged context so they stop counting toward the add/remove totals. A deleted line paired with an added line that is identical after whitespace normalization becomes a single context line. Default false.",
          "type": "boolean"
        },
        "view": {
          "default": "inline",
          "description": "Output layout. 'inline' (default) is a clean unified diff with a change summary; 'side-by-side' lays the old and new text in two columns; 'stats' is a `git diff --stat`-style per-file bar graph with totals; 'json' is a structured report (files, hunks, per-line numbers) for programmatic use.",
          "enum": [
            "inline",
            "side-by-side",
            "stats",
            "json"
          ],
          "type": "string"
        }
      },
      "required": [
        "diff"
      ],
      "type": "object"
    }
  }
}