gitex 0.2.17__tar.gz → 0.2.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitex-0.2.19/PKG-INFO +132 -0
- gitex-0.2.19/README.md +113 -0
- gitex-0.2.19/gitex/__init__.py +1 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/picker/textuals.py +4 -4
- gitex-0.2.19/gitex.egg-info/PKG-INFO +132 -0
- {gitex-0.2.17 → gitex-0.2.19}/tests/test_cli.py +43 -3
- {gitex-0.2.17 → gitex-0.2.19}/tests/test_fences.py +2 -2
- {gitex-0.2.17 → gitex-0.2.19}/tests/test_skip_binaries.py +2 -3
- {gitex-0.2.17 → gitex-0.2.19}/tests/test_textual.py +5 -5
- gitex-0.2.17/PKG-INFO +0 -115
- gitex-0.2.17/README.md +0 -96
- gitex-0.2.17/gitex/__init__.py +0 -1
- gitex-0.2.17/gitex.egg-info/PKG-INFO +0 -115
- {gitex-0.2.17 → gitex-0.2.19}/gitex/dependency_mapper.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/docstring_extractor.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/main.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/models.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/picker/__init__.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/picker/base.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/picker/questionary.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/renderer.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex/utils.py +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex.egg-info/SOURCES.txt +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex.egg-info/dependency_links.txt +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex.egg-info/entry_points.txt +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex.egg-info/requires.txt +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/gitex.egg-info/top_level.txt +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/pyproject.toml +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/setup.cfg +0 -0
- {gitex-0.2.17 → gitex-0.2.19}/tests/test_render.py +0 -0
gitex-0.2.19/PKG-INFO
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitex
|
|
3
|
+
Version: 0.2.19
|
|
4
|
+
Summary: Terminal tool to prep codebases for LLMs
|
|
5
|
+
Author-email: zozaai <info@zozaai.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: click<8.2,>=8.0
|
|
10
|
+
Requires-Dist: textual>=5.2.0
|
|
11
|
+
Requires-Dist: questionary==2.1.0
|
|
12
|
+
Requires-Dist: pathspec<1.0,>=0.10.1
|
|
13
|
+
Requires-Dist: pydantic
|
|
14
|
+
Requires-Dist: GitPython
|
|
15
|
+
Provides-Extra: test
|
|
16
|
+
Requires-Dist: pytest>=8.0; extra == "test"
|
|
17
|
+
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
18
|
+
Requires-Dist: pytest-asyncio; extra == "test"
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://excalidraw.com/#json=FcO55BsQn51s2Pqqt5rrK,oh1x03sJwQH__qTI1Zd1tw">
|
|
22
|
+
<img src="docs/logo.jpeg" alt="gitex logo" width="20%" />
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://github.com/zozaai/gitex/actions/workflows/ci.yml">
|
|
28
|
+
<img src="https://github.com/zozaai/gitex/actions/workflows/ci.yml/badge.svg" alt="CI" />
|
|
29
|
+
</a>
|
|
30
|
+
<a href="https://codecov.io/gh/zozaai/gitex">
|
|
31
|
+
<img src="https://codecov.io/gh/zozaai/gitex/branch/main/graph/badge.svg" alt="codecov" />
|
|
32
|
+
</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
🛠️ Terminal tool to prep your codebase (whole or partial) for LLMs, clean, compress, and convert it into prompt-ready text! 🚀📦
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
<img src="docs/demo1.gif" alt="gitex animated demo" width="100%" />
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## 📥 Installation
|
|
46
|
+
|
|
47
|
+
Install the package via pip:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install gitex
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 📋 Clipboard support (Linux)
|
|
54
|
+
|
|
55
|
+
#### Ubuntu/Debian
|
|
56
|
+
```bash
|
|
57
|
+
# Wayland (recommended):
|
|
58
|
+
sudo apt install -y wl-clipboard
|
|
59
|
+
|
|
60
|
+
# X11 alternatives:
|
|
61
|
+
sudo apt install -y xclip
|
|
62
|
+
# or
|
|
63
|
+
sudo apt install -y xsel
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## ▶️ Usage
|
|
67
|
+
|
|
68
|
+
`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.
|
|
69
|
+
|
|
70
|
+
### Basic Examples
|
|
71
|
+
```bash
|
|
72
|
+
gitex . # Process current directory and copy to clipboard
|
|
73
|
+
gitex -i # Launch the interactive TUI to pick specific files/folders
|
|
74
|
+
gitex /path/to/repo --force # Force process a directory even if it's not a Git repo
|
|
75
|
+
gitex . --no-files # Render the directory tree ONLY (omit file contents)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Advanced Filtering & Combinations
|
|
79
|
+
```bash
|
|
80
|
+
gitex . -a # Include hidden files (those starting with .)
|
|
81
|
+
gitex . -g # Ignore .gitignore rules (process everything)
|
|
82
|
+
gitex . -ag # Combine: Show hidden files AND ignore .gitignore
|
|
83
|
+
gitex . -iv # Interactive selection with verbose output to terminal
|
|
84
|
+
gitex . -v # Verbose: Print to terminal AND copy to clipboard
|
|
85
|
+
gitex . > codebase.txt # Redirect output to a text file
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Intelligence Features
|
|
89
|
+
```bash
|
|
90
|
+
gitex . -ds # Extract only Python docstrings and signatures
|
|
91
|
+
gitex . --map-dependencies # Analyze code relationships (imports, inheritance, calls)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 🙏 Acknowledgments
|
|
95
|
+
This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
|
|
96
|
+
Big thanks for laying the groundwork for converting repositories into prompt-ready text!
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary><b>📚 Click to expand: Docstring Extraction Details</b></summary>
|
|
102
|
+
|
|
103
|
+
### Python Docstring Extraction
|
|
104
|
+
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.
|
|
105
|
+
|
|
106
|
+
* **Extract from all Python files:**
|
|
107
|
+
`gitex . --extract-docstrings`
|
|
108
|
+
* **Extract from a specific class or function:**
|
|
109
|
+
`gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
110
|
+
* **Include classes/functions even if they have no docstrings:**
|
|
111
|
+
`gitex . --extract-docstrings --include-empty-classes`
|
|
112
|
+
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary><b>🔗 Click to expand: Dependency & Relationship Mapping Details</b></summary>
|
|
117
|
+
|
|
118
|
+
### Architecture Analysis
|
|
119
|
+
Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
|
|
120
|
+
|
|
121
|
+
* **Full analysis:** `gitex . --map-dependencies`
|
|
122
|
+
* **Focus on imports:** `gitex . --map-dependencies imports`
|
|
123
|
+
* **Focus on inheritance:** `gitex . --map-dependencies inheritance`
|
|
124
|
+
* **Focus on function calls:** `gitex . --map-dependencies calls`
|
|
125
|
+
|
|
126
|
+
**What it maps:**
|
|
127
|
+
* 📦 **Import dependencies** - Which files depend on which other files.
|
|
128
|
+
* 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes.
|
|
129
|
+
* 🔄 **Function call relationships** - Which functions call which other functions.
|
|
130
|
+
* 📊 **Summary statistics** - Overview of codebase complexity and external dependencies.
|
|
131
|
+
|
|
132
|
+
</details>
|
gitex-0.2.19/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://excalidraw.com/#json=FcO55BsQn51s2Pqqt5rrK,oh1x03sJwQH__qTI1Zd1tw">
|
|
3
|
+
<img src="docs/logo.jpeg" alt="gitex logo" width="20%" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/zozaai/gitex/actions/workflows/ci.yml">
|
|
9
|
+
<img src="https://github.com/zozaai/gitex/actions/workflows/ci.yml/badge.svg" alt="CI" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://codecov.io/gh/zozaai/gitex">
|
|
12
|
+
<img src="https://codecov.io/gh/zozaai/gitex/branch/main/graph/badge.svg" alt="codecov" />
|
|
13
|
+
</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
🛠️ Terminal tool to prep your codebase (whole or partial) for LLMs, clean, compress, and convert it into prompt-ready text! 🚀📦
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="docs/demo1.gif" alt="gitex animated demo" width="100%" />
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 📥 Installation
|
|
27
|
+
|
|
28
|
+
Install the package via pip:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install gitex
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 📋 Clipboard support (Linux)
|
|
35
|
+
|
|
36
|
+
#### Ubuntu/Debian
|
|
37
|
+
```bash
|
|
38
|
+
# Wayland (recommended):
|
|
39
|
+
sudo apt install -y wl-clipboard
|
|
40
|
+
|
|
41
|
+
# X11 alternatives:
|
|
42
|
+
sudo apt install -y xclip
|
|
43
|
+
# or
|
|
44
|
+
sudo apt install -y xsel
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## ▶️ Usage
|
|
48
|
+
|
|
49
|
+
`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.
|
|
50
|
+
|
|
51
|
+
### Basic Examples
|
|
52
|
+
```bash
|
|
53
|
+
gitex . # Process current directory and copy to clipboard
|
|
54
|
+
gitex -i # Launch the interactive TUI to pick specific files/folders
|
|
55
|
+
gitex /path/to/repo --force # Force process a directory even if it's not a Git repo
|
|
56
|
+
gitex . --no-files # Render the directory tree ONLY (omit file contents)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Advanced Filtering & Combinations
|
|
60
|
+
```bash
|
|
61
|
+
gitex . -a # Include hidden files (those starting with .)
|
|
62
|
+
gitex . -g # Ignore .gitignore rules (process everything)
|
|
63
|
+
gitex . -ag # Combine: Show hidden files AND ignore .gitignore
|
|
64
|
+
gitex . -iv # Interactive selection with verbose output to terminal
|
|
65
|
+
gitex . -v # Verbose: Print to terminal AND copy to clipboard
|
|
66
|
+
gitex . > codebase.txt # Redirect output to a text file
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Intelligence Features
|
|
70
|
+
```bash
|
|
71
|
+
gitex . -ds # Extract only Python docstrings and signatures
|
|
72
|
+
gitex . --map-dependencies # Analyze code relationships (imports, inheritance, calls)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 🙏 Acknowledgments
|
|
76
|
+
This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
|
|
77
|
+
Big thanks for laying the groundwork for converting repositories into prompt-ready text!
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
<details>
|
|
82
|
+
<summary><b>📚 Click to expand: Docstring Extraction Details</b></summary>
|
|
83
|
+
|
|
84
|
+
### Python Docstring Extraction
|
|
85
|
+
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.
|
|
86
|
+
|
|
87
|
+
* **Extract from all Python files:**
|
|
88
|
+
`gitex . --extract-docstrings`
|
|
89
|
+
* **Extract from a specific class or function:**
|
|
90
|
+
`gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
91
|
+
* **Include classes/functions even if they have no docstrings:**
|
|
92
|
+
`gitex . --extract-docstrings --include-empty-classes`
|
|
93
|
+
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
<details>
|
|
97
|
+
<summary><b>🔗 Click to expand: Dependency & Relationship Mapping Details</b></summary>
|
|
98
|
+
|
|
99
|
+
### Architecture Analysis
|
|
100
|
+
Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
|
|
101
|
+
|
|
102
|
+
* **Full analysis:** `gitex . --map-dependencies`
|
|
103
|
+
* **Focus on imports:** `gitex . --map-dependencies imports`
|
|
104
|
+
* **Focus on inheritance:** `gitex . --map-dependencies inheritance`
|
|
105
|
+
* **Focus on function calls:** `gitex . --map-dependencies calls`
|
|
106
|
+
|
|
107
|
+
**What it maps:**
|
|
108
|
+
* 📦 **Import dependencies** - Which files depend on which other files.
|
|
109
|
+
* 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes.
|
|
110
|
+
* 🔄 **Function call relationships** - Which functions call which other functions.
|
|
111
|
+
* 📊 **Summary statistics** - Overview of codebase complexity and external dependencies.
|
|
112
|
+
|
|
113
|
+
</details>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.19"
|
|
@@ -105,7 +105,7 @@ class _PickerApp(App): # pylint: disable=too-many-public-methods
|
|
|
105
105
|
|
|
106
106
|
def _format_label(self, file_node: FileNode) -> Text:
|
|
107
107
|
"""Generate label with colored checkbox and name based on selection state."""
|
|
108
|
-
mark = "[
|
|
108
|
+
mark = "[✓]" if file_node.path in self.selected_paths else "[ ]"
|
|
109
109
|
label = f"{mark} {file_node.name}"
|
|
110
110
|
if file_node.path in self.selected_paths:
|
|
111
111
|
return Text(label, style="bold green")
|
|
@@ -134,9 +134,9 @@ class _PickerApp(App): # pylint: disable=too-many-public-methods
|
|
|
134
134
|
|
|
135
135
|
file_node: FileNode = node.data
|
|
136
136
|
|
|
137
|
-
# If the parent itself is explicitly selected, mark it Green [
|
|
137
|
+
# If the parent itself is explicitly selected, mark it Green [✓]
|
|
138
138
|
if file_node.path in self.selected_paths:
|
|
139
|
-
mark = "[
|
|
139
|
+
mark = "[✓]"
|
|
140
140
|
style = "bold green"
|
|
141
141
|
else:
|
|
142
142
|
# Check children to see if we need a partial state [-]
|
|
@@ -146,7 +146,7 @@ class _PickerApp(App): # pylint: disable=too-many-public-methods
|
|
|
146
146
|
|
|
147
147
|
if child_paths and len(selected_children) == len(child_paths):
|
|
148
148
|
# All UI children selected (and parent not in set? shouldn't happen often if logic holds)
|
|
149
|
-
mark = "[
|
|
149
|
+
mark = "[✓]"
|
|
150
150
|
style = "bold green"
|
|
151
151
|
elif selected_children:
|
|
152
152
|
# Some children selected
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitex
|
|
3
|
+
Version: 0.2.19
|
|
4
|
+
Summary: Terminal tool to prep codebases for LLMs
|
|
5
|
+
Author-email: zozaai <info@zozaai.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: click<8.2,>=8.0
|
|
10
|
+
Requires-Dist: textual>=5.2.0
|
|
11
|
+
Requires-Dist: questionary==2.1.0
|
|
12
|
+
Requires-Dist: pathspec<1.0,>=0.10.1
|
|
13
|
+
Requires-Dist: pydantic
|
|
14
|
+
Requires-Dist: GitPython
|
|
15
|
+
Provides-Extra: test
|
|
16
|
+
Requires-Dist: pytest>=8.0; extra == "test"
|
|
17
|
+
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
18
|
+
Requires-Dist: pytest-asyncio; extra == "test"
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://excalidraw.com/#json=FcO55BsQn51s2Pqqt5rrK,oh1x03sJwQH__qTI1Zd1tw">
|
|
22
|
+
<img src="docs/logo.jpeg" alt="gitex logo" width="20%" />
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://github.com/zozaai/gitex/actions/workflows/ci.yml">
|
|
28
|
+
<img src="https://github.com/zozaai/gitex/actions/workflows/ci.yml/badge.svg" alt="CI" />
|
|
29
|
+
</a>
|
|
30
|
+
<a href="https://codecov.io/gh/zozaai/gitex">
|
|
31
|
+
<img src="https://codecov.io/gh/zozaai/gitex/branch/main/graph/badge.svg" alt="codecov" />
|
|
32
|
+
</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
🛠️ Terminal tool to prep your codebase (whole or partial) for LLMs, clean, compress, and convert it into prompt-ready text! 🚀📦
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
<img src="docs/demo1.gif" alt="gitex animated demo" width="100%" />
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## 📥 Installation
|
|
46
|
+
|
|
47
|
+
Install the package via pip:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install gitex
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 📋 Clipboard support (Linux)
|
|
54
|
+
|
|
55
|
+
#### Ubuntu/Debian
|
|
56
|
+
```bash
|
|
57
|
+
# Wayland (recommended):
|
|
58
|
+
sudo apt install -y wl-clipboard
|
|
59
|
+
|
|
60
|
+
# X11 alternatives:
|
|
61
|
+
sudo apt install -y xclip
|
|
62
|
+
# or
|
|
63
|
+
sudo apt install -y xsel
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## ▶️ Usage
|
|
67
|
+
|
|
68
|
+
`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.
|
|
69
|
+
|
|
70
|
+
### Basic Examples
|
|
71
|
+
```bash
|
|
72
|
+
gitex . # Process current directory and copy to clipboard
|
|
73
|
+
gitex -i # Launch the interactive TUI to pick specific files/folders
|
|
74
|
+
gitex /path/to/repo --force # Force process a directory even if it's not a Git repo
|
|
75
|
+
gitex . --no-files # Render the directory tree ONLY (omit file contents)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Advanced Filtering & Combinations
|
|
79
|
+
```bash
|
|
80
|
+
gitex . -a # Include hidden files (those starting with .)
|
|
81
|
+
gitex . -g # Ignore .gitignore rules (process everything)
|
|
82
|
+
gitex . -ag # Combine: Show hidden files AND ignore .gitignore
|
|
83
|
+
gitex . -iv # Interactive selection with verbose output to terminal
|
|
84
|
+
gitex . -v # Verbose: Print to terminal AND copy to clipboard
|
|
85
|
+
gitex . > codebase.txt # Redirect output to a text file
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Intelligence Features
|
|
89
|
+
```bash
|
|
90
|
+
gitex . -ds # Extract only Python docstrings and signatures
|
|
91
|
+
gitex . --map-dependencies # Analyze code relationships (imports, inheritance, calls)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 🙏 Acknowledgments
|
|
95
|
+
This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
|
|
96
|
+
Big thanks for laying the groundwork for converting repositories into prompt-ready text!
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary><b>📚 Click to expand: Docstring Extraction Details</b></summary>
|
|
102
|
+
|
|
103
|
+
### Python Docstring Extraction
|
|
104
|
+
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.
|
|
105
|
+
|
|
106
|
+
* **Extract from all Python files:**
|
|
107
|
+
`gitex . --extract-docstrings`
|
|
108
|
+
* **Extract from a specific class or function:**
|
|
109
|
+
`gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
110
|
+
* **Include classes/functions even if they have no docstrings:**
|
|
111
|
+
`gitex . --extract-docstrings --include-empty-classes`
|
|
112
|
+
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary><b>🔗 Click to expand: Dependency & Relationship Mapping Details</b></summary>
|
|
117
|
+
|
|
118
|
+
### Architecture Analysis
|
|
119
|
+
Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
|
|
120
|
+
|
|
121
|
+
* **Full analysis:** `gitex . --map-dependencies`
|
|
122
|
+
* **Focus on imports:** `gitex . --map-dependencies imports`
|
|
123
|
+
* **Focus on inheritance:** `gitex . --map-dependencies inheritance`
|
|
124
|
+
* **Focus on function calls:** `gitex . --map-dependencies calls`
|
|
125
|
+
|
|
126
|
+
**What it maps:**
|
|
127
|
+
* 📦 **Import dependencies** - Which files depend on which other files.
|
|
128
|
+
* 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes.
|
|
129
|
+
* 🔄 **Function call relationships** - Which functions call which other functions.
|
|
130
|
+
* 📊 **Summary statistics** - Overview of codebase complexity and external dependencies.
|
|
131
|
+
|
|
132
|
+
</details>
|
|
@@ -2,6 +2,7 @@ import shutil
|
|
|
2
2
|
import tempfile
|
|
3
3
|
import unittest
|
|
4
4
|
from pathlib import Path
|
|
5
|
+
from unittest.mock import patch
|
|
5
6
|
|
|
6
7
|
from click.testing import CliRunner
|
|
7
8
|
from git import Repo
|
|
@@ -42,11 +43,15 @@ class TestGitExCLI(unittest.TestCase):
|
|
|
42
43
|
# Should NOT output the file content to stdout
|
|
43
44
|
self.assertNotIn("content inside non-git dir", result.stdout)
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
@patch("gitex.main.copy_to_clipboard")
|
|
47
|
+
def test_non_git_repo_force(self, mock_copy):
|
|
46
48
|
"""
|
|
47
49
|
Test that using the --force flag allows gitex to run
|
|
48
50
|
on a non-git directory.
|
|
49
51
|
"""
|
|
52
|
+
# Simulate copy failure so it prints to stdout by default fallback
|
|
53
|
+
mock_copy.return_value = False
|
|
54
|
+
|
|
50
55
|
p = Path(self.test_dir) / "forced_file.txt"
|
|
51
56
|
p.write_text("forced content", encoding="utf-8")
|
|
52
57
|
|
|
@@ -76,10 +81,14 @@ class TestGitExCLI(unittest.TestCase):
|
|
|
76
81
|
self.assertIn("Skipping", result.stderr)
|
|
77
82
|
self.assertNotIn("secret", result.stdout)
|
|
78
83
|
|
|
79
|
-
|
|
84
|
+
@patch("gitex.main.copy_to_clipboard")
|
|
85
|
+
def test_valid_git_repo(self, mock_copy):
|
|
80
86
|
"""
|
|
81
87
|
Test that gitex runs automatically on a valid git repository.
|
|
82
88
|
"""
|
|
89
|
+
# Simulate copy failure to ensure output falls back to stdout
|
|
90
|
+
mock_copy.return_value = False
|
|
91
|
+
|
|
83
92
|
Repo.init(self.test_dir)
|
|
84
93
|
|
|
85
94
|
p = Path(self.test_dir) / "repo_file.py"
|
|
@@ -89,6 +98,9 @@ class TestGitExCLI(unittest.TestCase):
|
|
|
89
98
|
|
|
90
99
|
self.assertEqual(result.exit_code, 0)
|
|
91
100
|
self.assertNotIn("Skipping", result.stderr)
|
|
101
|
+
|
|
102
|
+
# Verify fallback message
|
|
103
|
+
self.assertIn("Failed to copy", result.stderr)
|
|
92
104
|
|
|
93
105
|
self.assertIn("repo_file.py", result.stdout)
|
|
94
106
|
|
|
@@ -97,6 +109,34 @@ class TestGitExCLI(unittest.TestCase):
|
|
|
97
109
|
self.assertIn("print('hello git')", result.stdout)
|
|
98
110
|
self.assertIn("```", result.stdout)
|
|
99
111
|
|
|
112
|
+
@patch("gitex.main.copy_to_clipboard")
|
|
113
|
+
def test_clipboard_success_silent(self, mock_copy):
|
|
114
|
+
"""Test default behavior: copy succeeds, stdout is silent."""
|
|
115
|
+
mock_copy.return_value = True
|
|
116
|
+
Repo.init(self.test_dir)
|
|
117
|
+
p = Path(self.test_dir) / "file.txt"
|
|
118
|
+
p.write_text("data", encoding="utf-8")
|
|
119
|
+
|
|
120
|
+
result = self.runner.invoke(cli, [self.test_dir])
|
|
121
|
+
|
|
122
|
+
self.assertEqual(result.exit_code, 0)
|
|
123
|
+
self.assertIn("[Copied to clipboard]", result.stderr)
|
|
124
|
+
self.assertEqual("", result.stdout)
|
|
125
|
+
|
|
126
|
+
@patch("gitex.main.copy_to_clipboard")
|
|
127
|
+
def test_clipboard_success_verbose(self, mock_copy):
|
|
128
|
+
"""Test verbose behavior: copy succeeds, stdout prints content."""
|
|
129
|
+
mock_copy.return_value = True
|
|
130
|
+
Repo.init(self.test_dir)
|
|
131
|
+
p = Path(self.test_dir) / "file.txt"
|
|
132
|
+
p.write_text("data", encoding="utf-8")
|
|
133
|
+
|
|
134
|
+
result = self.runner.invoke(cli, [self.test_dir, "-v"])
|
|
135
|
+
|
|
136
|
+
self.assertEqual(result.exit_code, 0)
|
|
137
|
+
self.assertIn("[Copied to clipboard]", result.stderr)
|
|
138
|
+
self.assertIn("data", result.stdout)
|
|
139
|
+
|
|
100
140
|
def test_help_short_flag(self):
|
|
101
141
|
result = self.runner.invoke(cli, ["-h"])
|
|
102
142
|
|
|
@@ -104,4 +144,4 @@ class TestGitExCLI(unittest.TestCase):
|
|
|
104
144
|
self.assertIn("Usage:", result.output)
|
|
105
145
|
|
|
106
146
|
if __name__ == "__main__":
|
|
107
|
-
unittest.main()
|
|
147
|
+
unittest.main()
|
|
@@ -81,7 +81,7 @@ def repo_dir(tmp_path: Path):
|
|
|
81
81
|
def run_gitex(runner: CliRunner, repo_dir: Path):
|
|
82
82
|
return runner.invoke(
|
|
83
83
|
cli,
|
|
84
|
-
[str(repo_dir)],
|
|
84
|
+
[str(repo_dir), "-v"], # Added -v to force output to stdout
|
|
85
85
|
catch_exceptions=False, # IMPORTANT
|
|
86
86
|
)
|
|
87
87
|
|
|
@@ -167,4 +167,4 @@ def test_language_tags_for_known_files(runner, repo_dir):
|
|
|
167
167
|
for fname, lang in expected.items():
|
|
168
168
|
block = extract_block(result.stdout, fname)
|
|
169
169
|
first = block.splitlines()[0]
|
|
170
|
-
assert first.endswith(lang), f"{fname} expected lang '{lang}', got {first!r}"
|
|
170
|
+
assert first.endswith(lang), f"{fname} expected lang '{lang}', got {first!r}"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# tests/test_skip_binaries.py
|
|
2
1
|
import re
|
|
3
2
|
from pathlib import Path
|
|
4
3
|
|
|
@@ -35,7 +34,7 @@ def repo_dir(tmp_path: Path):
|
|
|
35
34
|
def run_gitex(runner: CliRunner, repo_dir: Path):
|
|
36
35
|
return runner.invoke(
|
|
37
36
|
cli,
|
|
38
|
-
[str(repo_dir)],
|
|
37
|
+
[str(repo_dir), "-v"], # Added -v to force output to stdout
|
|
39
38
|
catch_exceptions=False, # IMPORTANT
|
|
40
39
|
)
|
|
41
40
|
|
|
@@ -66,4 +65,4 @@ def test_text_file_is_rendered_normally(runner, repo_dir):
|
|
|
66
65
|
result = run_gitex(runner, repo_dir)
|
|
67
66
|
assert result.exit_code == 0
|
|
68
67
|
assert "# hello.txt\n" in result.stdout
|
|
69
|
-
assert "hello\n" in result.stdout
|
|
68
|
+
assert "hello\n" in result.stdout
|
|
@@ -100,7 +100,7 @@ async def test_toggle_file_selection(mock_file_tree):
|
|
|
100
100
|
|
|
101
101
|
# Toggle ON
|
|
102
102
|
await pilot.press("space")
|
|
103
|
-
assert "[
|
|
103
|
+
assert "[✓]" in str(target_node.label)
|
|
104
104
|
assert "root/root_file.txt" in app.selected_paths
|
|
105
105
|
|
|
106
106
|
# Toggle OFF
|
|
@@ -122,7 +122,7 @@ async def test_recursive_selection(mock_file_tree):
|
|
|
122
122
|
# Toggle folder ON
|
|
123
123
|
await pilot.press("space")
|
|
124
124
|
|
|
125
|
-
assert "[
|
|
125
|
+
assert "[✓]" in str(folder_ui_node.label)
|
|
126
126
|
assert "root/folder/file1.py" in app.selected_paths
|
|
127
127
|
assert "root/folder/file2.py" in app.selected_paths
|
|
128
128
|
|
|
@@ -156,8 +156,8 @@ async def test_partial_selection_visuals(mock_file_tree):
|
|
|
156
156
|
tree.select_node(file2_ui_node)
|
|
157
157
|
await pilot.press("space")
|
|
158
158
|
|
|
159
|
-
# Now parent should be fully checked [
|
|
160
|
-
assert "[
|
|
159
|
+
# Now parent should be fully checked [✓]
|
|
160
|
+
assert "[✓]" in str(folder_ui_node.label)
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
@pytest.mark.asyncio
|
|
@@ -285,7 +285,7 @@ async def test_unused_toggle_recursively_method(mock_file_tree):
|
|
|
285
285
|
assert "root/folder/file1.py" in app.selected_paths
|
|
286
286
|
|
|
287
287
|
# Check that it updated the UI label
|
|
288
|
-
assert "[
|
|
288
|
+
assert "[✓]" in str(folder_node.label)
|
|
289
289
|
|
|
290
290
|
# Toggle off
|
|
291
291
|
app._toggle_recursively(folder_node, select=False)
|
gitex-0.2.17/PKG-INFO
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gitex
|
|
3
|
-
Version: 0.2.17
|
|
4
|
-
Summary: Terminal tool to prep codebases for LLMs
|
|
5
|
-
Author-email: zozaai <info@zozaai.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Requires-Python: >=3.9
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: click<8.2,>=8.0
|
|
10
|
-
Requires-Dist: textual>=5.2.0
|
|
11
|
-
Requires-Dist: questionary==2.1.0
|
|
12
|
-
Requires-Dist: pathspec<1.0,>=0.10.1
|
|
13
|
-
Requires-Dist: pydantic
|
|
14
|
-
Requires-Dist: GitPython
|
|
15
|
-
Provides-Extra: test
|
|
16
|
-
Requires-Dist: pytest>=8.0; extra == "test"
|
|
17
|
-
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
18
|
-
Requires-Dist: pytest-asyncio; extra == "test"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<p align="center">
|
|
23
|
-
<a href="https://excalidraw.com/#json=FcO55BsQn51s2Pqqt5rrK,oh1x03sJwQH__qTI1Zd1tw">
|
|
24
|
-
<img src="docs/logo.jpeg" alt="Jet Voice Block Diagram" width="125%" />
|
|
25
|
-
</a>
|
|
26
|
-
</p>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# gitex
|
|
30
|
-
|
|
31
|
-
🛠️ Terminal tool to prep your 🧠 codebase (whole or partial) for LLMs — clean, compress, and convert it into prompt-ready text! 🚀📦
|
|
32
|
-
|
|
33
|
-
[](https://github.com/zozaai/gitex/actions/workflows/ci.yml) [](https://codecov.io/gh/zozaai/gitex)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## 📝 To-Do
|
|
38
|
-
- [x] Display GitHub repository structure
|
|
39
|
-
- [x] Select files/directories to include
|
|
40
|
-
- [ ] Filter files by extensions
|
|
41
|
-
- [x] Generate formatted text file
|
|
42
|
-
- [x] Copy text to clipboard
|
|
43
|
-
- [ ] Download generated text
|
|
44
|
-
- [x] Support for private repositories
|
|
45
|
-
- [ ] Download zip of selected files
|
|
46
|
-
- [x] Local directory support
|
|
47
|
-
- [x] make into pypi package
|
|
48
|
-
|
|
49
|
-
## ✨ Features
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### 📚 Docstring Extraction
|
|
53
|
-
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.
|
|
54
|
-
- Extract from all Python files: `gitex . --extract-docstrings`
|
|
55
|
-
- Extract from a specific class or function: `gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
56
|
-
- Control empty classes: `gitex . --extract-docstrings --include-empty-classes`
|
|
57
|
-
|
|
58
|
-
### 🔗 Dependency & Relationship Mapping
|
|
59
|
-
Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
|
|
60
|
-
- **Full analysis**: `gitex . --map-dependencies`
|
|
61
|
-
- **Focus on imports**: `gitex . --map-dependencies imports`
|
|
62
|
-
- **Focus on inheritance**: `gitex . --map-dependencies inheritance`
|
|
63
|
-
- **Focus on function calls**: `gitex . --map-dependencies calls`
|
|
64
|
-
|
|
65
|
-
**What it maps:**
|
|
66
|
-
- 📦 **Import dependencies** - Which files depend on which other files
|
|
67
|
-
- 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes
|
|
68
|
-
- 🔄 **Function call relationships** - Which functions call which other functions
|
|
69
|
-
- 📊 **Summary statistics** - Overview of codebase complexity and external dependencies
|
|
70
|
-
|
|
71
|
-
=======
|
|
72
|
-
- **Docstring Extraction**: Extract and format docstrings and function/class signatures from Python files, inspired by Sphinx. This is perfect for providing high-level context to LLMs without the noise of implementation details.
|
|
73
|
-
- Extract from all Python files: `gitex . --extract-docstrings`
|
|
74
|
-
- Extract from a specific class or function: `gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
75
|
-
- **Clipboard (Linux)**: Copy the rendered output directly to your clipboard using `--copy`.
|
|
76
|
-
Tries `wl-copy` (Wayland) → `xclip` (X11) → `xsel` (X11).
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## 📥 Installation
|
|
80
|
-
```bash
|
|
81
|
-
$ pip install gitex
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 📋 Clipboard support (Linux)
|
|
85
|
-
#### Ubuntu/Debian
|
|
86
|
-
```bash
|
|
87
|
-
# Wayland (recommended):
|
|
88
|
-
sudo apt install -y wl-clipboard
|
|
89
|
-
# X11 alternatives:
|
|
90
|
-
sudo apt install -y xclip
|
|
91
|
-
# or
|
|
92
|
-
sudo apt install -y xsel
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## ▶️ Usage
|
|
97
|
-
```
|
|
98
|
-
$ gitex --help
|
|
99
|
-
$ gitex . # current repository
|
|
100
|
-
$ gitex path/to/repo # any repo path
|
|
101
|
-
$ gitex url # repo url
|
|
102
|
-
$ gitex -i /path/to/repo > path/to/output.txt # redirect to text file
|
|
103
|
-
$ gitex -c # also copy output to clipboard (Linux)
|
|
104
|
-
$ gitex -ic # also copy output to clipboard (Linux) in interactive mode
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## 📸 Demo
|
|
109
|
-

|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
## 🙏 Acknowledgments
|
|
114
|
-
This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
|
|
115
|
-
Big thanks for laying the groundwork for converting repositories into prompt-ready text!
|
gitex-0.2.17/README.md
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<a href="https://excalidraw.com/#json=FcO55BsQn51s2Pqqt5rrK,oh1x03sJwQH__qTI1Zd1tw">
|
|
5
|
-
<img src="docs/logo.jpeg" alt="Jet Voice Block Diagram" width="125%" />
|
|
6
|
-
</a>
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# gitex
|
|
11
|
-
|
|
12
|
-
🛠️ Terminal tool to prep your 🧠 codebase (whole or partial) for LLMs — clean, compress, and convert it into prompt-ready text! 🚀📦
|
|
13
|
-
|
|
14
|
-
[](https://github.com/zozaai/gitex/actions/workflows/ci.yml) [](https://codecov.io/gh/zozaai/gitex)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## 📝 To-Do
|
|
19
|
-
- [x] Display GitHub repository structure
|
|
20
|
-
- [x] Select files/directories to include
|
|
21
|
-
- [ ] Filter files by extensions
|
|
22
|
-
- [x] Generate formatted text file
|
|
23
|
-
- [x] Copy text to clipboard
|
|
24
|
-
- [ ] Download generated text
|
|
25
|
-
- [x] Support for private repositories
|
|
26
|
-
- [ ] Download zip of selected files
|
|
27
|
-
- [x] Local directory support
|
|
28
|
-
- [x] make into pypi package
|
|
29
|
-
|
|
30
|
-
## ✨ Features
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### 📚 Docstring Extraction
|
|
34
|
-
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.
|
|
35
|
-
- Extract from all Python files: `gitex . --extract-docstrings`
|
|
36
|
-
- Extract from a specific class or function: `gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
37
|
-
- Control empty classes: `gitex . --extract-docstrings --include-empty-classes`
|
|
38
|
-
|
|
39
|
-
### 🔗 Dependency & Relationship Mapping
|
|
40
|
-
Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
|
|
41
|
-
- **Full analysis**: `gitex . --map-dependencies`
|
|
42
|
-
- **Focus on imports**: `gitex . --map-dependencies imports`
|
|
43
|
-
- **Focus on inheritance**: `gitex . --map-dependencies inheritance`
|
|
44
|
-
- **Focus on function calls**: `gitex . --map-dependencies calls`
|
|
45
|
-
|
|
46
|
-
**What it maps:**
|
|
47
|
-
- 📦 **Import dependencies** - Which files depend on which other files
|
|
48
|
-
- 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes
|
|
49
|
-
- 🔄 **Function call relationships** - Which functions call which other functions
|
|
50
|
-
- 📊 **Summary statistics** - Overview of codebase complexity and external dependencies
|
|
51
|
-
|
|
52
|
-
=======
|
|
53
|
-
- **Docstring Extraction**: Extract and format docstrings and function/class signatures from Python files, inspired by Sphinx. This is perfect for providing high-level context to LLMs without the noise of implementation details.
|
|
54
|
-
- Extract from all Python files: `gitex . --extract-docstrings`
|
|
55
|
-
- Extract from a specific class or function: `gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
56
|
-
- **Clipboard (Linux)**: Copy the rendered output directly to your clipboard using `--copy`.
|
|
57
|
-
Tries `wl-copy` (Wayland) → `xclip` (X11) → `xsel` (X11).
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## 📥 Installation
|
|
61
|
-
```bash
|
|
62
|
-
$ pip install gitex
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## 📋 Clipboard support (Linux)
|
|
66
|
-
#### Ubuntu/Debian
|
|
67
|
-
```bash
|
|
68
|
-
# Wayland (recommended):
|
|
69
|
-
sudo apt install -y wl-clipboard
|
|
70
|
-
# X11 alternatives:
|
|
71
|
-
sudo apt install -y xclip
|
|
72
|
-
# or
|
|
73
|
-
sudo apt install -y xsel
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
## ▶️ Usage
|
|
78
|
-
```
|
|
79
|
-
$ gitex --help
|
|
80
|
-
$ gitex . # current repository
|
|
81
|
-
$ gitex path/to/repo # any repo path
|
|
82
|
-
$ gitex url # repo url
|
|
83
|
-
$ gitex -i /path/to/repo > path/to/output.txt # redirect to text file
|
|
84
|
-
$ gitex -c # also copy output to clipboard (Linux)
|
|
85
|
-
$ gitex -ic # also copy output to clipboard (Linux) in interactive mode
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
## 📸 Demo
|
|
90
|
-

|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
## 🙏 Acknowledgments
|
|
95
|
-
This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
|
|
96
|
-
Big thanks for laying the groundwork for converting repositories into prompt-ready text!
|
gitex-0.2.17/gitex/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.17"
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gitex
|
|
3
|
-
Version: 0.2.17
|
|
4
|
-
Summary: Terminal tool to prep codebases for LLMs
|
|
5
|
-
Author-email: zozaai <info@zozaai.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Requires-Python: >=3.9
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: click<8.2,>=8.0
|
|
10
|
-
Requires-Dist: textual>=5.2.0
|
|
11
|
-
Requires-Dist: questionary==2.1.0
|
|
12
|
-
Requires-Dist: pathspec<1.0,>=0.10.1
|
|
13
|
-
Requires-Dist: pydantic
|
|
14
|
-
Requires-Dist: GitPython
|
|
15
|
-
Provides-Extra: test
|
|
16
|
-
Requires-Dist: pytest>=8.0; extra == "test"
|
|
17
|
-
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
18
|
-
Requires-Dist: pytest-asyncio; extra == "test"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<p align="center">
|
|
23
|
-
<a href="https://excalidraw.com/#json=FcO55BsQn51s2Pqqt5rrK,oh1x03sJwQH__qTI1Zd1tw">
|
|
24
|
-
<img src="docs/logo.jpeg" alt="Jet Voice Block Diagram" width="125%" />
|
|
25
|
-
</a>
|
|
26
|
-
</p>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# gitex
|
|
30
|
-
|
|
31
|
-
🛠️ Terminal tool to prep your 🧠 codebase (whole or partial) for LLMs — clean, compress, and convert it into prompt-ready text! 🚀📦
|
|
32
|
-
|
|
33
|
-
[](https://github.com/zozaai/gitex/actions/workflows/ci.yml) [](https://codecov.io/gh/zozaai/gitex)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## 📝 To-Do
|
|
38
|
-
- [x] Display GitHub repository structure
|
|
39
|
-
- [x] Select files/directories to include
|
|
40
|
-
- [ ] Filter files by extensions
|
|
41
|
-
- [x] Generate formatted text file
|
|
42
|
-
- [x] Copy text to clipboard
|
|
43
|
-
- [ ] Download generated text
|
|
44
|
-
- [x] Support for private repositories
|
|
45
|
-
- [ ] Download zip of selected files
|
|
46
|
-
- [x] Local directory support
|
|
47
|
-
- [x] make into pypi package
|
|
48
|
-
|
|
49
|
-
## ✨ Features
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### 📚 Docstring Extraction
|
|
53
|
-
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.
|
|
54
|
-
- Extract from all Python files: `gitex . --extract-docstrings`
|
|
55
|
-
- Extract from a specific class or function: `gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
56
|
-
- Control empty classes: `gitex . --extract-docstrings --include-empty-classes`
|
|
57
|
-
|
|
58
|
-
### 🔗 Dependency & Relationship Mapping
|
|
59
|
-
Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
|
|
60
|
-
- **Full analysis**: `gitex . --map-dependencies`
|
|
61
|
-
- **Focus on imports**: `gitex . --map-dependencies imports`
|
|
62
|
-
- **Focus on inheritance**: `gitex . --map-dependencies inheritance`
|
|
63
|
-
- **Focus on function calls**: `gitex . --map-dependencies calls`
|
|
64
|
-
|
|
65
|
-
**What it maps:**
|
|
66
|
-
- 📦 **Import dependencies** - Which files depend on which other files
|
|
67
|
-
- 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes
|
|
68
|
-
- 🔄 **Function call relationships** - Which functions call which other functions
|
|
69
|
-
- 📊 **Summary statistics** - Overview of codebase complexity and external dependencies
|
|
70
|
-
|
|
71
|
-
=======
|
|
72
|
-
- **Docstring Extraction**: Extract and format docstrings and function/class signatures from Python files, inspired by Sphinx. This is perfect for providing high-level context to LLMs without the noise of implementation details.
|
|
73
|
-
- Extract from all Python files: `gitex . --extract-docstrings`
|
|
74
|
-
- Extract from a specific class or function: `gitex . --extract-docstrings gitex.renderer.Renderer`
|
|
75
|
-
- **Clipboard (Linux)**: Copy the rendered output directly to your clipboard using `--copy`.
|
|
76
|
-
Tries `wl-copy` (Wayland) → `xclip` (X11) → `xsel` (X11).
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## 📥 Installation
|
|
80
|
-
```bash
|
|
81
|
-
$ pip install gitex
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 📋 Clipboard support (Linux)
|
|
85
|
-
#### Ubuntu/Debian
|
|
86
|
-
```bash
|
|
87
|
-
# Wayland (recommended):
|
|
88
|
-
sudo apt install -y wl-clipboard
|
|
89
|
-
# X11 alternatives:
|
|
90
|
-
sudo apt install -y xclip
|
|
91
|
-
# or
|
|
92
|
-
sudo apt install -y xsel
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## ▶️ Usage
|
|
97
|
-
```
|
|
98
|
-
$ gitex --help
|
|
99
|
-
$ gitex . # current repository
|
|
100
|
-
$ gitex path/to/repo # any repo path
|
|
101
|
-
$ gitex url # repo url
|
|
102
|
-
$ gitex -i /path/to/repo > path/to/output.txt # redirect to text file
|
|
103
|
-
$ gitex -c # also copy output to clipboard (Linux)
|
|
104
|
-
$ gitex -ic # also copy output to clipboard (Linux) in interactive mode
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## 📸 Demo
|
|
109
|
-

|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
## 🙏 Acknowledgments
|
|
114
|
-
This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
|
|
115
|
-
Big thanks for laying the groundwork for converting repositories into prompt-ready text!
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|