diffdirs-0.2.3 is not a library.
diffdirs
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.
Features
- Compare two directories for unique paths
- Show only files (default) or only directories (
--dirs) - Limit recursion depth with
--depth - Output results as JSON (
--json) - Colorized terminal output for readability
Installation
Build and install from source:
or clone and run locally:
The binary will be available at target/release/diffdirs.
Usage
Arguments
| Argument | Description |
|---|---|
<DIR_A> |
First directory to compare |
<DIR_B> |
Second directory to compare |
Options
| 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 |
Examples
Compare two directories (default: files only):
Compare directories only:
Limit depth to 1:
Output as JSON:
Example JSON output:
Example Output (default mode)
Acknowledgements
Inspired by earlier directory diff tools such as diffdir, with a focus on modern CLI ergonomics and flexible output formats.
- walkdir for fast recursive directory traversal
- clap for ergonomic CLI argument parsing
- yansi for lightweight colorized output
- serde_json for clean JSON serialization
- Inspiration from classic UNIX
diffandtreeutilities
License
MIT License See LICENSE for details.