How ilyasturki/dircmp works
dircmp is a terminal directory and file comparison tool with an interactive TUI plus scriptable diff and check commands. The main workflow resolves local or rclone-backed paths, scans both sides, compares entries, and presents a navigable side-by-side tree; users can open file diffs or resolve differences with copy, delete, and undo/redo actions. Additional branches cover ignore rules, preferences and keybindings, remote access, and CLI output. Relationships reflect the excerpts, SOURCE INDEX references, and README; unsampled implementations are represented only where documented.
Main entry points: main.tsx CLI dispatcher · app.tsx TUI application · ignore.ts Ignore rules · hooks.ts Directory scan hook
Components 34
Entry points
- CLI dispatcher
src/main.tsx - TUI application
src/app.tsx
Scan and compare
- Directory scan hook
src/hooks.ts - Filesystem scanner
src/utils/scanner.ts - Remote mounts
src/utils/rclone.ts - Ignore rules
src/utils/ignore.ts - Entry comparison
src/utils/compare.ts
Interactive TUI
- Application state
src/reducer.ts - Directory panels
src/components/panels/directory-panel.tsx - Entry rows
src/components/panels/entry-row.tsx - Directory diff view
src/components/panels/directory-diff.tsx - File diff viewer
src/components/file-diff.tsx - Diff worker client
src/components/file-diff/diff-client.ts - Diff worker
src/components/file-diff/diff-worker.ts - Diff computation
src/components/file-diff/diff-compute.ts - Keymap
src/keymap.ts - Navigation hooks
src/hooks.ts - Keyboard hints
src/components/keyboard-hints.tsx - Theme and ANSI
src/utils/theme.ts
Resolution and settings
- Action executor
src/execute-action.ts - Undo history
src/utils/undo.ts - Preferences
src/utils/config.ts - Keybinding settings
src/utils/keybindings.ts - Config paths
src/utils/paths.ts - Ignore editor
src/components/dialogs/ignore-dialog.tsx - Preferences editor
src/components/dialogs/preferences-dialog.tsx - Dialog primitives
src/components/dialog.tsx - Text input
src/components/text-input.tsx
Scriptable CLI
- CLI scan adapter
src/cli/scan.ts - Directory diff output
src/cli/directory-diff.ts - Directory check
src/cli/directory-check.ts - File diff command
src/cli/file-diff.ts - File check command
src/cli/file-check.ts
Other components
- User or script
Connections 43
- User or script → CLI dispatcher: invokes
- CLI dispatcher → TUI application: launches TUI
src/main.tsx - CLI dispatcher → Remote mounts: resolves remotes
src/main.tsx - CLI dispatcher → Ignore rules: loads rules
src/main.tsx - CLI dispatcher → Directory diff output: routes diff
src/main.tsx - CLI dispatcher → Directory check: routes check
src/main.tsx - CLI dispatcher → File diff command: routes file diff
src/main.tsx - CLI dispatcher → File check command: routes file check
src/main.tsx - TUI application → Directory scan hook: requests scans
src/app.tsx - TUI application → Application state: dispatches actions
src/app.tsx - TUI application → Action executor: runs actions
src/app.tsx - TUI application → Directory diff view: renders view
src/app.tsx - Directory scan hook → Filesystem scanner: scans directories
src/hooks.ts - Directory scan hook → Remote mounts: handles remotes
src/hooks.ts - Directory scan hook → Ignore rules: filters scans
src/hooks.ts - Filesystem scanner → User or script: reads filesystem
- Application state → Entry comparison: compares entries
src/reducer.ts - Directory diff view → Directory panels: renders panels
- Directory panels → Entry rows: renders rows
- Directory diff view → File diff viewer: opens file diff
src/app.tsx - File diff viewer → Diff worker client: requests diff
- Diff worker client → Diff worker: posts requests
src/components/file-diff/diff-client.ts - Diff worker → Diff computation: computes rows
src/components/file-diff/diff-worker.ts - TUI application → Keymap: uses shortcuts
src/app.tsx - TUI application → Navigation hooks: uses navigation
src/app.tsx - Keymap → Keyboard hints: defines hints
src/keymap.ts - Action executor → Undo history: records undo
- Action executor → Ignore rules: updates rules
- Preferences editor → Preferences: saves preferences
src/components/dialogs/preferences-dialog.tsx - Ignore editor → Ignore rules: edits patterns
src/components/dialogs/ignore-dialog.tsx - Preferences editor → Dialog primitives: uses dialog
src/components/dialogs/preferences-dialog.tsx - Preferences editor → Text input: uses inputs
src/components/dialogs/preferences-dialog.tsx - Ignore editor → Dialog primitives: uses dialog
src/components/dialogs/ignore-dialog.tsx - Preferences → Config paths: gets config path
src/utils/config.ts - Keybinding settings → Config paths: gets config path
src/utils/keybindings.ts - Directory diff output → CLI scan adapter: scans inputs
src/cli/directory-diff.ts - Directory diff output → Entry comparison: compares entries
src/cli/directory-diff.ts - Directory check → CLI scan adapter: scans inputs
src/cli/directory-check.ts - Directory check → Entry comparison: compares entries
src/cli/directory-check.ts - CLI scan adapter → Filesystem scanner: scans trees
src/cli/scan.ts - CLI scan adapter → Ignore rules: applies rules
src/cli/scan.ts - File diff command → User or script: prints diff
- File check command → User or script: returns status