4 releases
new 0.1.6 | Mar 24, 2025 |
---|---|
0.1.5 | Mar 24, 2025 |
0.1.4 | Mar 21, 2025 |
0.1.3 | Mar 21, 2025 |
#92 in Machine learning
155 downloads per month
14KB
229 lines
Promptify: Format Plaintext Directories for LLMs
Promptify is a command-line utility that transforms plaintext directories into a format suitable for processing by Large Language Models (LLMs). Key Features:
- Recursive Directory Listing: Promptify traverses directories recursively, ensuring all relevant files are processed.
- Plaintext File Identification: It intelligently identifies plaintext files based on file extensions (.html.twig) and MIME type analysis using the
mime_guess
crate. Supports JSON files as well. - LLM-Friendly Formatting: Files are formatted with code blocks for clear separation and structure, making them readily consumable by LLMs.
Installation
- Clone the repository:
git clone https://github.com/moonstripe/promptify.git
- Build and install the utility:
cd promptify && cargo install --path .
Example Usage:
promptify -d /path/to/directory -p \"This prompt will be applied to the end of the formatted text.\" -e dir_to_exclude,*/**/glob
-d /path/to/directory
: Specifies the directory to process.-p \"This prompt will be applied to the end of the formatted text.\"
: Optionally adds a prompt to the formatted text.-e /dirs,*/to/**,exclude/*
: Optionally specifies the directories to exclude.
How it Works:
- Promptify scans the specified directory and its subdirectories.
- It identifies plaintext files (common programming language extensions,
.html.twig
and MIME typetext/plain
) and JSON files. - Each file's content is read and formatted within code blocks, along with an optional prompt if requested.
Contributing: Feel free to contribute to Promptify by reporting bugs,suggesting improvements, or expanding its capabilities.
License: This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
~1.2–8MB
~54K SLoC