Text line diff

text-line-diff · version 1.0.0 · Text · free, no key needed

Diff two texts as line records, preserving each line terminator.

Use when you need to: text line diff · line record text diff · diff texts by lines.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "left": "a\nb\n",
  "right": "a\nc\n",
  "context": 0
}

Response:

{
  "result": {
    "hunks": [
      {
        "old_start": 1,
        "old_count": 1,
        "new_start": 1,
        "new_count": 1,
        "ops": [
          {
            "op": "delete",
            "value": {
              "text": "b",
              "eol": "\n"
            }
          },
          {
            "op": "insert",
            "value": {
              "text": "c",
              "eol": "\n"
            }
          }
        ]
      }
    ],
    "identical": false,
    "lines_left": 2,
    "lines_right": 2
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "text-line-diff",
  "version": "1.0.0",
  "input": {
    "left": "a\nb\n",
    "right": "a\nc\n",
    "context": 0
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-line-diff/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"left":"a\nb\n","right":"a\nc\n","context":0}'

The machine-readable contract is at /v1/tools/text-line-diff/versions/1.0.0.

CLI

node cli.mjs run text-line-diff 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.