A tool to copy multiple files into the clipboard for efficient use with chatGPT.
Project description
code-zipper
code-zipper is a command-line tool designed to copy multiple files and directories directly to your clipboard. Perfect for efficiently pasting code or text into ChatGPT!
Features
- Multiple Input Support: Accepts files, directories, or glob patterns.
- Structured Output: Adds line numbers, file names, and sizes.
- Clipboard Integration: Aggregates content for instant pasting.
- Minimal Dependencies: Only uses two external libraries.
Installation
Install via pip:
pip install code-zipper
Ensure Python and pip are installed on your system.
The tool is tested and supported for Python 3.10 and above.
Usage
Once installed, run code-zipper from the command line
with desired paths or patterns:
code-zipper <file1> <folder2> <glob-pattern3>
Note that if you are passing just a folder, the tool with recursively
copy all *.py files within that directory.
This is handy if you want to copy all Python files in a project
like code-zipper src.
Example:
code-zipper src *.md tests/util/*.py
Explanation:
srcCopies every*.pyfile from the “src” folder (and any subfolders).*.mdMatches all files ending with.mdin the current directory.tests/util/*.pyMatches only the.pyfiles immediately within thetests/utildirectory (subdirectories are not included).
For copying files from nested folders, use the folder name without a glob pattern.
How It Works:
- Input: Provide a list of file paths, directories, or glob patterns.
- Processing: Reads each file, concatenating contents while maintaining structure.
- Output: Copies the combined result to your clipboard, ready for pasting.
Copied clipboard text will look like the following,
which can be reproduced using
code-zipper src/cli.py after having cloned the repo:
File: src/cli.py (84 lines and 2,015 chars)
1 | """
2 | A CLI tool that reads folders of code and copies it to the clipboard.
3 | """
4 |
5 | import argparse
6 | import logging
< ... more code >
82 |
83 | if __name__ == "__main__":
84 | main()
Line numbers, file paths and sizes will help chatGPT better navigate your code base and provide more accurate responses.
FAQ
How do I install code-zipper?
Install using pip as shown above.
Ensure you have a working Python 3.10 (or higher) environment.
Are there any file type restrictions?
code-zipper works best with text-based files. Binary files might not display correctly when pasted.
Where can I report issues, suggest new features or contribute?
Issues, feature suggestions or improvements are very welcome! For any of those, open a new GitHub issue, describe the problem or feature request, and we'll take it from there.
License
Distributed under the MIT License. See the LICENSE file for more details.
Happy coding!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_zipper-0.1.3.tar.gz.
File metadata
- Download URL: code_zipper-0.1.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
430cccfd25547c76b294a22eb8eeea2fdc19a54c1f48c9c3c1077f64ccbba46b
|
|
| MD5 |
4df0066343dbd7ed9beba115119c285d
|
|
| BLAKE2b-256 |
2ee47f7326fac3fd2544d62e076d8343b0bf365946caf191bccc264d78724ffc
|
File details
Details for the file code_zipper-0.1.3-py3-none-any.whl.
File metadata
- Download URL: code_zipper-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78990c1b3edc28411e735fcd89268a87e982a61140944497ae62a64eb0e84de3
|
|
| MD5 |
3258b0fee158377107bef3404719f556
|
|
| BLAKE2b-256 |
5cefb152275d969f04bdf213dcdbccc9ac06f45d305096c0dc3a347b2f463db1
|