tui app export git diff as file for web chat LLM context by vibe coding
npm install git-diff-tuiThis app and this README file are generated by an LLM. I take no responsibility for them.
I wonβt update this rubbish vibe-coding repo unless I want to add function to it, so thereβs no need to leave feedback. Please fork it and edit it yourself.
.h/.hpp + .cpp/.cc)
Install globally
npm install -g git-diff-tui
Use any of these commands
git-diff-tui
gdt
gd
`
π Usage
`
Run in any Git repository
cd your-project
gdt
`
β¨οΈ Keybindings
$3
| Key | Action |
|-----|--------|
| β / k | Move up |
| β / j | Move down |
| PageUp | Jump up 10 items |
| PageDown | Jump down 10 items |
| Home | Jump to first item |
| End | Jump to last item |
$3
| Key | Action |
|-----|--------|
| / | Toggle flat/tree view mode |
| Tab | Switch focus (file list β diff view) |
$3
| Key | Action |
|-----|--------|
| Space | Select/deselect current file |
| a | Select/deselect all files |
$3
| Key | Action | Description |
|-----|--------|-------------|
| e | Export single diff | Export current file's diff to ./diff.txt |
| E | Export multiple diffs | Export selected files' diffs (prompts for path) |
| f | Quick file overview | Export file structure to current directory |
| F | File overview (custom path) | Export file overview with path input |
| D | Code dump | Export entire codebase with merge (press Tab to switch flat/tree mode) |
$3
| Key | Action |
|-----|--------|
| r | Refresh file list |
| q / Esc | Quit |
π Export Formats
$3
`
./diff_20251228_213045.txt
`
$3
`
./files_overview_20251228_213045.txt
[.]
- CMakeLists.txt (1.22 KB)
- README.md (2.45 KB)
[src]
- main.cpp (1.84 KB)
- utils.cpp (3.47 KB)
[src/components]
- button.cpp (1.55 KB)
- button.h (890 B)
`
$3
Tree Mode (default):
`
./code_dump_20251228_213045/
βββ app/
β βββ Game/
β βββ scene_merged.cpp
β βββ game_object_merged.cpp
βββ src/
β βββ utils.js
βββ dump_summary.txt
`
Flat Mode (press Tab to switch):
`
./code_dump_20251228_213045/
βββ app_Game_scene_merged.cpp
βββ app_Game_game_object_merged.cpp
βββ src_utils.js
βββ dump_summary.txt
`
π¨ Path Input Features
When prompted for export path:
- Enter: Confirm and export
- Esc: Cancel
- Ctrl+V: Paste from clipboard
- Ctrl+U: Clear input
- Arrow Keys: Move cursor
- Home/End: Jump to start/end
$3
- Empty input β Auto-generate timestamped filename in current directory
- Directory path β Auto-generate timestamped filename in that directory
- Full file path β Use as-is
π‘ Use Cases
$3
`
Export relevant diffs for LLM context
gdt
Select files with Space, press E, paste to ChatGPT/Claude
Export entire codebase structure
gdt
Press f, share files_overview.txt with AI for architecture discussion
Export full code for analysis
gdt
Press D, select tree mode, share code_dump/ folder with AI
`
$3
`
Export changes for review
gdt
Select modified files, press E, share diff file
`
$3
`
Generate project file structure
gdt
Press f to create overview
`
π§ Advanced Features
$3
The tool automatically detects and merges C++ file pairs:
- Headers: .h, .hpp, .hxx, .hh
- Sources: .cpp, .cxx, .cc, .c
Example output:
`
// ============================================================================
// ε佡ζͺζ‘: scene
// εε§θ·―εΎ: app/Game
// Header: scene.h
// Source: scene.cpp
// ============================================================================
// -------------------- Header File: scene.h --------------------
#pragma once
// ... header content ...
// -------------------- Source File: scene.cpp --------------------
#include "scene.h"
// ... source content ...
`
$3
- β
All Git-tracked files
- β
Untracked files (not in .gitignore)
- β Files in .gitignore
- β Binary files (automatically handled by Git)
π οΈ Development
`
Clone repository
git clone https://github.com/koolerkx/git-diff-tui.git
cd git-diff-tui
Install dependencies
npm install
Build
npm run build
Link for local testing
npm link
Test
gdt
``