| Crates.io | codepack |
| lib.rs | codepack |
| version | 0.11.7 |
| created_at | 2024-11-16 01:59:16.561434+00 |
| updated_at | 2025-10-26 03:58:45.431039+00 |
| description | A *lightning-fast* tool that transforms a directory into a single, LLM-friendly text file, perfect for easy processing and analysis. |
| homepage | https://codepack.jasoncameron.dev |
| repository | https://github.com/JasonLovesDoggo/codepack |
| max_upload_size | |
| id | 1449812 |
| size | 93,904 |
codepackcodepack transforms directories into LLM-friendly text files.
A lightning-fast tool that converts the contents of a directory into a single, LLM-friendly text file, making it easy to process and analyze data with Large Language Models.
For detailed installation instructions, please visit the Codepack documentation.
Alternatively, you can follow the instructions below to install codepack.
Please see the documentation
Alternatively, you can install codepack from source with Rust's package manager cargo:
cargo install codepack
This will download, build, and install the latest version of codepack.
Once installed, simply run:
codepack /path/to/directory
By default, codepack will process the directory and output a .txt file with the contents of the files inside the directory. If you don't specify an output file, it will generate one based on the directory name and the number of files processed.
codepack is optimized for speed, ensuring that even large directories are processed efficiently.-o option, or let codepack generate one for you.-e or --extension flag to include specific file types (e.g., .rs, .toml).-x or --excluded-files flag (e.g., .lock files, node_modules/).--suppress-prompt option.-f or --filter option.Codepack supports three types of filters:
Example:
codepack -f "file.name=main.py" /path/to/project(includes only files named "main.py")
Example:
codepack -f "path.contains=src" .(includes only files within the "src" directory and its subdirectories)
Note: Content filters are applied after the file has been read, so this can be slower than other filter types.
Example:
codepack -f "content.contains=function" /path/to/code(includes only files containing the word "function")
You can combine multiple filters using multiple -f or --filter options. Codepack uses OR logic for filtering, so a file will be included if it matches any of the provided filters.
codepack [OPTIONS] <DIRECTORY_PATH>
Options:
-o, --output <OUTPUT> Output file path (optional)
-e, --extension <EXTENSIONS> File extensions to include (e.g., -e rs -e toml)
-x, --excluded-files <FILES> Files to exclude by name/pattern (e.g., -x *.lock -x node_modules/)
-f, --filter <FILTERS> Filter files by name, path, or content (e.g., -f "file.name=main.rs")
--suppress-prompt Suppress the output prompt
-h, --help Print help
-V, --version Print version
Convert a directory to a .txt file with a custom output name:
codepack /path/to/my/code -o my_code.txt
Process only .rs and .toml files from a directory:
codepack /path/to/my/code -e rs -e toml
Exclude lock files and node_modules:
codepack /path/to/my/code -x "*.lock" -x "node_modules/"
We welcome contributions to codepack! Please feel free to submit issues or pull requests on GitHub.
codepack is distributed under the terms of the GPL-3.0 License. See the LICENSE file for details.