A modern GUI application that helps prepare your codebase for ChatGPT code review by consolidating multiple source files into a single, well-formatted text file.
Created by Waleed Faruki © 2024
- 🎨 Modern, dark-themed interface with tabbed organization
- 📁 Smart file pattern matching for inclusion/exclusion
- 🔍 Real-time pattern preview
- ⚙️ Configurable settings with persistence
- 📝 Custom GPT instructions support
- 🚀 Background processing with progress indication
- 💾 Automatic settings backup and restore
- Ensure you have Python 3.8+ installed
- Install the required dependencies:
pip install ttkbootstrap
- Run the application:
python code_consolidator.py
-
Select your project directory using the "Browse" button
-
Configure file patterns:
- Include Patterns: Specify which files to include (e.g.,
*.py
,*.js
) - Exclude Patterns: Specify which files to exclude (e.g.,
node_modules/*
,*.pyc
)
- Include Patterns: Specify which files to include (e.g.,
-
Write custom instructions for GPT in the instructions text area
-
Set your output file name (defaults to
consolidated_code.txt
) -
Click "Generate Consolidated Code" to create the file
The application uses glob patterns to match files:
-
Include Examples:
*.py
- All Python files*.{js,jsx}
- All JavaScript and JSX filessrc/*.ts
- All TypeScript files in the src directory
-
Exclude Examples:
node_modules/*
- All files in node_modules*.pyc
- All Python compiled files__pycache__/*
- All Python cache files
The application comes with sensible defaults:
*.py
- Python files*.js
- JavaScript files*.jsx
- React JSX files*.ts
- TypeScript files*.tsx
- React TypeScript files*.html
- HTML files*.css
- CSS files*.java
- Java files*.cpp
- C++ files*.h
- Header files*.c
- C files
node_modules/*
- Node.js dependenciesvenv/*
- Python virtual environments*.pyc
- Python compiled files__pycache__/*
- Python cache*.git/*
- Git filesbuild/*
- Build outputsdist/*
- Distribution files
The generated file will have the following structure:
# Your GPT Instructions Here
================================================================================
File: path/to/first/file.py
================================================================================
[Content of first file]
File: path/to/second/file.js
================================================================================
[Content of second file]
...
All settings are automatically saved to consolidator_settings.json
and include:
- Include/exclude patterns
- Default GPT instructions
- Theme preferences
- Use the pattern preview in the Settings tab to verify your file patterns
- Write clear, specific instructions for GPT in the instructions area
- Exclude unnecessary files (like node_modules) to keep the output focused
- Use the progress bar to track large consolidation tasks
- Save your commonly used patterns using the Settings tab
- File not included: Check the Settings tab pattern preview
- Unicode errors: Ensure source files are UTF-8 encoded
- Large files: For very large projects, be specific with include patterns
- Missing files: Verify file permissions and paths
Feel free to submit issues and enhancement requests!
Copyright © 2024 Waleed Faruki. All rights reserved.