CodeDevour is a powerful web-based tool for exploring project structure, bundling code files, and managing file exclusions through an intuitive interface. Transform any codebase into a single, well-organized document perfect for documentation, code review, AI analysis, or academic purposes.
- Visual file tree with lazy-loading folder sizes
- Drag-and-drop exclusion β drag files/folders directly into the exclusion list
- Real-time activity log tracking all operations
- Native folder picker for easy path selection
- Automatic file merging with customizable whitelist (30+ file extensions supported)
- Binary detection to skip non-text files automatically
- Size limits (2MB per file) to prevent performance issues
- Blank-line removal option for cleaner output
- Streaming output for large projects without memory issues
- Token counting with
tiktokenintegration for AI model compatibility
- Whitelist/Blacklist system via
exclude_me.txt - Automatic
.gitignoresync β patterns are merged into exclusions - Path-based filtering for precise control
- Smart exclusion matching by name or relative path
- Word count Β· Token count Β· Line count Β· File size
- Lazy folder size calculation for performance
- Live output statistics updating as files are processed
- Tab navigation (NamesExtractor / TextExtractor / Exclusions / Activity Log)
- TailwindCSS design with crimson theme
- Responsive layout for all screen sizes
- Native system dialogs for file operations
| Component | Technology |
|---|---|
| Backend | Python 3.8+, Flask |
| Frontend | HTML5, JavaScript, TailwindCSS |
| Parsing | tiktoken (OpenAI tokenizer) |
| Config | JSON-based configuration |
| Output | Plain text bundled files |
codedevour/
βββ server/
β βββ routes/ # API endpoints (text, names, lists, config)
β βββ services/ # Business logic (metrics, cleaners, gitignore sync)
β βββ extractors/ # Core extraction logic
β βββ templates/ # HTML templates
β βββ app.py # Flask application entry point
βββ static/ # CSS, JS, and assets
βββ config.json # Configuration file
βββ exclude_me.txt # File exclusion list
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Python 3.8 or higher (Windows, Linux, or macOS)
- Git (optional, for cloning)
# Clone the repository
git clone https://github.com/Anwitch/codedevour.git
cd codedevourOr download the ZIP file from GitHub and extract it.
Windows:
# Create virtual environment
python -m venv venv
# Activate it
venv\Scripts\activateLinux/macOS:
# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate# Install required packages
pip install -r requirements.txtThis will install:
- Flask (web framework)
- tiktoken (token counting)
- Other necessary dependencies
# Double-click or run from terminal
scripts\run_app.batThe application will automatically open in your default browser at http://127.0.0.1:5000
If it doesn't open automatically, manually navigate to that URL.
Note for Windows users: The batch script automatically activates your virtual environment and runs the app.
- Launch the application by running
scripts\run_app.bat - Open your browser to
http://127.0.0.1:5000 - You'll see four main tabs: NamesExtractor, TextExtractor, Exclude Me, and Activity Log
- Enter the path to your project in the "Project Path" field
- Click "Pick Folder..." to use a native folder picker (recommended)
- Or click "Set Path" after typing the path manually
- The system will automatically sync patterns from
.gitignoreinto your exclusion list
Purpose: View your project's file tree with sizes and statistics
- Navigate to the NamesExtractor tab
- Choose options:
- βοΈ Include files β Show individual files (not just folders)
- βοΈ Include sizes β Display file/folder sizes (calculated lazily)
- Click "Run NamesExtractor.py"
- Expand folders to explore β sizes are calculated on-demand
- Drag items from the tree into the "Exclude Me" tab to exclude them
Tip: Folder sizes appear when you expand them, keeping the initial load fast!
Purpose: Merge all code files into a single text file
- Navigate to the TextExtractor tab
- Configure output:
- Output Folder β Where to save the bundled file (will prompt if empty)
- File Name β Name for the output file (default:
Output.txt)
- Options:
- βοΈ Remove empty lines β Clean up blank lines in the output
- Click "Run TextEXtractor.py"
- Watch the streaming output in the right panel
- See real-time metrics (words Β· tokens Β· lines Β· bytes) in the badge
What gets bundled?
- Text-based files with supported extensions
- Files under 2MB in size
- Files not in your exclusion list
- Non-binary files only
Supported file types:
.py .js .ts .tsx .jsx .json .md .txt .html .css .yml .yaml .toml .ini .cfg .sql .sh .bat .ps1 .c .cpp .h .hpp .java .kt .go .rs .vue .xml
Purpose: Control which files/folders to skip during bundling
- View/Edit the exclusion list in the Exclude Me tab
- Add items by:
- Dragging from the file tree
- Typing names or patterns (one per line)
- Save your changes
- Automatic sync from
.gitignorewhen you set a new path
How exclusions work:
- Files/folders are excluded if their name or path contains any exclusion pattern
.gitignorepatterns are automatically imported under# === PATTERNS FROM .gitignore ===- Manual patterns are preserved above the
.gitignoresection
- View real-time logs of all operations
- See timestamps for each action
- Track errors and success messages
- Monitor processing progress
{
"TARGET_FOLDER": "C:/Users/You/YourProject",
"NAME_OUTPUT_FILE": "OutputAllNames.txt",
"OUTPUT_FILE": "Output.txt",
"EXCLUDE_FILE_PATH": "exclude_me.txt"
}Configuration Options:
TARGET_FOLDERβ The project directory to analyzeOUTPUT_FILEβ Output file path (can be changed from UI)NAME_OUTPUT_FILEβ File list output pathEXCLUDE_FILE_PATHβ Path to exclusion list file
The
OUTPUT_FILEcan be changed on-the-fly from the UI and will be automatically persisted toconfig.json.
- Maximum file size: 2 MB per file
- Binary detection: Files with >30% non-text characters are automatically skipped
- Sample size: 4096 bytes for binary detection
- Items are excluded if their name or relative path contains any pattern from
exclude_me.txt - Matching is case-sensitive
- Patterns use substring matching (not regex)
| Method | Path | Description |
|---|---|---|
POST |
/set_path |
Set project path and sync .gitignore patterns |
GET |
/pick_folder |
Open native folder picker for project path |
GET |
/pick_output_folder |
Open native folder picker for output destination |
GET |
/config_summary |
Get current configuration for UI |
GET |
/size?path=... |
Calculate file/folder size (lazy loading) |
POST |
/run_nameextractor_json |
Generate file tree as JSON (fast, no intermediate file) |
POST |
/run_nameextractor |
Legacy mode β writes to OutputAllNames.txt |
POST |
/run_textextractor |
Bundle files with streaming output |
GET |
/manage_exclude_file |
Read exclude_me.txt content |
POST |
/manage_exclude_file |
Save exclude_me.txt content |
GET |
/output_metrics |
Get output statistics (words, tokens, lines, chars, bytes) |
"Path is invalid or not found"
- Use the "Pick Folder..." button to avoid typos
- Ensure you have read permissions for the directory
- Check that the path exists and is accessible
"Output folder required"
- Specify an output directory in the TextExtractor tab
- Or let the UI prompt you when running TextExtractor
- Ensure you have write permissions for the output location
Folder sizes not appearing in NamesExtractor
- Folder sizes are calculated on-demand when you expand them
- Check browser's Network tab for any failed requests to
/size?path=... - Ensure the target folder is accessible
Token count looks approximate
- Without
tiktokeninstalled, counts are estimated usingchars/4 - Install tiktoken for accurate token counting:
pip install tiktoken
Windows: Output file appears locked
- Close any text editor or application holding
Output.txt - Ensure no other process is accessing the file
- Try running TextExtractor again
Large projects taking too long
- Use the exclusion list to filter out unnecessary directories (e.g.,
node_modules,.git) - Enable
.gitignoresync to automatically exclude common patterns - Consider processing subdirectories separately
- Code review β Bundle entire features for review
- Documentation β Generate snapshots of codebase state
- Backup β Create portable text versions of projects
- Refactoring β Analyze project structure before major changes
- Model training β Prepare code datasets
- Token counting β Calculate context window requirements
- Code analysis β Feed codebases to LLMs for analysis
- Assignment submission β Bundle projects in readable format
- Project documentation β Generate comprehensive project overviews
- Code study β Create study materials from open-source projects
- Knowledge sharing β Share project structure with new team members
- Onboarding β Provide comprehensive project overviews
- Audit trails β Snapshot codebases at specific points in time
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature - Open a Pull Request with a clear description
# Clone your fork
git clone https://github.com/YOUR_USERNAME/codedevour.git
cd codedevour
# Set up virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/macOS
# Install in development mode
pip install -r requirements.txt
pip install -e .
# Run tests (if available)
python -m pytest
# Start development server
scripts\run_app.batMIT License β See LICENSE file for details.
- Built with Flask
- Styled with TailwindCSS
- Token counting powered by tiktoken
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Author: @Anwitch
Made with β€οΈ by Anwitch Β· CodeDevour
Star this repo if you find it useful! β