| Crates.io | diffdirs |
| lib.rs | diffdirs |
| version | 0.2.6 |
| created_at | 2025-10-23 04:56:07.973541+00 |
| updated_at | 2025-11-05 17:57:48.73008+00 |
| description | Compare two directories and show differences in files or subdirectories with colorized output, depth limiting, and JSON support. |
| homepage | |
| repository | https://github.com/fibnas/diffdirs |
| max_upload_size | |
| id | 1896622 |
| size | 39,107 |
A fast, minimal Rust CLI tool for comparing the contents of two directories. Displays which files or directories exist only in one location or the other, with optional color output, depth limiting, and JSON support.
--dirs)--depth--json)Build and install from source:
cargo install --path .
or clone and run locally:
git clone https://github.com/fibnas/diffdirs.git
cd diffdirs
cargo build --release
The binary will be available at target/release/diffdirs.
diffdirs [OPTIONS] <DIR_A> <DIR_B>
| Argument | Description |
|---|---|
<DIR_A> |
First directory to compare |
<DIR_B> |
Second directory to compare |
| Option | Description |
|---|---|
--dirs |
Compare only directories (not files) |
--depth <DEPTH> |
Maximum depth to traverse (0 = only root) |
--json |
Output results in JSON format |
-h, --help |
Show help information |
Compare two directories (default: files only):
diffdirs ~/test-a ~/test-b
Compare directories only:
diffdirs ~/test-a ~/test-b --dirs
Limit depth to 1:
diffdirs ~/test-a ~/test-b --depth 1
Output as JSON:
diffdirs ~/test-a ~/test-b --dirs --json
Example JSON output:
{
"only_in_a": [
"echo",
"foxtrot"
],
"only_in_b": [
"bravo",
"alpha",
"charlie",
"delta"
],
"summary": {
"unique_in_a": 2,
"unique_in_b": 4
}
}
Files that appear only in /home/fn/test-a: (6)
file1
file2
echo/info.txt
todo.txt
notes.txt
file3
Files that appear only in /home/fn/test-b: (4)
cheatsheet.txt
file5
delta/secret.txt
file4
Summary: 6 unique in /home/fn/test-a, 4 unique in /home/fn/test-b
Inspired by earlier directory diff tools such as diffdir, with a focus on modern CLI ergonomics and flexible output formats.
diff and tree utilitiesMIT License See LICENSE for details.