code-assembler-pro 4.2.1__tar.gz → 4.3.0__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.
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/PKG-INFO +98 -85
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/README.md +249 -236
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/pyproject.toml +1 -1
- code_assembler_pro-4.3.0/src/code_assembler/__main__.py +7 -0
- code_assembler_pro-4.3.0/src/code_assembler/cli.py +210 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/config.py +154 -135
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/constants.py +252 -203
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/core.py +295 -277
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/file_io.py +86 -83
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/formatters.py +141 -135
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/interactive.py +432 -432
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/templates/components/file_block.md.j2 +10 -8
- code_assembler_pro-4.3.0/src/code_assembler/utils.py +122 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler_pro.egg-info/PKG-INFO +98 -85
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/tests/test_file_io.py +41 -40
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/tests/test_interactive.py +163 -163
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/tests/test_utils.py +69 -58
- code_assembler_pro-4.2.1/src/code_assembler/__main__.py +0 -23
- code_assembler_pro-4.2.1/src/code_assembler/cli.py +0 -148
- code_assembler_pro-4.2.1/src/code_assembler/utils.py +0 -110
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/setup.cfg +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/__init__.py +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/analyzers.py +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/templates/components/architecture.md.j2 +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/templates/components/readme_context.md.j2 +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/templates/components/stats_table.md.j2 +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/templates/components/toc.md.j2 +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler/templates/main_header.md.j2 +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler_pro.egg-info/SOURCES.txt +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler_pro.egg-info/dependency_links.txt +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler_pro.egg-info/entry_points.txt +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler_pro.egg-info/requires.txt +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/src/code_assembler_pro.egg-info/top_level.txt +0 -0
- {code_assembler_pro-4.2.1 → code_assembler_pro-4.3.0}/tests/test_core.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-assembler-pro
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3.0
|
|
4
4
|
Summary: Consolidate your codebase into structured Markdown context for LLMs (Claude, GPT, Gemini).
|
|
5
5
|
Author-email: Xavier Mehaut <xavier.mehaut@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -29,11 +29,13 @@ Requires-Dist: jinja2>=3.1.0
|
|
|
29
29
|
|
|
30
30
|
> **Turn your codebase into structured, LLM-ready context with one command.**
|
|
31
31
|
|
|
32
|
-

|
|
33
33
|

|
|
34
34
|

