daff
Library for comparing tables and producing diffs, with CLI for CSV/TSV/SQLite and git integration
daff is a library and command-line tool for comparing tabular data and generating structured diffs. It identifies row and column changes between tables that share a common origin, producing output that can be used as patch files. The tool supports CSV, TSV, SQLite, and ndjson formats, with specialized handling for tables where row order may or may not be meaningful.
The CLI provides diff, patch, merge, and render operations with extensive formatting options. Users can control context display, specify primary keys for matching rows, ignore specific columns, and output results in various formats including HTML with visual highlighting. The daff git csv command integrates with git repositories to provide intelligent CSV diffs and merges based on table structure rather than line-by-line comparison.
As a library, daff is implemented in Haxe and translated to multiple languages including JavaScript, Python, Java, C#, C++, Ruby, and PHP. The library expects users to provide table interfaces rather than creating its own data structures, allowing integration with existing data processing workflows. The diff format follows the tabular-diff specification and can represent insertions, deletions, updates, and column changes in a standardized way that supports both visualization and programmatic processing.
Installation
# via npm
npm install daff -g
# via pip
pip install daff
# via gem
gem install daff
# via composer
composer require paulfitz/daff-php

Alternatives & related tools
dolphie
Real-time terminal interface for monitoring MySQL/MariaDB and ProxySQL database performance and analytics
qo
TUI for querying JSON and CSV files with SQL syntax, reads from stdin and outputs to stdout
alphai-tui
Terminal stock dashboard with watchlists, candlestick charts, portfolio tracking, news, and company filings.
Skate
A local personal key-value store CLI for saving and retrieving text or binary data, with named databases and pipe-friendly output.
jqp
A terminal UI for running jq queries interactively against JSON or NDJSON input, using the gojq implementation, with themes and query history.
add a badge to your README
Maintain daff? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/daff?utm_source=badge)<a href="https://www.trmn.sh/tools/daff?utm_source=badge"><img src="https://www.trmn.sh/badge/daff.svg" alt="Featured on trmn" height="20"></a>