#text-file #file-processing #directory #single #transform #txt-file #convert

bin+lib codepack

A *lightning-fast* tool that transforms a directory into a single, LLM-friendly text file, perfect for easy processing and analysis

4 releases

0.8.1 Nov 16, 2024
0.6.6 Nov 16, 2024
0.6.3 Nov 16, 2024
0.6.0 Nov 16, 2024

#438 in Text processing

Download history 251/week @ 2024-11-11 52/week @ 2024-11-18 3/week @ 2024-11-25 5/week @ 2024-12-09

111 downloads per month

MIT license

23KB
176 lines

codepack

crates.io Web Release

codepack 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.

Installation

For detailed installation instructions, please visit the Codepack documentation.

Alternatively, you can follow the instructions below to install codepack.

Please see the documentation

Installation via Cargo (Optional)

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.

Quickstart

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.

Features

  • Lightning Fast: codepack is optimized for speed, ensuring that even large directories are processed efficiently.
  • Customizable Output: Specify the output file name with the -o option, or let codepack generate one for you.
  • Selective File Processing: Use the -e or --extension flag to include specific file types (e.g., .rs, .toml).
  • Suppress Output Prompt: If you don’t want the default prompt in your output file, use the --suppress-prompt option.

Usage

codepack [OPTIONS] <DIRECTORY_PATH>

Convert local directory contents into a single text file, useful for processing by an LLM.

Options:
-h, --help              Show this message
-e, --extension <EXT>   Include files with the specified extension(s) (e.g., -e rs -e toml)
-o, --output <OUTPUT>   Specify the output file path (optional)
-s, --suppress-prompt   Suppress the description of the file format in the output

Examples 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

Contributing

We welcome contributions to codepack! Please feel free to submit issues or pull requests on GitHub.

License

codepack is distributed under the terms of the GPL-3.0 License. See the LICENSE file for details.

Dependencies

~9–18MB
~226K SLoC