gitex 0.2.18__py3-none-any.whl → 0.3.0__py3-none-any.whl

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/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.2.18"
1
+ __version__ = "0.3.0"
gitex/picker/textuals.py CHANGED
@@ -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 = "[x]" if file_node.path in self.selected_paths else "[ ]"
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 [x]
137
+ # If the parent itself is explicitly selected, mark it Green []
138
138
  if file_node.path in self.selected_paths:
139
- mark = "[x]"
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 = "[x]"
149
+ mark = "[]"
150
150
  style = "bold green"
151
151
  elif selected_children:
152
152
  # Some children selected
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitex
3
+ Version: 0.3.0
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
+ ## 🐳 Docker install (no Python/pip)
54
+
55
+ If you only have Docker and want `gitex` as a normal command:
56
+
57
+ ```bash
58
+ git clone https://github.com/zozaai/gitex
59
+ cd gitex
60
+ ./scripts/install-gitex-docker.sh
61
+ ```
62
+
63
+
64
+ ## 📋 Clipboard support (Linux)
65
+
66
+ #### Ubuntu/Debian
67
+ ```bash
68
+ # Wayland (recommended):
69
+ sudo apt install -y wl-clipboard
70
+
71
+ # X11 alternatives:
72
+ sudo apt install -y xclip
73
+ # or
74
+ sudo apt install -y xsel
75
+ ```
76
+
77
+ ## ▶️ Usage
78
+
79
+ `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.
80
+
81
+ ### Basic Examples
82
+ ```bash
83
+ gitex . # Process current directory and copy to clipboard
84
+ gitex -i # Launch the interactive TUI to pick specific files/folders
85
+ gitex /path/to/repo --force # Force process a directory even if it's not a Git repo
86
+ gitex . --no-files # Render the directory tree ONLY (omit file contents)
87
+ ```
88
+
89
+ ### Advanced Filtering & Combinations
90
+ ```bash
91
+ gitex . -a # Include hidden files (those starting with .)
92
+ gitex . -g # Ignore .gitignore rules (process everything)
93
+ gitex . -ag # Combine: Show hidden files AND ignore .gitignore
94
+ gitex . -iv # Interactive selection with verbose output to terminal
95
+ gitex . -v # Verbose: Print to terminal AND copy to clipboard
96
+ gitex . > codebase.txt # Redirect output to a text file
97
+ ```
98
+
99
+ ### Intelligence Features
100
+ ```bash
101
+ gitex . -ds # Extract only Python docstrings and signatures
102
+ gitex . --map-dependencies # Analyze code relationships (imports, inheritance, calls)
103
+ ```
104
+
105
+ ## 🙏 Acknowledgments
106
+ This project draws inspiration from [repo2txt](https://github.com/abinthomasonline/repo2txt) by [@abinthomasonline](https://github.com/abinthomasonline).
107
+ Big thanks for laying the groundwork for converting repositories into prompt-ready text!
108
+
109
+ ---
110
+
111
+ <details>
112
+ <summary><b>📚 Click to expand: Docstring Extraction Details</b></summary>
113
+
114
+ ### Python Docstring Extraction
115
+ 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.
116
+
117
+ * **Extract from all Python files:**
118
+ `gitex . --extract-docstrings`
119
+ * **Extract from a specific class or function:**
120
+ `gitex . --extract-docstrings gitex.renderer.Renderer`
121
+ * **Include classes/functions even if they have no docstrings:**
122
+ `gitex . --extract-docstrings --include-empty-classes`
123
+
124
+ </details>
125
+
126
+ <details>
127
+ <summary><b>🔗 Click to expand: Dependency & Relationship Mapping Details</b></summary>
128
+
129
+ ### Architecture Analysis
130
+ Analyze and visualize code architecture, dependencies, and relationships in your codebase. Essential for understanding how components interact before diving into implementation details.
131
+
132
+ * **Full analysis:** `gitex . --map-dependencies`
133
+ * **Focus on imports:** `gitex . --map-dependencies imports`
134
+ * **Focus on inheritance:** `gitex . --map-dependencies inheritance`
135
+ * **Focus on function calls:** `gitex . --map-dependencies calls`
136
+
137
+ **What it maps:**
138
+ * 📦 **Import dependencies** - Which files depend on which other files.
139
+ * 🏗️ **Class inheritance hierarchies** - Parent-child relationships between classes.
140
+ * 🔄 **Function call relationships** - Which functions call which other functions.
141
+ * 📊 **Summary statistics** - Overview of codebase complexity and external dependencies.
142
+
143
+ </details>
@@ -1,4 +1,4 @@
1
- gitex/__init__.py,sha256=3RGPra41WobAbWeoPRqR_JXeysqFvK3H3AP1g9gjj3g,23
1
+ gitex/__init__.py,sha256=VrXpHDu3erkzwl_WXrqINBm9xWkcyUy53IQOj042dOs,22
2
2
  gitex/dependency_mapper.py,sha256=alQ_3Bua-VCI-CtwMZH9vJYrLjlLFrYxbuYrydGFiMI,18236
3
3
  gitex/docstring_extractor.py,sha256=glqS3aihTP_FWBS76uB9TAojkH-8Qv9Rgflp75mWzXs,5037
4
4
  gitex/main.py,sha256=dvPKfUvQ7rqta9-UDZw265aRzKOhrT4hdIVFmo-aLkQ,6576
@@ -8,14 +8,14 @@ gitex/utils.py,sha256=ivweFCUly8QEqNWV3NtF2fCTEaz3ukjYYt40ROKxkvE,2181
8
8
  gitex/picker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  gitex/picker/base.py,sha256=g3XOQBcy7o28ItwThxmqi7Hf_ZIK5KYKTUuFCumb3nA,3240
10
10
  gitex/picker/questionary.py,sha256=eMwn5eHbephpjKP-cGUBSKZNaHaklqbsZFHuWevTYU4,2208
11
- gitex/picker/textuals.py,sha256=mXiU4jLd-hCTkdH9Bk3O27UAi3_Mj-9GvdbgUEgZxTA,10393
11
+ gitex/picker/textuals.py,sha256=UzDXIyqmlYBl1LWavvo_A6mZDBph8d6P-Dn0-MKzWKE,10401
12
12
  tests/test_cli.py,sha256=T3V6TffCkSQAHlt7m4MYL-V-ADsIe89E2XCR3AktoVs,4987
13
13
  tests/test_fences.py,sha256=00tzli0cG8yNxzAUobOj797SBJtTVAwVpbL7b5_nRIM,4313
14
14
  tests/test_render.py,sha256=DaRMPRDfqSteVO4Z6BIkF777V1cpXwnaGYSqbBUU3mk,7223
15
15
  tests/test_skip_binaries.py,sha256=r9izOgpb284y8bN7p_M9-5VixokW0WFA2npmAmxdMLk,1905
16
- tests/test_textual.py,sha256=V7zG1hhpAaxEFFWaGCaY2PFDBjfogCnjRD1wGUTXKEU,9887
17
- gitex-0.2.18.dist-info/METADATA,sha256=hOQIpFjygOyL-E_UZ7ht0x0GQGqGs8MwKC1W2hWF7f4,4335
18
- gitex-0.2.18.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
19
- gitex-0.2.18.dist-info/entry_points.txt,sha256=YVGHi9Ock94uICcjGxm_eHtwBv3_RCiwpBKwIkMJhGI,41
20
- gitex-0.2.18.dist-info/top_level.txt,sha256=N-r2BJX8y5Wlkh3VtRSBC8jagKMDxFDP9iOwpN1H2do,12
21
- gitex-0.2.18.dist-info/RECORD,,
16
+ tests/test_textual.py,sha256=EPH5hOaAM7N4eJN6aTz5rqFvRoDd0OyjIrhfoMNzaFY,9897
17
+ gitex-0.3.0.dist-info/METADATA,sha256=KakrgE3gUDghEmJXXZoWDDDJ2yR8Ow5rNS2JN_bSjIQ,5083
18
+ gitex-0.3.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
19
+ gitex-0.3.0.dist-info/entry_points.txt,sha256=YVGHi9Ock94uICcjGxm_eHtwBv3_RCiwpBKwIkMJhGI,41
20
+ gitex-0.3.0.dist-info/top_level.txt,sha256=N-r2BJX8y5Wlkh3VtRSBC8jagKMDxFDP9iOwpN1H2do,12
21
+ gitex-0.3.0.dist-info/RECORD,,
tests/test_textual.py CHANGED
@@ -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 "[x]" in str(target_node.label)
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 "[x]" in str(folder_ui_node.label)
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 [x]
160
- assert "[x]" in str(folder_ui_node.label)
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 "[x]" in str(folder_node.label)
288
+ assert "[]" in str(folder_node.label)
289
289
 
290
290
  # Toggle off
291
291
  app._toggle_recursively(folder_node, select=False)
@@ -1,115 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: gitex
3
- Version: 0.2.18
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
- [![CI](https://github.com/zozaai/gitex/actions/workflows/ci.yml/badge.svg)](https://github.com/zozaai/gitex/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/zozaai/gitex/branch/main/graph/badge.svg)](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
- ![Preview](docs/gitex_demo.png)
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