npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-diff-tui

v1.1.0

Published

tui app export git diff as file for web chat LLM context by vibe coding

Downloads

296

Readme

This 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.

git-diff-tui

A terminal user interface (TUI) tool that helps you manage Git changes and export them in various formats - perfect for sharing code context with LLMs like ChatGPT, Claude, or Gemini.

✨ Features

📋 Interactive Git Management

  • Browse staged and unstaged files in a clean TUI
  • Switch between flat and tree view modes
  • Real-time diff preview with syntax highlighting
  • Select multiple files for batch operations

📤 Export Capabilities

  • Single/Multiple File Diffs - Export selected files' diffs to a single file
  • File Overview - Generate a complete file structure with sizes (all Git-managed + untracked files)
  • Code Dump - Export entire codebase with C++ header/source merging
    • Flat mode: All files in one directory with path-encoded filenames
    • Tree mode: Preserve original directory structure
    • Auto-merge C++ pairs (.h/.hpp + .cpp/.cc)
    • Include all other files (JS, TS, HLSL, etc.)

🎯 Perfect For

  • Sharing code context with AI coding assistants
  • Code reviews and documentation
  • Creating portable code snapshots
  • Analyzing project structure
  • Vibe coding with LLMs

📦 Installation

# 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

Navigation

| 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 |

View Control

| Key | Action | |-----|--------| | / | Toggle flat/tree view mode | | Tab | Switch focus (file list ↔ diff view) |

File Selection

| Key | Action | |-----|--------| | Space | Select/deselect current file | | a | Select/deselect all files |

Export Operations

| 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) |

Other

| Key | Action | |-----|--------| | r | Refresh file list | | q / Esc | Quit |

📁 Export Formats

Diff Export (E)

./diff_20251228_213045.txt

File Overview (f / F)

./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)

Code Dump (D)

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

Path Handling

  • 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

For AI Coding Assistants

# 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

For Code Reviews

# Export changes for review
gdt
# Select modified files, press E, share diff file

For Documentation

# Generate project file structure
gdt
# Press f to create overview

🔧 Advanced Features

C++ Header/Source Merging

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 ...

File Inclusion Rules

  • ✅ 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

📝 License

Unlicense - Public Domain

This is free and unencumbered software released into the public domain. Anyone is free to use, modify, and distribute this software for any purpose, without any restrictions or attribution requirements.