---
title: "diff"
description: "See which segments a source added, removed or modified since the last extraction."
canonical_url: "https://diglot.sh/workflow/cli/diff"
---
# diff

> See which segments a source added, removed or modified since the last extraction.

`diglot diff` extracts each source again and compares the result with its stored manifest, file by file. It shows what a translation run would have to deal with and doesn't write anything.

```bash
pnpm dlx @diglot/cli diff [--source name] [--json]
```

## Options

<table>
<thead>
  <tr>
    <th>
      Option
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --source
      </code>
    </td>
    
    <td>
      all sources
    </td>
    
    <td>
      Compare only this source
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --json
      </code>
    </td>
    
    <td>
      off
    </td>
    
    <td>
      Print the full report as JSON
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --cwd
      </code>
    </td>
    
    <td>
      <code>
        .
      </code>
    </td>
    
    <td>
      The translations repository root
    </td>
  </tr>
</tbody>
</table>

## Reading the output

Each source starts with a summary line, followed by the files that changed. A file marked `+` is new, `-` is gone and `~` has changed segments. The counts in parentheses are added, removed and modified segments.

```text
<source>: 2 files changed, 3 added, 1 removed, 4 modified
  ~ docs/guide/intro.md (+1 -0 ~2)
      ~ Nuxt is powered by {0}Nitro{/0}… (0.84, 1/2 sentences changed)
      + A new paragraph…
```

The numbers above are placeholders to show the format. For a modified segment, the line shows the new skeleton (cut at 100 characters), the similarity to its predecessor, and how many of its sentences are not in the predecessor. The word `ambiguous` appears when another pairing scored almost as well, which is the cue to check that the pairing is right. See [keeping in sync](https://diglot.sh/guide/concepts/keeping-in-sync) for how pairing works.

A source without a manifest reports every file as added, so run `extract` once first.

## JSON

With `--json`, the report is keyed by source name. Each entry has the new and previous commit (`sha`, `previous`) when known, and `files`, a list of `{ file, status, diff }` where `diff` has `unchanged`, `added`, `removed` and `modified` segments.


## Sitemap

See the full [sitemap](https://diglot.sh/sitemap.md) for all pages.
