| name | file-tree-diff |
| description | Compare two directory trees and show added, removed, and changed files with color output. Use when you need to compare two versions of a directory, find what changed between releases, audit differences between staging and production file sets, or verify a deployment. Triggers include "compare directories", "directory diff", "what changed in", "file differences between", "ftd", "tree diff". |
file-tree-diff (ftd)
Compare two directory trees visually. Color-coded output. Filter, export, watch mode.
When to use
- Comparing two versions of a project directory
- Finding what changed between releases
- Auditing staging vs production differences
- Verifying a deployment copied all expected files
- Checking if two directories are identical
Quick Start
ftd v1/ v2/
ftd --content --deep src/ dist/
ftd --ignore-common --output json old/ new/ > diff.json
Usage Patterns
Basic diff
ftd left/ right/
With content line counts
ftd --content left/ right/
Shows +N -M lines for changed files.
Show diff hunks
ftd --content --deep left/ right/
Shows actual changed lines for each modified file.
Filter by status
ftd --only added left/ right/
ftd --only removed left/ right/
ftd --only changed left/ right/
Ignore patterns
ftd --ignore "*.log" --ignore "tmp/" left/ right/
ftd --ignore-common left/ right/
Export results
ftd --output json left/ right/ > diff.json
ftd --output markdown left/ right/ > diff.md
ftd --output json --output-file report.json left/ right/
Watch mode
ftd --watch left/ right/
Re-runs diff when files change. Ctrl+C to stop.
Interactive mode
ftd --interactive left/ right/
Browse with j/k, expand with Enter, quit with q.
CLI Reference
| Flag | Description |
|---|
--content, -c | Enable content (line-level) comparison |
--deep | Show diff hunks (requires --content) |
--size | Show byte sizes and deltas |
--show-unchanged | Include unchanged files in output |
--only <status> | Filter to: added, removed, changed |
--ignore <pattern> | Ignore glob pattern (repeatable) |
--ignore-common | Ignore common build/VCS artifacts |
--max-depth <n> | Limit recursion depth |
--summary | Stats only, no tree |
--output json|markdown | Export format |
--output-file <path> | Write to file |
--watch | Watch for changes |
--interactive | Browse diff interactively |
--no-color | Disable color |
Environment Variables
| Variable | Description | Default |
|---|
FTD_NO_COLOR | Disable color (0 or 1) | 0 |
FTD_MAX_DEPTH | Default max depth | unlimited |
FTD_IGNORE_COMMON | Always ignore common files (0 or 1) | 0 |
FTD_CONTENT_DIFF | Always use content diff (0 or 1) | 0 |
.ftdignore
Place a .ftdignore file in either directory. Uses gitignore syntax:
# Comments
node_modules/
*.log
dist/
!dist/MANIFEST.json # negation: keep this file
Exit Codes
| Code | Meaning |
|---|
| 0 | No differences found |
| 1 | Differences found |
| 2 | Error (bad arguments, permission denied, etc.) |