|
|
35
|
+
[](https://badge.fury.io/py/code-assembler-pro)
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
|
|
38
|
+
**Code Assembler Pro** is a high-grade engineering utility designed to bridge the gap between your source code and Large Language Models (Claude, GPT-4o, Gemini, DeepSeek).
|
|
37
39
|
|
|
38
40
|
It doesn't just concatenate files; it generates a **contextual technical document** optimized for LLM ingestion, preserving project structure, identifying architectural patterns, and managing token limits through intelligent truncation.
|
|
39
41
|
|
|
@@ -41,7 +43,7 @@ It doesn't just concatenate files; it generates a **contextual technical documen
|
|
|
41
43
|
|
|
42
44
|
## 🎯 Why Code Assembler Pro?
|
|
43
45
|
|
|
44
|
-
Copy-pasting raw files into a chat window leads to context loss (who calls what? where is this file located?).
|
|
46
|
+
Copy-pasting raw files into a chat window leads to context loss (who calls what? where is this file located?).
|
|
45
47
|
|
|
46
48
|
**Code Assembler Pro solves this by:**
|
|
47
49
|
1. **🗺️ Project Mapping:** Automatically generates a clickable Table of Contents and architectural overview.
|
|
@@ -55,18 +57,24 @@ Copy-pasting raw files into a chat window leads to context loss (who calls what?
|
|
|
55
57
|
|
|
56
58
|
- **🧠 Architecture Analysis:** Detects design patterns (MVC, API, Testing structures) and provides file distribution stats.
|
|
57
59
|
- **📊 Token Metrics:** Real-time estimation of token count to stay within model limits.
|
|
58
|
-
-
|
|
60
|
+
- **📌 Dual Interface:** Use it as a powerful CLI tool or integrate it as a Python library.
|
|
59
61
|
- **📝 Multi-Language Support:** Syntax highlighting for 50+ extensions (.py, .rs, .ts, .go, .toml, etc.).
|
|
62
|
+
- **📄 Exact Filename Matching:** **(v4.3)** Include files like `Dockerfile`, `Makefile`, `.env` by exact name.
|
|
60
63
|
- **ℹ️ README Integration:** Automatically injects local READMEs into the flow to provide folder-level context to the AI.
|
|
64
|
+
- **🖥️ Cross-Platform:** Works on Windows (PowerShell, cmd), macOS, and Linux with automatic emoji/ASCII adaptation.
|
|
61
65
|
|
|
62
66
|
---
|
|
63
67
|
|
|
64
68
|
## 🚀 Installation
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
### From PyPI
|
|
71
|
+
```bash
|
|
72
|
+
pip install code-assembler-pro
|
|
73
|
+
```
|
|
67
74
|
|
|
75
|
+
### From source (development)
|
|
68
76
|
```bash
|
|
69
|
-
git clone https://github.com/
|
|
77
|
+
git clone https://github.com/xmehaut/code-assembler-pro.git
|
|
70
78
|
cd code-assembler-pro
|
|
71
79
|
pip install -e .
|
|
72
80
|
```
|
|
@@ -86,7 +94,14 @@ Consolidate all Python and Markdown files in the current directory:
|
|
|
86
94
|
code-assembler . --ext py md
|
|
87
95
|
```
|
|
88
96
|
|
|
89
|
-
### 2.
|
|
97
|
+
### 2. Include special files
|
|
98
|
+
Include `Dockerfile`, `.env`, and Jinja2 templates alongside Python:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
code-assembler . --ext py md yml Dockerfile .env .env.j2 .j2
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 3. Targeted Usage
|
|
90
105
|
Exclude tests, target a specific source folder, and define a custom output:
|
|
91
106
|
|
|
92
107
|
```bash
|
|
@@ -96,16 +111,51 @@ code-assembler ./src \
|
|
|
96
111
|
--output project_context.md
|
|
97
112
|
```
|
|
98
113
|
|
|
114
|
+
### 4. Save your CLI as a reusable config
|
|
115
|
+
```bash
|
|
116
|
+
code-assembler . --ext py md Dockerfile --exclude tests --save-config my_project.json
|
|
117
|
+
```
|
|
118
|
+
Reuse it later:
|
|
119
|
+
```bash
|
|
120
|
+
code-assembler --config my_project.json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 5. Show default exclusions
|
|
124
|
+
```bash
|
|
125
|
+
code-assembler --show-excludes
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 🧙♂️ Interactive Mode
|
|
131
|
+
|
|
132
|
+
**Don't want to remember CLI arguments?** Use the interactive wizard!
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
code-assembler --interactive
|
|
136
|
+
# or
|
|
137
|
+
code-assembler -i
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The wizard will guide you through:
|
|
141
|
+
1. 📂 **Path selection** — Choose directories or specific files
|
|
142
|
+
2. 📝 **Extension presets** — Python, JS/TS, Rust, Go, Java, C/C++, or custom
|
|
143
|
+
3. 🚫 **Smart exclusions** — Use defaults or add custom patterns
|
|
144
|
+
4. 💾 **Output config** — Name your file, auto-detect conflicts
|
|
145
|
+
5. ⚙️ **Advanced options** — Truncation, recursion, README inclusion
|
|
146
|
+
|
|
147
|
+
👉 **[Full Interactive Mode Guide](INTERACTIVE_MODE.md)** | **[5-Minute Quickstart](QUICKSTART_INTERACTIVE.md)**
|
|
148
|
+
|
|
99
149
|
---
|
|
100
150
|
|
|
101
151
|
## ⚙️ Advanced Configuration (JSON)
|
|
102
152
|
|
|
103
|
-
For complex projects, use a JSON configuration file
|
|
153
|
+
For complex projects, use a JSON configuration file for full control:
|
|
104
154
|
|
|
105
155
|
```json
|
|
106
156
|
{
|
|
107
|
-
"paths": ["./src", "./
|
|
108
|
-
"extensions": [".py", ".ts", ".tsx", ".sql"],
|
|
157
|
+
"paths": ["./src", "./infra"],
|
|
158
|
+
"extensions": [".py", ".ts", ".tsx", ".sql", "Dockerfile", ".env.j2"],
|
|
109
159
|
"exclude_patterns": [
|
|
110
160
|
"migrations",
|
|
111
161
|
"__pycache__",
|
|
@@ -125,19 +175,37 @@ Run it using:
|
|
|
125
175
|
code-assembler --config assembler_config.json
|
|
126
176
|
```
|
|
127
177
|
|
|
128
|
-
### 📖
|
|
178
|
+
### 📖 CLI Options Reference
|
|
179
|
+
|
|
180
|
+
| Option | Description |
|
|
181
|
+
|--------|-------------|
|
|
182
|
+
| `paths` | Files or directories to analyze |
|
|
183
|
+
| `--ext` / `-e` | Extensions and filenames to include (e.g., `py md Dockerfile`) |
|
|
184
|
+
| `--output` / `-o` | Output file name (default: `codebase.md`) |
|
|
185
|
+
| `--exclude` / `-x` | Patterns to exclude (added to defaults) |
|
|
186
|
+
| `--config` / `-c` | Load a JSON configuration file |
|
|
187
|
+
| `--interactive` / `-i` | Launch the interactive wizard |
|
|
188
|
+
| `--save-config FILE` | **(v4.3)** Save CLI args as reusable JSON config |
|
|
189
|
+
| `--show-excludes` | **(v4.3)** Display default exclusion patterns |
|
|
190
|
+
| `--no-recursive` | Do not traverse subdirectories |
|
|
191
|
+
| `--no-readmes` | Do not auto-include README files |
|
|
192
|
+
| `--no-default-excludes` | Disable default exclusion patterns |
|
|
193
|
+
| `--max-size` | Maximum file size in MB (default: 10.0) |
|
|
194
|
+
| `--version` | Show version and exit |
|
|
195
|
+
|
|
196
|
+
### 📖 JSON Configuration Options
|
|
129
197
|
|
|
130
198
|
| Option | Type | Description | Default |
|
|
131
199
|
|--------|------|-------------|---------|
|
|
132
200
|
| **`paths`** | `List` | Root directories or files to analyze. | **Required** |
|
|
133
|
-
| **`extensions`** | `List` | File extensions
|
|
201
|
+
| **`extensions`** | `List` | File extensions and exact filenames (e.g., `[".py", "Dockerfile"]`). | **Required** |
|
|
134
202
|
| **`output`** | `str` | Name of the generated Markdown file. | `"codebase.md"` |
|
|
135
|
-
| **`exclude_patterns`** | `List` | Patterns to ignore (e.g., `"tests"`, `"build/"`). | `[]` |
|
|
203
|
+
| **`exclude_patterns`** | `List` | Patterns to ignore (e.g., `"tests"`, `"*.log"`, `"build/"`). | `[]` |
|
|
136
204
|
| **`recursive`** | `bool` | Whether to traverse subdirectories. | `true` |
|
|
137
205
|
| **`include_readmes`** | `bool` | Automatically include `README.md` for folder context. | `true` |
|
|
138
206
|
| **`max_file_size_mb`** | `float` | Size limit before a file is truncated or skipped. | `10.0` |
|
|
139
|
-
| **`truncate_large_files`** | `bool` |
|
|
140
|
-
| **`truncation_limit_lines`** | `int` |
|
|
207
|
+
| **`truncate_large_files`** | `bool` | If true, cuts large files instead of skipping them. | `true` |
|
|
208
|
+
| **`truncation_limit_lines`** | `int` | Number of lines to keep when truncating. | `500` |
|
|
141
209
|
|
|
142
210
|
---
|
|
143
211
|
|
|
@@ -151,7 +219,7 @@ from code_assembler import assemble_codebase
|
|
|
151
219
|
# Configure and execute
|
|
152
220
|
markdown_content = assemble_codebase(
|
|
153
221
|
paths=["./src"],
|
|
154
|
-
extensions=[".py"],
|
|
222
|
+
extensions=[".py", "Dockerfile"],
|
|
155
223
|
output="ai_docs.md",
|
|
156
224
|
truncate_large_files=True,
|
|
157
225
|
truncation_limit_lines=200,
|
|
@@ -163,95 +231,40 @@ print(f"Generated context: {len(markdown_content)} characters.")
|
|
|
163
231
|
|
|
164
232
|
---
|
|
165
233
|
|
|
166
|
-
## 🧙♂️ Interactive Mode (New!)
|
|
167
|
-
|
|
168
|
-
**Don't want to remember CLI arguments?** Use the interactive wizard!
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
code-assembler --interactive
|
|
172
|
-
# or
|
|
173
|
-
code-assembler -i
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
The wizard will guide you through:
|
|
177
|
-
1. 📂 **Path selection** - Choose directories or specific files
|
|
178
|
-
2. 📝 **Extension presets** - Python, JS/TS, Rust, Go, Java, C/C++, or custom
|
|
179
|
-
3. 🚫 **Smart exclusions** - Use defaults or add custom patterns
|
|
180
|
-
4. 💾 **Output config** - Name your file, auto-detect conflicts
|
|
181
|
-
5. ⚙️ **Advanced options** - Truncation, recursion, README inclusion
|
|
182
|
-
|
|
183
|
-
**Example session:**
|
|
184
|
-
```
|
|
185
|
-
🚀 Code Assembler Pro - Interactive Mode
|
|
186
|
-
═════════════════════════════════════════════════════
|
|
187
|
-
|
|
188
|
-
🎯 Step 1: Select Paths to Analyze
|
|
189
|
-
──────────────────────────────────────────────────────
|
|
190
|
-
You can analyze:
|
|
191
|
-
1. Current directory (.)
|
|
192
|
-
2. Specific directory/directories
|
|
193
|
-
3. Specific files
|
|
194
|
-
|
|
195
|
-
Your choice [1-3]: 1
|
|
196
|
-
✅ Selected: current directory
|
|
197
|
-
|
|
198
|
-
🎯 Step 2: Select File Extensions
|
|
199
|
-
──────────────────────────────────────────────────────
|
|
200
|
-
Common presets:
|
|
201
|
-
1. Python projects (.py)
|
|
202
|
-
2. Python + Config + Docs (.py, .md, .toml, .yaml)
|
|
203
|
-
3. JavaScript/TypeScript (.js, .ts, .jsx, .tsx)
|
|
204
|
-
...
|
|
205
|
-
|
|
206
|
-
Your choice [1-8]: 2
|
|
207
|
-
✅ Selected: Python + Config + Docs
|
|
208
|
-
|
|
209
|
-
... [wizard continues]
|
|
210
|
-
|
|
211
|
-
🎯 Configuration Summary
|
|
212
|
-
──────────────────────────────────────────────────────
|
|
213
|
-
📂 Paths: .
|
|
214
|
-
📝 Extensions: .py, .md, .toml, .yaml
|
|
215
|
-
💾 Output: codebase.md
|
|
216
|
-
🔧 Recursive: True
|
|
217
|
-
✂️ Truncate large files: True (keep first 500 lines)
|
|
218
|
-
|
|
219
|
-
🚀 Start assembly? [Y/n]: y
|
|
220
|
-
|
|
221
|
-
💾 Save this configuration for future use? [y/N]: y
|
|
222
|
-
✅ Configuration saved to: assembler_config.json
|
|
223
|
-
Reuse it with: code-assembler --config assembler_config.json
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
👉 **[Full Interactive Mode Guide](INTERACTIVE_MODE.md)**
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
234
|
## 💡 Recommended Use Cases
|
|
231
235
|
|
|
232
236
|
### 1. Onboarding & Audit
|
|
233
237
|
> *"Analyze this codebase and summarize the architecture, then list potential technical debt."*
|
|
234
|
-
👉 Provide the generated `codebase.md` to Claude/GPT-4.
|
|
235
238
|
|
|
236
239
|
### 2. Massive Refactoring
|
|
237
240
|
> *"I want to migrate this module from `requests` to `httpx`. Here is the relevant code. Propose a migration plan."*
|
|
238
|
-
👉 Target specific folders to reduce noise and stay within token limits.
|
|
239
241
|
|
|
240
242
|
### 3. Complex Debugging
|
|
241
243
|
> *"I have a circular import error between these three files. Find the root cause and fix it."*
|
|
242
|
-
|
|
244
|
+
|
|
245
|
+
### 4. Infrastructure as Code
|
|
246
|
+
> *"Review my Docker + Kubernetes setup and suggest improvements."*
|
|
247
|
+
Include `Dockerfile`, `.yml`, `.env.j2` in your extensions.
|
|
243
248
|
|
|
244
249
|
---
|
|
245
250
|
|
|
246
251
|
## 🤝 Contributing
|
|
247
252
|
|
|
248
|
-
Contributions are welcome!
|
|
253
|
+
Contributions are welcome!
|
|
249
254
|
1. Fork the Project.
|
|
250
255
|
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`).
|
|
251
256
|
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`).
|
|
252
257
|
4. Push to the Branch (`git push origin feature/AmazingFeature`).
|
|
253
258
|
5. Open a Pull Request.
|
|
254
259
|
|
|
260
|
+
### Development Setup
|
|
261
|
+
```bash
|
|
262
|
+
git clone https://github.com/xmehaut/code-assembler-pro.git
|
|
263
|
+
cd code-assembler-pro
|
|
264
|
+
pip install -e ".[dev]"
|
|
265
|
+
pytest tests/ -v
|
|
266
|
+
```
|
|
267
|
+
|
|
255
268
|
---
|
|
256
269
|
|
|
257
270
|
## 📄 License
|