Create two files
Save this asbefore.ts:
after.ts:
Compare them
cargo run -p differens -- before.ts after.ts.
The native CLI prints:
TAX_RATE declaration produces no output.
Terminal and Markdown reports group related edits for reading. JSON keeps the
individual actions, so its action count can be larger than the displayed summary.
Read the underlying actions
action, a description, and a filePath. The action
contains its type (Insert, Delete, Update, or Move), node metadata, and
nearest-first context. To inspect the rename without printing its full tree:
--format=llm:
Compare a repository or directories
Inside a Git repository, runningdifferens without arguments compares the
working tree against HEAD, including staged, unstaged, and untracked files.
git diff.
See the same edit in a working tree
If the original function is committed insrc/checkout.ts and you make the edit
above, run differens from the repository root. The report groups the edits
and adds a changeset summary:
differens main..feature or
differens HEAD~1 HEAD. Direct file comparisons do not need a Git repository.
Follow a move between directories
A directory comparison uses matching relative paths, then checks additions and removals for cross-file moves. For example, moving an unchangedformatPrice
between two existing files produces: