Skip to content

zozaai/gitex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

145 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

gitex logo

CI codecov

๐Ÿ› ๏ธ Terminal tool to prep your codebase (whole or partial) for LLMs, clean, compress, and convert it into prompt-ready text! ๐Ÿš€๐Ÿ“ฆ

gitex animated demo

Demo dependency slicing [select + "d"] >>> Picking all dependent scripts related to selected script

gitex animated demo

๐Ÿ“ฅ Installation

Install the package via pip:

pip install gitex

๐Ÿณ Docker install (no Python/pip)

If you only have Docker and want gitex as a normal command:

git clone https://github.com/zozaai/gitex
cd gitex
./scripts/install-gitex-docker.sh

๐Ÿ“‹ Clipboard support (Linux)

Ubuntu/Debian

# Wayland (recommended):
sudo apt install -y wl-clipboard

# X11 alternatives:
sudo apt install -y xclip
# or
sudo apt install -y xsel

โ–ถ๏ธ Usage

gitex helps you bundle your codebase into a single, LLM-friendly text format. It respects your .gitignore by default and provides several ways to filter content.

Basic Examples

gitex .                                 # Process current directory and copy to clipboard
gitex -i                                # Launch the interactive TUI to pick specific files/folders
gitex /path/to/repo --force             # Force process a directory even if it's not a Git repo
gitex . --no-files                      # Render the directory tree ONLY (omit file contents)

Advanced Filtering & Combinations

gitex . -a                              # Include hidden files (those starting with .)
gitex . -g                              # Ignore .gitignore rules (process everything)
gitex . -ag                             # Combine: Show hidden files AND ignore .gitignore
gitex . -iv                             # Interactive selection with verbose output to terminal
gitex . -v                              # Verbose: Print to terminal AND copy to clipboard
gitex . > codebase.txt                  # Redirect output to a text file

Intelligence Features

gitex . -ds                             # Extract only Python docstrings and signatures
gitex . --map-dependencies              # Analyze code relationships (imports, inheritance, calls)

๐Ÿ™ Acknowledgments

This project draws inspiration from repo2txt by @abinthomasonline.
Big thanks for laying the groundwork for converting repositories into prompt-ready text!


๐Ÿ“š Click to expand: Docstring Extraction Details

Python Docstring Extraction

Extract and format docstrings and function/class signatures from Python files, inspired by Sphinx. Perfect for providing high-level context to LLMs without implementation noise.

  • Extract from all Python files:
    gitex . --extract-docstrings
  • Extract from a specific class or function:
    gitex . --extract-docstrings gitex.renderer.Renderer
  • Include classes/functions even if they have no docstrings:
    gitex . --extract-docstrings --include-empty-classes
๐Ÿ”— Click to expand: Dependency & Relationship Mapping Details

Architecture Analysis

Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.

  • Full analysis: gitex . --map-dependencies
  • Focus on imports: gitex . --map-dependencies imports
  • Focus on inheritance: gitex . --map-dependencies inheritance
  • Focus on function calls: gitex . --map-dependencies calls

What it maps:

  • ๐Ÿ“ฆ Import dependencies - Which files depend on which other files.
  • ๐Ÿ—๏ธ Class inheritance hierarchies - Parent-child relationships between classes.
  • ๐Ÿ”„ Function call relationships - Which functions call which other functions.
  • ๐Ÿ“Š Summary statistics - Overview of codebase complexity and external dependencies.

About

๐Ÿ› ๏ธ Terminal tool to prep your ๐Ÿง  codebase (whole or partial) for LLMs โ€” clean, compress, and convert it into prompt-ready text! ๐Ÿš€๐Ÿ“ฆ

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

โšก