A simple GUI tool to collect code files (from selected files and/or folders), merge them into a clean Markdown document (with syntax highlighting), and copy the result to the clipboard for quick prompt engineering, documentation, or code review purposes.
- Select multiple folders and files; scans folders recursively
- Supports many code/text formats (
.py,.js,.java,.md,.txt, etc.) - Outputs a well-formatted Markdown file with syntax-highlighted code blocks and relative file paths
- Optional custom prompt/instruction to preface the code in the document
- Outputs to your Desktop by default (configurable)
- Copies the resulting Markdown directly to your clipboard (requires pyperclip)
- Works on Windows, macOS, and Linux
-
Clone or Download:
git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name -
Install Dependencies:
pip install pyperclip
pyperclipis optional but highly recommended for clipboard copying to work. -
(Optional, Linux only)
For clipboard copy on Linux, you may needxcliporxsel:sudo apt-get install xclip # or sudo apt-get install xsel
-
Run the program:
python CodePromptGenerator.py
-
Use the graphical interface:
- Add Files/Folders: Select your source code (folders can be recursive).
- Enter Custom Prompt: Optionally, enter a custom instruction to add atop the Markdown file.
- Set Output Destination: Choose where to save the Markdown file (optional; defaults to Desktop).
- Generate: Click Generate Markdown & Copy to Clipboard.
-
After generating:
- The Markdown is saved to your chosen location.
- The content is copied to your clipboard (if supported).
- You get a summary box confirming success.
- Python, JavaScript, Java, TypeScript, HTML, CSS, XML, Bash, Ruby, Go, C/C++, C#, Swift, PHP, Markdown, Text, JSON, YAML, SQL, R, Perl, and more.
- Python 3.7+
- Tkinter (usually included with Python)
- pyperclip (
pip install pyperclip)
- The app only processes files with recognized code or text extensions.
- File and folder selections are de-duplicated.
- On first launch, output defaults to your Desktop. You can change the path.
- For large projects, output can be hundreds of code blocks if many files are chosen.
GNU License. See LICENSE for details.
Made with ❤️ for faster code documentation and prompt engineering.
