contextzip 0.2.3__tar.gz → 0.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.
Files changed (30) hide show
  1. contextzip-0.3.0/PKG-INFO +205 -0
  2. contextzip-0.3.0/README.md +176 -0
  3. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/__init__.py +1 -1
  4. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/cli.py +402 -9
  5. contextzip-0.3.0/contextzip/config.py +158 -0
  6. contextzip-0.3.0/contextzip/packager.py +284 -0
  7. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/base.py +3 -3
  8. contextzip-0.3.0/contextzip.egg-info/PKG-INFO +205 -0
  9. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip.egg-info/SOURCES.txt +1 -0
  10. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip.egg-info/requires.txt +1 -0
  11. {contextzip-0.2.3 → contextzip-0.3.0}/pyproject.toml +3 -2
  12. contextzip-0.2.3/PKG-INFO +0 -335
  13. contextzip-0.2.3/README.md +0 -307
  14. contextzip-0.2.3/contextzip/packager.py +0 -157
  15. contextzip-0.2.3/contextzip.egg-info/PKG-INFO +0 -335
  16. {contextzip-0.2.3 → contextzip-0.3.0}/LICENSE +0 -0
  17. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/clipboard.py +0 -0
  18. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/detector.py +0 -0
  19. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/filters.py +0 -0
  20. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/git.py +0 -0
  21. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/__init__.py +0 -0
  22. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/go.py +0 -0
  23. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/node.py +0 -0
  24. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/python.py +0 -0
  25. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/ruby.py +0 -0
  26. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip/rules/rust.py +0 -0
  27. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip.egg-info/dependency_links.txt +0 -0
  28. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip.egg-info/entry_points.txt +0 -0
  29. {contextzip-0.2.3 → contextzip-0.3.0}/contextzip.egg-info/top_level.txt +0 -0
  30. {contextzip-0.2.3 → contextzip-0.3.0}/setup.cfg +0 -0
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.4
2
+ Name: contextzip
3
+ Version: 0.3.0
4
+ Summary: Intelligently package your codebase for AI tools
5
+ Author-email: Deepesh <akadeepesh@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/akadeepesh/contextzip
8
+ Project-URL: Repository, https://github.com/akadeepesh/contextzip
9
+ Project-URL: Issues, https://github.com/akadeepesh/contextzip/issues
10
+ Keywords: ai,cli,developer-tools,context,zip,llm,claude,chatgpt,code-packaging
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: Utilities
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.1
25
+ Requires-Dist: rich>=13.0
26
+ Requires-Dist: pathspec>=0.12
27
+ Requires-Dist: httpx>=0.27
28
+ Dynamic: license-file
29
+
30
+ # contextzip
31
+
32
+ > Package exactly the right parts of your codebase and paste it into any AI tool — in one command.
33
+
34
+ ```bash
35
+ pip install contextzip
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Why contextzip
41
+
42
+ Every AI session starts the same way: hunt down the relevant files, manually skip `node_modules`, build artifacts, and lock files, zip them, find the zip, upload it. Then do it all again next session.
43
+
44
+ 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.
45
+
46
+ ---
47
+
48
+ ## Features
49
+
50
+ - **Smart framework detection** — automatically identifies Node.js, Next.js, Python, Django, FastAPI, Rust, Go, and Ruby, applying the right exclusion rules for each
51
+ - **Respects `.gitignore`** — your existing ignore patterns are honoured automatically
52
+ - **Git-aware packaging** — use `--git-changes` to package only modified, staged, and untracked files; perfect for incremental debugging and PR review sessions
53
+ - **AI-powered file selection** — describe your task in plain English with `--prompt` and Gemini selects the minimum relevant files automatically, no manual hunting required
54
+ - **Persistent workspace** — all generated ZIPs land in `.contextzip/` at your project root, discoverable, reusable, and git-ignored automatically
55
+ - **Warns before it's a problem** — flags large (≥ 1 MB) and binary files that AI tools can't read, before you waste an upload
56
+ - **Handles edge cases** — dangling symlinks, unreadable files, and paths outside the project tree are caught and reported, never silently dropped
57
+ - **Full CLI control** — `--include`, `--exclude`, `--dry-run`, `--output`, all composable
58
+
59
+ ---
60
+
61
+ ## Installation
62
+
63
+ **Requires Python 3.9+**
64
+
65
+ ```bash
66
+ pip install contextzip
67
+ ```
68
+
69
+ With [pipx](https://pipx.pypa.io/) (recommended for CLI tools — keeps it isolated):
70
+
71
+ ```bash
72
+ pipx install contextzip
73
+ ```
74
+
75
+ Verify:
76
+
77
+ ```bash
78
+ contextzip --version
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Quick start
84
+
85
+ Navigate to any project and run:
86
+
87
+ ```bash
88
+ cd ~/projects/my-app
89
+ contextzip
90
+ ```
91
+
92
+ contextzip will:
93
+
94
+ 1. Detect your framework (e.g. `Next.js + Node.js`)
95
+ 2. Apply the appropriate exclusion rules
96
+ 3. Create a compressed ZIP in `.contextzip/` at your project root
97
+ 4. Open your file manager with the ZIP selected and ready to copy
98
+
99
+ ---
100
+
101
+ ## Usage
102
+
103
+ ```
104
+ contextzip [OPTIONS]
105
+ ```
106
+
107
+ | Option | Description |
108
+ |---|---|
109
+ | `-p`, `--prompt TEXT` | Describe your task in plain English — Gemini selects only the relevant files |
110
+ | `-i`, `--include PATH` | Only include files under this path (repeatable) |
111
+ | `-e`, `--exclude PATTERN` | Add exclusion patterns in gitignore syntax (repeatable) |
112
+ | `--git-changes` | Only include files reported by git as modified, staged, or untracked |
113
+ | `-n`, `--dry-run` | Preview what would be included without creating a ZIP |
114
+ | `-o`, `--output FILE` | Write ZIP to a custom path |
115
+ | `-v`, `--verbose` | Show every included and excluded file with sizes |
116
+ | `--no-clipboard` | Skip the clipboard / folder-open step |
117
+ | `--no-gitignore` | Ignore the project's `.gitignore` |
118
+
119
+ **Subcommands:** `exclude`, `include`, `config` — run `contextzip --help` for full details.
120
+
121
+ ---
122
+
123
+ ## Examples
124
+
125
+ ```bash
126
+ # Preview what would be packaged
127
+ contextzip --dry-run --verbose
128
+
129
+ # Package only specific directories
130
+ contextzip --include src --include app
131
+
132
+ # Exclude additional patterns
133
+ contextzip --exclude "*.log" --exclude "tests/"
134
+
135
+ # Package only git-modified files
136
+ contextzip --git-changes
137
+
138
+ # Let AI pick only the files relevant to your task
139
+ contextzip --prompt "Change toast color on failed login"
140
+
141
+ # Preview AI file selection without creating a ZIP
142
+ contextzip --prompt "Refactor auth middleware" --dry-run
143
+
144
+ # Save to a custom path
145
+ contextzip --output ~/Desktop/project-context.zip
146
+ ```
147
+
148
+ ---
149
+
150
+ ## AI-powered file selection
151
+
152
+ The `--prompt` flag lets you describe a task in plain English. contextzip scans your project, builds a lightweight file map, and asks Gemini to return the minimum set of files needed for that task — typically 2–5, never more than 10. The result is a tightly scoped ZIP with only what you'd actually open to make the change.
153
+
154
+ ```bash
155
+ contextzip --prompt "Change toast color on failed login"
156
+ # → components/ui/toast.tsx, app/login/page.tsx, lib/auth.ts
157
+ ```
158
+
159
+ The ZIP also includes a `prompt.txt` describing the task, so when you drop it into Claude, ChatGPT, or any other AI tool, it immediately understands what you're trying to do.
160
+
161
+ **First-time setup:** `--prompt` requires a free Gemini API key from [Google AI Studio](https://aistudio.google.com/apikey) — no credit card needed. On first use, contextzip guides you through obtaining and saving one. You can also skip the setup entirely with an environment variable:
162
+
163
+ ```bash
164
+ export GEMINI_API_KEY=AIza...
165
+ ```
166
+
167
+ Manage your key at any time:
168
+
169
+ ```bash
170
+ contextzip config # show current key status
171
+ contextzip config --reset-key # clear and re-run setup
172
+ ```
173
+
174
+ ---
175
+
176
+ ## What gets excluded
177
+
178
+ contextzip stacks exclusion rules based on your detected stack, on top of your `.gitignore`.
179
+
180
+ **Always excluded:** `.git/`, `.env` files, logs, caches, editor config (`.vscode/`, `.idea/`), OS files (`.DS_Store`, `Thumbs.db`), and common binary formats.
181
+
182
+ **By framework:**
183
+
184
+ | Stack | Additional exclusions |
185
+ |---|---|
186
+ | Node.js / Next.js | `node_modules/`, `.next/`, `dist/`, `build/`, lock files, `*.min.js`, `*.d.ts` |
187
+ | Python / Django / FastAPI | `__pycache__/`, `.venv/`, `*.pyc`, `migrations/`, `.pytest_cache/`, lock files |
188
+ | Rust | `target/`, `Cargo.lock`, `*.rlib` |
189
+ | Go | `vendor/`, `go.sum`, `bin/` |
190
+
191
+ Detection is additive — a monorepo with both `package.json` and `pyproject.toml` gets both rule sets applied.
192
+
193
+ ---
194
+
195
+ ## Contributing
196
+
197
+ Contributions are welcome — especially new framework rule sets, edge case fixes, and platform-specific clipboard improvements.
198
+
199
+ See [CONTRIBUTING.md](https://github.com/akadeepesh/contextzip/blob/main/CONTRIBUTING.md) for local setup, how to add a new framework, and PR guidelines. Please open an issue before starting a large PR so we can align on the approach first.
200
+
201
+ ---
202
+
203
+ ## License
204
+
205
+ MIT — see [LICENSE](https://github.com/akadeepesh/contextzip/blob/main/LICENSE) for details.
@@ -0,0 +1,176 @@
1
+ # contextzip
2
+
3
+ > Package exactly the right parts of your codebase and paste it into any AI tool — in one command.
4
+
5
+ ```bash
6
+ pip install contextzip
7
+ ```
8
+
9
+ ---
10
+
11
+ ## Why contextzip
12
+
13
+ Every AI session starts the same way: hunt down the relevant files, manually skip `node_modules`, build artifacts, and lock files, zip them, find the zip, upload it. Then do it all again next session.
14
+
15
+ 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.
16
+
17
+ ---
18
+
19
+ ## Features
20
+
21
+ - **Smart framework detection** — automatically identifies Node.js, Next.js, Python, Django, FastAPI, Rust, Go, and Ruby, applying the right exclusion rules for each
22
+ - **Respects `.gitignore`** — your existing ignore patterns are honoured automatically
23
+ - **Git-aware packaging** — use `--git-changes` to package only modified, staged, and untracked files; perfect for incremental debugging and PR review sessions
24
+ - **AI-powered file selection** — describe your task in plain English with `--prompt` and Gemini selects the minimum relevant files automatically, no manual hunting required
25
+ - **Persistent workspace** — all generated ZIPs land in `.contextzip/` at your project root, discoverable, reusable, and git-ignored automatically
26
+ - **Warns before it's a problem** — flags large (≥ 1 MB) and binary files that AI tools can't read, before you waste an upload
27
+ - **Handles edge cases** — dangling symlinks, unreadable files, and paths outside the project tree are caught and reported, never silently dropped
28
+ - **Full CLI control** — `--include`, `--exclude`, `--dry-run`, `--output`, all composable
29
+
30
+ ---
31
+
32
+ ## Installation
33
+
34
+ **Requires Python 3.9+**
35
+
36
+ ```bash
37
+ pip install contextzip
38
+ ```
39
+
40
+ With [pipx](https://pipx.pypa.io/) (recommended for CLI tools — keeps it isolated):
41
+
42
+ ```bash
43
+ pipx install contextzip
44
+ ```
45
+
46
+ Verify:
47
+
48
+ ```bash
49
+ contextzip --version
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Quick start
55
+
56
+ Navigate to any project and run:
57
+
58
+ ```bash
59
+ cd ~/projects/my-app
60
+ contextzip
61
+ ```
62
+
63
+ contextzip will:
64
+
65
+ 1. Detect your framework (e.g. `Next.js + Node.js`)
66
+ 2. Apply the appropriate exclusion rules
67
+ 3. Create a compressed ZIP in `.contextzip/` at your project root
68
+ 4. Open your file manager with the ZIP selected and ready to copy
69
+
70
+ ---
71
+
72
+ ## Usage
73
+
74
+ ```
75
+ contextzip [OPTIONS]
76
+ ```
77
+
78
+ | Option | Description |
79
+ |---|---|
80
+ | `-p`, `--prompt TEXT` | Describe your task in plain English — Gemini selects only the relevant files |
81
+ | `-i`, `--include PATH` | Only include files under this path (repeatable) |
82
+ | `-e`, `--exclude PATTERN` | Add exclusion patterns in gitignore syntax (repeatable) |
83
+ | `--git-changes` | Only include files reported by git as modified, staged, or untracked |
84
+ | `-n`, `--dry-run` | Preview what would be included without creating a ZIP |
85
+ | `-o`, `--output FILE` | Write ZIP to a custom path |
86
+ | `-v`, `--verbose` | Show every included and excluded file with sizes |
87
+ | `--no-clipboard` | Skip the clipboard / folder-open step |
88
+ | `--no-gitignore` | Ignore the project's `.gitignore` |
89
+
90
+ **Subcommands:** `exclude`, `include`, `config` — run `contextzip --help` for full details.
91
+
92
+ ---
93
+
94
+ ## Examples
95
+
96
+ ```bash
97
+ # Preview what would be packaged
98
+ contextzip --dry-run --verbose
99
+
100
+ # Package only specific directories
101
+ contextzip --include src --include app
102
+
103
+ # Exclude additional patterns
104
+ contextzip --exclude "*.log" --exclude "tests/"
105
+
106
+ # Package only git-modified files
107
+ contextzip --git-changes
108
+
109
+ # Let AI pick only the files relevant to your task
110
+ contextzip --prompt "Change toast color on failed login"
111
+
112
+ # Preview AI file selection without creating a ZIP
113
+ contextzip --prompt "Refactor auth middleware" --dry-run
114
+
115
+ # Save to a custom path
116
+ contextzip --output ~/Desktop/project-context.zip
117
+ ```
118
+
119
+ ---
120
+
121
+ ## AI-powered file selection
122
+
123
+ The `--prompt` flag lets you describe a task in plain English. contextzip scans your project, builds a lightweight file map, and asks Gemini to return the minimum set of files needed for that task — typically 2–5, never more than 10. The result is a tightly scoped ZIP with only what you'd actually open to make the change.
124
+
125
+ ```bash
126
+ contextzip --prompt "Change toast color on failed login"
127
+ # → components/ui/toast.tsx, app/login/page.tsx, lib/auth.ts
128
+ ```
129
+
130
+ The ZIP also includes a `prompt.txt` describing the task, so when you drop it into Claude, ChatGPT, or any other AI tool, it immediately understands what you're trying to do.
131
+
132
+ **First-time setup:** `--prompt` requires a free Gemini API key from [Google AI Studio](https://aistudio.google.com/apikey) — no credit card needed. On first use, contextzip guides you through obtaining and saving one. You can also skip the setup entirely with an environment variable:
133
+
134
+ ```bash
135
+ export GEMINI_API_KEY=AIza...
136
+ ```
137
+
138
+ Manage your key at any time:
139
+
140
+ ```bash
141
+ contextzip config # show current key status
142
+ contextzip config --reset-key # clear and re-run setup
143
+ ```
144
+
145
+ ---
146
+
147
+ ## What gets excluded
148
+
149
+ contextzip stacks exclusion rules based on your detected stack, on top of your `.gitignore`.
150
+
151
+ **Always excluded:** `.git/`, `.env` files, logs, caches, editor config (`.vscode/`, `.idea/`), OS files (`.DS_Store`, `Thumbs.db`), and common binary formats.
152
+
153
+ **By framework:**
154
+
155
+ | Stack | Additional exclusions |
156
+ |---|---|
157
+ | Node.js / Next.js | `node_modules/`, `.next/`, `dist/`, `build/`, lock files, `*.min.js`, `*.d.ts` |
158
+ | Python / Django / FastAPI | `__pycache__/`, `.venv/`, `*.pyc`, `migrations/`, `.pytest_cache/`, lock files |
159
+ | Rust | `target/`, `Cargo.lock`, `*.rlib` |
160
+ | Go | `vendor/`, `go.sum`, `bin/` |
161
+
162
+ Detection is additive — a monorepo with both `package.json` and `pyproject.toml` gets both rule sets applied.
163
+
164
+ ---
165
+
166
+ ## Contributing
167
+
168
+ Contributions are welcome — especially new framework rule sets, edge case fixes, and platform-specific clipboard improvements.
169
+
170
+ See [CONTRIBUTING.md](https://github.com/akadeepesh/contextzip/blob/main/CONTRIBUTING.md) for local setup, how to add a new framework, and PR guidelines. Please open an issue before starting a large PR so we can align on the approach first.
171
+
172
+ ---
173
+
174
+ ## License
175
+
176
+ MIT — see [LICENSE](https://github.com/akadeepesh/contextzip/blob/main/LICENSE) for details.
@@ -1,3 +1,3 @@
1
1
  """contextzip — intelligent codebase packager for AI tools."""
2
2
 
3
- __version__ = "0.2.3"
3
+ __version__ = "0.3.0"