contextzip 0.1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Deepesh Kumar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,331 @@
1
+ Metadata-Version: 2.4
2
+ Name: contextzip
3
+ Version: 0.1.0
4
+ Summary: Intelligently package your codebase for AI tools
5
+ Author-email: Deepesh <akadeepesh@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Deepesh Kumar
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/akadeepesh/contextzip
28
+ Project-URL: Repository, https://github.com/akadeepesh/contextzip
29
+ Project-URL: Issues, https://github.com/akadeepesh/contextzip/issues
30
+ Keywords: ai,cli,developer-tools,context,zip,llm
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Environment :: Console
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.9
37
+ Classifier: Programming Language :: Python :: 3.10
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Topic :: Software Development :: Build Tools
41
+ Classifier: Topic :: Utilities
42
+ Requires-Python: >=3.9
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: click>=8.1
46
+ Requires-Dist: rich>=13.0
47
+ Requires-Dist: pathspec>=0.12
48
+ Dynamic: license-file
49
+
50
+ # contextzip
51
+
52
+ > Stop copy-pasting files manually. Package exactly the right parts of your codebase and paste it straight into Claude, ChatGPT, or any AI tool — in one command.
53
+
54
+ ```
55
+ contextzip
56
+ ```
57
+
58
+ ---
59
+
60
+ ## The problem
61
+
62
+ Every time you want help from an AI tool, you go through the same ritual:
63
+
64
+ 1. Find the relevant files in your project
65
+ 2. Skip `node_modules`, `.next`, `__pycache__`, build artifacts, lock files...
66
+ 3. Select the right ones, zip them, find the zip, upload it
67
+ 4. Repeat every single session
68
+
69
+ contextzip eliminates that entirely. Run it from your project root — it detects your stack, applies smart exclusions, produces a lean ZIP, and opens your file manager with the archive already selected. One `Ctrl+C` and you're done.
70
+
71
+ ---
72
+
73
+ ## Features
74
+
75
+ - **Smart framework detection** — automatically identifies Node.js, Next.js, Python, Django, FastAPI, Rust, Go, Ruby and applies the right exclusion rules for each
76
+ - **Respects your `.gitignore`** — patterns from your existing gitignore are honoured automatically
77
+ - **Warns before it's a problem** — flags large files (≥ 1 MB) and binary files that AI tools can't read, before you waste an upload
78
+ - **Handles the messy stuff** — dangling symlinks, unreadable files, and files outside the project tree are all caught and reported, never silently dropped
79
+ - **Full CLI control** — `--include`, `--exclude`, `--dry-run`, `--verbose`, `--output`, all composable
80
+ - **Cross-platform clipboard integration** — copies the file to clipboard on macOS/Linux; opens Explorer with the ZIP selected on Windows
81
+
82
+ ---
83
+
84
+ ## Installation
85
+
86
+ **Requires Python 3.9+**
87
+
88
+ ```bash
89
+ pip install contextzip
90
+ ```
91
+
92
+ Or with [pipx](https://pipx.pypa.io/) (recommended for CLI tools — keeps it isolated):
93
+
94
+ ```bash
95
+ pipx install contextzip
96
+ ```
97
+
98
+ Verify the install:
99
+
100
+ ```bash
101
+ contextzip --version
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Quick start
107
+
108
+ Navigate to any project and run:
109
+
110
+ ```bash
111
+ cd ~/projects/my-app
112
+ contextzip
113
+ ```
114
+
115
+ That's it. contextzip will:
116
+
117
+ 1. Detect your framework (e.g. `Next.js + Node.js`)
118
+ 2. Apply the appropriate exclusion rules
119
+ 3. Scan and summarise what will be included
120
+ 4. Create a compressed ZIP in your system temp directory
121
+ 5. Open your file manager with the ZIP selected and ready to copy
122
+
123
+ ---
124
+
125
+ ## Usage
126
+
127
+ ```
128
+ contextzip [OPTIONS]
129
+ ```
130
+
131
+ | Option | Description |
132
+ |---|---|
133
+ | `-i`, `--include PATH` | Only include files under this path. Repeatable. |
134
+ | `-e`, `--exclude PATTERN` | Extra exclusion patterns (gitignore syntax). Repeatable. |
135
+ | `-n`, `--dry-run` | Preview what would be included — no ZIP created. |
136
+ | `-o`, `--output FILE` | Custom output path for the ZIP file. |
137
+ | `--no-clipboard` | Skip the clipboard / folder-open step. |
138
+ | `--no-gitignore` | Ignore the project's `.gitignore` file. |
139
+ | `-v`, `--verbose` | Show every included and excluded file with sizes. |
140
+ | `-h`, `--help` | Show help and exit. |
141
+ | `--version` | Show version and exit. |
142
+
143
+ ---
144
+
145
+ ## Examples
146
+
147
+ **Preview what would be packaged (no ZIP created):**
148
+ ```bash
149
+ contextzip --dry-run
150
+ ```
151
+
152
+ **Only package specific directories:**
153
+ ```bash
154
+ contextzip --include src --include app
155
+ ```
156
+
157
+ **Exclude additional patterns beyond the auto-rules:**
158
+ ```bash
159
+ contextzip --exclude "*.log" --exclude "*.sqlite" --exclude "tests/"
160
+ ```
161
+
162
+ **Save ZIP to a specific path:**
163
+ ```bash
164
+ contextzip --output ~/Desktop/my-project-context.zip
165
+ ```
166
+
167
+ **Full verbose audit — see every file decision:**
168
+ ```bash
169
+ contextzip --dry-run --verbose
170
+ ```
171
+
172
+ **Combine include + extra excludes:**
173
+ ```bash
174
+ contextzip --include src --exclude "**/*.test.ts"
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Framework detection & auto-exclusions
180
+
181
+ contextzip detects your stack from config files in the project root and stacks the appropriate rules.
182
+
183
+ ### Detection signals
184
+
185
+ | File found | Detected as |
186
+ |---|---|
187
+ | `next.config.js` / `.ts` / `.mjs` or `"next"` in `package.json` | Next.js |
188
+ | `package.json` | Node.js |
189
+ | `manage.py` or `"django"` in requirements | Django |
190
+ | `"fastapi"` in requirements | FastAPI |
191
+ | `requirements.txt` / `pyproject.toml` / `setup.py` | Python |
192
+ | `Cargo.toml` | Rust |
193
+ | `go.mod` | Go |
194
+ | `Gemfile` | Ruby |
195
+
196
+ Detection is **additive** — a monorepo with both `package.json` and `pyproject.toml` will have both rule sets applied.
197
+
198
+ ### What gets excluded
199
+
200
+ **Always (every project):**
201
+ `.git/`, `.env`, `.env.*`, `*.log`, `logs/`, `.cache/`, `tmp/`, editor files (`.vscode/`, `.idea/`), OS files (`.DS_Store`, `Thumbs.db`), common binary formats (images, audio, video, archives)
202
+
203
+ **Node.js / Next.js:**
204
+ `node_modules/`, `.next/`, `.nuxt/`, `dist/`, `build/`, `out/`, `.turbo/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `*.min.js`, `*.d.ts`, `tsconfig.tsbuildinfo`
205
+
206
+ **Python:**
207
+ `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `*.egg-info/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `htmlcov/`, `*.sqlite3`, `migrations/`, `poetry.lock`, `uv.lock`
208
+
209
+ **Rust:**
210
+ `target/`, `Cargo.lock`, `*.rlib`, `*.rmeta`
211
+
212
+ **Go:**
213
+ `vendor/`, `go.sum`, `bin/`
214
+
215
+ Plus any patterns from your project's own `.gitignore`.
216
+
217
+ ---
218
+
219
+ ## Clipboard behaviour
220
+
221
+ contextzip uses a tiered strategy so it never just fails silently:
222
+
223
+ | Platform | Tier 1 (auto) | Tier 2 (fallback) | Tier 3 (last resort) |
224
+ |---|---|---|---|
225
+ | **macOS** | File copied to clipboard via Finder — paste directly into browser | `open -R` reveals ZIP in Finder | Path printed to terminal |
226
+ | **Linux** | `xclip` copies file bytes with `application/zip` MIME type | `xdg-open` opens containing folder | Path printed to terminal |
227
+ | **Windows** | — | `explorer /select,"..."` opens Explorer with ZIP highlighted → `Ctrl+C` | Path printed to terminal |
228
+
229
+ On **macOS** and **Linux with xclip**, you can paste the ZIP directly into an upload zone (Claude, ChatGPT, etc.) — no file picker needed. On **Windows**, Explorer opens with the file already selected so one `Ctrl+C` is all it takes.
230
+
231
+ ---
232
+
233
+ ## Warnings
234
+
235
+ contextzip surfaces issues before they waste your time:
236
+
237
+ **Large files (≥ 1 MB)** — listed with sizes and a suggestion to exclude if unneeded. AI context windows have limits; a 5 MB log file helps no one.
238
+
239
+ **Binary files** — files detected as binary (null bytes in the first 512 bytes) are flagged. Most AI tools can't read binary content; you may want to exclude them.
240
+
241
+ **Skipped files** — dangling symlinks, permission-denied files, and paths outside the project tree are listed with their specific reason rather than silently dropped.
242
+
243
+ ---
244
+
245
+ ## Project structure
246
+
247
+ ```
248
+ contextzip/
249
+ ├── contextzip/
250
+ │ ├── __init__.py # version string
251
+ │ ├── cli.py # Click entry point, all flags, rich output
252
+ │ ├── detector.py # framework/language detection engine
253
+ │ ├── filters.py # pathspec-based file filtering + ResolveResult
254
+ │ ├── packager.py # ZIP creation, compression stats, PackageResult
255
+ │ ├── clipboard.py # tiered clipboard strategy (all platforms)
256
+ │ └── rules/
257
+ │ ├── base.py # universal exclusions
258
+ │ ├── node.py # Node.js / Next.js / Vite
259
+ │ ├── python.py # Python / Django / FastAPI
260
+ │ ├── rust.py # Rust / Cargo
261
+ │ └── go.py # Go modules
262
+ └── pyproject.toml
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Adding a new language / framework
268
+
269
+ 1. Create `contextzip/rules/yourlang.py` with a `PATTERNS` list using gitignore syntax:
270
+
271
+ ```python
272
+ PATTERNS = [
273
+ "build/",
274
+ "*.compiled",
275
+ ".cache/",
276
+ ]
277
+ ```
278
+
279
+ 2. Register it in `filters.py`:
280
+
281
+ ```python
282
+ _RULE_REGISTRY: dict[str, str] = {
283
+ ...
284
+ "yourlang": "contextzip.rules.yourlang",
285
+ }
286
+ ```
287
+
288
+ 3. Add a detection rule in `detector.py`:
289
+
290
+ ```python
291
+ _Rule(
292
+ name="YourLang",
293
+ module="yourlang",
294
+ check=lambda p: _file_exists(p, "yourlang.config"),
295
+ weight=3,
296
+ ),
297
+ ```
298
+
299
+ That's it — detection, filtering, and CLI output all pick it up automatically.
300
+
301
+ ---
302
+
303
+ ## Dependencies
304
+
305
+ | Package | Purpose |
306
+ |---|---|
307
+ | [`click`](https://click.palletsprojects.com/) | CLI framework |
308
+ | [`rich`](https://rich.readthedocs.io/) | Terminal output, panels, progress bars |
309
+ | [`pathspec`](https://github.com/cpburnz/python-pathspec) | Gitignore-style pattern matching |
310
+
311
+ No other runtime dependencies. Clipboard and folder-open use only stdlib (`subprocess`, `shutil`, `platform`).
312
+
313
+ ---
314
+
315
+ ## Contributing
316
+
317
+ Contributions are welcome — especially new framework rule sets, edge case fixes, and platform-specific clipboard improvements.
318
+
319
+ ```bash
320
+ git clone https://github.com/yourusername/contextzip
321
+ cd contextzip
322
+ pip install -e .
323
+ ```
324
+
325
+ Please open an issue before submitting a large PR so we can discuss the approach first.
326
+
327
+ ---
328
+
329
+ ## License
330
+
331
+ MIT — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,282 @@
1
+ # contextzip
2
+
3
+ > Stop copy-pasting files manually. Package exactly the right parts of your codebase and paste it straight into Claude, ChatGPT, or any AI tool — in one command.
4
+
5
+ ```
6
+ contextzip
7
+ ```
8
+
9
+ ---
10
+
11
+ ## The problem
12
+
13
+ Every time you want help from an AI tool, you go through the same ritual:
14
+
15
+ 1. Find the relevant files in your project
16
+ 2. Skip `node_modules`, `.next`, `__pycache__`, build artifacts, lock files...
17
+ 3. Select the right ones, zip them, find the zip, upload it
18
+ 4. Repeat every single session
19
+
20
+ contextzip eliminates that entirely. Run it from your project root — it detects your stack, applies smart exclusions, produces a lean ZIP, and opens your file manager with the archive already selected. One `Ctrl+C` and you're done.
21
+
22
+ ---
23
+
24
+ ## Features
25
+
26
+ - **Smart framework detection** — automatically identifies Node.js, Next.js, Python, Django, FastAPI, Rust, Go, Ruby and applies the right exclusion rules for each
27
+ - **Respects your `.gitignore`** — patterns from your existing gitignore are honoured automatically
28
+ - **Warns before it's a problem** — flags large files (≥ 1 MB) and binary files that AI tools can't read, before you waste an upload
29
+ - **Handles the messy stuff** — dangling symlinks, unreadable files, and files outside the project tree are all caught and reported, never silently dropped
30
+ - **Full CLI control** — `--include`, `--exclude`, `--dry-run`, `--verbose`, `--output`, all composable
31
+ - **Cross-platform clipboard integration** — copies the file to clipboard on macOS/Linux; opens Explorer with the ZIP selected on Windows
32
+
33
+ ---
34
+
35
+ ## Installation
36
+
37
+ **Requires Python 3.9+**
38
+
39
+ ```bash
40
+ pip install contextzip
41
+ ```
42
+
43
+ Or with [pipx](https://pipx.pypa.io/) (recommended for CLI tools — keeps it isolated):
44
+
45
+ ```bash
46
+ pipx install contextzip
47
+ ```
48
+
49
+ Verify the install:
50
+
51
+ ```bash
52
+ contextzip --version
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Quick start
58
+
59
+ Navigate to any project and run:
60
+
61
+ ```bash
62
+ cd ~/projects/my-app
63
+ contextzip
64
+ ```
65
+
66
+ That's it. contextzip will:
67
+
68
+ 1. Detect your framework (e.g. `Next.js + Node.js`)
69
+ 2. Apply the appropriate exclusion rules
70
+ 3. Scan and summarise what will be included
71
+ 4. Create a compressed ZIP in your system temp directory
72
+ 5. Open your file manager with the ZIP selected and ready to copy
73
+
74
+ ---
75
+
76
+ ## Usage
77
+
78
+ ```
79
+ contextzip [OPTIONS]
80
+ ```
81
+
82
+ | Option | Description |
83
+ |---|---|
84
+ | `-i`, `--include PATH` | Only include files under this path. Repeatable. |
85
+ | `-e`, `--exclude PATTERN` | Extra exclusion patterns (gitignore syntax). Repeatable. |
86
+ | `-n`, `--dry-run` | Preview what would be included — no ZIP created. |
87
+ | `-o`, `--output FILE` | Custom output path for the ZIP file. |
88
+ | `--no-clipboard` | Skip the clipboard / folder-open step. |
89
+ | `--no-gitignore` | Ignore the project's `.gitignore` file. |
90
+ | `-v`, `--verbose` | Show every included and excluded file with sizes. |
91
+ | `-h`, `--help` | Show help and exit. |
92
+ | `--version` | Show version and exit. |
93
+
94
+ ---
95
+
96
+ ## Examples
97
+
98
+ **Preview what would be packaged (no ZIP created):**
99
+ ```bash
100
+ contextzip --dry-run
101
+ ```
102
+
103
+ **Only package specific directories:**
104
+ ```bash
105
+ contextzip --include src --include app
106
+ ```
107
+
108
+ **Exclude additional patterns beyond the auto-rules:**
109
+ ```bash
110
+ contextzip --exclude "*.log" --exclude "*.sqlite" --exclude "tests/"
111
+ ```
112
+
113
+ **Save ZIP to a specific path:**
114
+ ```bash
115
+ contextzip --output ~/Desktop/my-project-context.zip
116
+ ```
117
+
118
+ **Full verbose audit — see every file decision:**
119
+ ```bash
120
+ contextzip --dry-run --verbose
121
+ ```
122
+
123
+ **Combine include + extra excludes:**
124
+ ```bash
125
+ contextzip --include src --exclude "**/*.test.ts"
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Framework detection & auto-exclusions
131
+
132
+ contextzip detects your stack from config files in the project root and stacks the appropriate rules.
133
+
134
+ ### Detection signals
135
+
136
+ | File found | Detected as |
137
+ |---|---|
138
+ | `next.config.js` / `.ts` / `.mjs` or `"next"` in `package.json` | Next.js |
139
+ | `package.json` | Node.js |
140
+ | `manage.py` or `"django"` in requirements | Django |
141
+ | `"fastapi"` in requirements | FastAPI |
142
+ | `requirements.txt` / `pyproject.toml` / `setup.py` | Python |
143
+ | `Cargo.toml` | Rust |
144
+ | `go.mod` | Go |
145
+ | `Gemfile` | Ruby |
146
+
147
+ Detection is **additive** — a monorepo with both `package.json` and `pyproject.toml` will have both rule sets applied.
148
+
149
+ ### What gets excluded
150
+
151
+ **Always (every project):**
152
+ `.git/`, `.env`, `.env.*`, `*.log`, `logs/`, `.cache/`, `tmp/`, editor files (`.vscode/`, `.idea/`), OS files (`.DS_Store`, `Thumbs.db`), common binary formats (images, audio, video, archives)
153
+
154
+ **Node.js / Next.js:**
155
+ `node_modules/`, `.next/`, `.nuxt/`, `dist/`, `build/`, `out/`, `.turbo/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `*.min.js`, `*.d.ts`, `tsconfig.tsbuildinfo`
156
+
157
+ **Python:**
158
+ `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `*.egg-info/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `htmlcov/`, `*.sqlite3`, `migrations/`, `poetry.lock`, `uv.lock`
159
+
160
+ **Rust:**
161
+ `target/`, `Cargo.lock`, `*.rlib`, `*.rmeta`
162
+
163
+ **Go:**
164
+ `vendor/`, `go.sum`, `bin/`
165
+
166
+ Plus any patterns from your project's own `.gitignore`.
167
+
168
+ ---
169
+
170
+ ## Clipboard behaviour
171
+
172
+ contextzip uses a tiered strategy so it never just fails silently:
173
+
174
+ | Platform | Tier 1 (auto) | Tier 2 (fallback) | Tier 3 (last resort) |
175
+ |---|---|---|---|
176
+ | **macOS** | File copied to clipboard via Finder — paste directly into browser | `open -R` reveals ZIP in Finder | Path printed to terminal |
177
+ | **Linux** | `xclip` copies file bytes with `application/zip` MIME type | `xdg-open` opens containing folder | Path printed to terminal |
178
+ | **Windows** | — | `explorer /select,"..."` opens Explorer with ZIP highlighted → `Ctrl+C` | Path printed to terminal |
179
+
180
+ On **macOS** and **Linux with xclip**, you can paste the ZIP directly into an upload zone (Claude, ChatGPT, etc.) — no file picker needed. On **Windows**, Explorer opens with the file already selected so one `Ctrl+C` is all it takes.
181
+
182
+ ---
183
+
184
+ ## Warnings
185
+
186
+ contextzip surfaces issues before they waste your time:
187
+
188
+ **Large files (≥ 1 MB)** — listed with sizes and a suggestion to exclude if unneeded. AI context windows have limits; a 5 MB log file helps no one.
189
+
190
+ **Binary files** — files detected as binary (null bytes in the first 512 bytes) are flagged. Most AI tools can't read binary content; you may want to exclude them.
191
+
192
+ **Skipped files** — dangling symlinks, permission-denied files, and paths outside the project tree are listed with their specific reason rather than silently dropped.
193
+
194
+ ---
195
+
196
+ ## Project structure
197
+
198
+ ```
199
+ contextzip/
200
+ ├── contextzip/
201
+ │ ├── __init__.py # version string
202
+ │ ├── cli.py # Click entry point, all flags, rich output
203
+ │ ├── detector.py # framework/language detection engine
204
+ │ ├── filters.py # pathspec-based file filtering + ResolveResult
205
+ │ ├── packager.py # ZIP creation, compression stats, PackageResult
206
+ │ ├── clipboard.py # tiered clipboard strategy (all platforms)
207
+ │ └── rules/
208
+ │ ├── base.py # universal exclusions
209
+ │ ├── node.py # Node.js / Next.js / Vite
210
+ │ ├── python.py # Python / Django / FastAPI
211
+ │ ├── rust.py # Rust / Cargo
212
+ │ └── go.py # Go modules
213
+ └── pyproject.toml
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Adding a new language / framework
219
+
220
+ 1. Create `contextzip/rules/yourlang.py` with a `PATTERNS` list using gitignore syntax:
221
+
222
+ ```python
223
+ PATTERNS = [
224
+ "build/",
225
+ "*.compiled",
226
+ ".cache/",
227
+ ]
228
+ ```
229
+
230
+ 2. Register it in `filters.py`:
231
+
232
+ ```python
233
+ _RULE_REGISTRY: dict[str, str] = {
234
+ ...
235
+ "yourlang": "contextzip.rules.yourlang",
236
+ }
237
+ ```
238
+
239
+ 3. Add a detection rule in `detector.py`:
240
+
241
+ ```python
242
+ _Rule(
243
+ name="YourLang",
244
+ module="yourlang",
245
+ check=lambda p: _file_exists(p, "yourlang.config"),
246
+ weight=3,
247
+ ),
248
+ ```
249
+
250
+ That's it — detection, filtering, and CLI output all pick it up automatically.
251
+
252
+ ---
253
+
254
+ ## Dependencies
255
+
256
+ | Package | Purpose |
257
+ |---|---|
258
+ | [`click`](https://click.palletsprojects.com/) | CLI framework |
259
+ | [`rich`](https://rich.readthedocs.io/) | Terminal output, panels, progress bars |
260
+ | [`pathspec`](https://github.com/cpburnz/python-pathspec) | Gitignore-style pattern matching |
261
+
262
+ No other runtime dependencies. Clipboard and folder-open use only stdlib (`subprocess`, `shutil`, `platform`).
263
+
264
+ ---
265
+
266
+ ## Contributing
267
+
268
+ Contributions are welcome — especially new framework rule sets, edge case fixes, and platform-specific clipboard improvements.
269
+
270
+ ```bash
271
+ git clone https://github.com/yourusername/contextzip
272
+ cd contextzip
273
+ pip install -e .
274
+ ```
275
+
276
+ Please open an issue before submitting a large PR so we can discuss the approach first.
277
+
278
+ ---
279
+
280
+ ## License
281
+
282
+ MIT — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,3 @@
1
+ """contextzip — intelligent codebase packager for AI tools."""
2
+
3
+ __version__ = "0.1.0"