diffwatch
v1.0.8
Published
An app for watching git repository file changes.
Downloads
703
Maintainers
Readme
diffwatch
A CLI-based Node.js application that provides a real-time Terminal User Interface (TUI) for monitoring Git repository changes. Watch file statuses and view diffs in a split-pane interface without leaving your terminal.

Features
- Real-time Monitoring: Automatically refreshes every 5 seconds to show the latest Git status
- Split-pane TUI: Left pane displays files with color-coded status, right pane shows unified diffs
- Color-coded Status: Green for added, Red for deleted, Blue for modified, White for untracked
- Keyboard Navigation: Use arrow keys to navigate files, Tab to switch panes
- Git-only Operation: Works exclusively in Git repositories
- Cross-platform: Built with Node.js and TypeScript
Installation
Global Installation (Recommended)
npm install -g diffwatchLocal Installation
git clone <repository-url>
cd diffwatch
npm install
npm run build
npm linkUsage
Navigate to any Git repository and run:
diffwatch [path] [options]Arguments
path: Path to the git repository (default: current directory)
Options
-h, --help: Show help information
The application will:
- Check if the current directory is a Git repository
- Display a TUI with two panes
- Automatically refresh every 5 seconds
Controls
- Arrow Keys / Tab: Navigate through the file list and scroll in diff pane
- Enter: Open selected file in default editor
- Escape/Q/Ctrl+C: Exit the application
Prerequisites
- Node.js 16 or higher
- Git installed and accessible in PATH
- A terminal that supports TUI applications (most modern terminals)
Development
Setup
npm install
npm run build
npm run dev # Run in development mode
npm test # Run testsProject Structure
src/
├── index.ts # Main application entry point
└── utils/
└── git.ts # Git operations and status handling
tests/
├── git.test.ts # Unit tests for GitHandlerBuilding
npm run build # Compile TypeScript to JavaScriptTesting
npm test # Run Jest test suite