Flatten GitHub repositories into single, searchable HTML pages
CodeCrush is a powerful tool that transforms any GitHub repository into a beautiful, interactive HTML page with syntax highlighting, search functionality, and both human-readable and LLM-optimized views.
- π¨ Beautiful UI - Modern, responsive design with GitHub-inspired styling
- π Advanced Search - Search through filenames and file content with real-time highlighting
- π» Syntax Highlighting - Powered by Pygments for 200+ languages
- π± Mobile Friendly - Responsive design that works on all devices
- π€ LLM Ready - Includes CXML format view optimized for AI analysis
- π Copy & Fold - Easy code copying and collapsing for large files
- β¨οΈ Keyboard Shortcuts - Fast navigation with keyboard controls
- π Offline Browsing - Self-contained HTML files work without internet
- Python 3.10+
- Git
pip install markdown pygmentspython3 main.py https://github.com/username/repositoryThis will:
- Clone the repository to a temporary directory
- Analyze all files and generate an HTML page
- Automatically open the result in your browser
python3 main.py [OPTIONS] REPO_URL
Options:
-h, --help Show help message
-o, --out PATH Output HTML file path (default: temp file)
--max-bytes SIZE Max file size to render in bytes (default: 100KB)
--no-open Don't open HTML file in browser after generation# Basic usage
python3 main.py https://github.com/torvalds/linux
# Save to specific file
python3 main.py https://github.com/facebook/react -o react_analysis.html
# Process larger files and don't open browser
python3 main.py https://github.com/microsoft/vscode --max-bytes 500000 --no-open
# Analyze your own repository
python3 main.py https://github.com/yourusername/yourproject- Code Reviews - Get a complete overview of a project in one page
- Project Analysis - Understand repository structure and content quickly
- Documentation - Create offline snapshots of codebases
- Learning - Study well-structured open source projects
- Code Analysis - Feed entire repositories to AI models using the CXML format
- Documentation Generation - Create AI-powered documentation from codebases
- Code Understanding - Help AI models understand project context and structure
- Onboarding - Help new team members understand project structure
- Knowledge Sharing - Share code overviews without requiring repository access
- Presentations - Create visual representations of codebases for meetings
- Sidebar Navigation - File tree with search functionality
- Directory Tree - Visual representation of project structure
- Syntax Highlighted Code - All supported languages beautifully formatted
- File Statistics - Size information and processing details
- Interactive Elements - Copy buttons, code folding, smooth scrolling
- CXML Format - Structured XML format optimized for AI consumption
- Easy Copying - One-click copy for pasting into AI tools
- Complete Context - All files in a single, parseable format
- Real-time Search - Instant filtering as you type
- Content Search - Search within file contents, not just filenames
- Highlighting - Search terms highlighted in yellow
- Keyboard Shortcuts -
Ctrl+Fto focus,ESCto clear
Ctrl+F/Cmd+F- Focus search boxCtrl+1/Cmd+1- Switch to Human viewCtrl+2/Cmd+2- Switch to LLM viewESC- Clear search and unfocus
- Clone - Repository is cloned to a temporary directory
- Analyze - Files are scanned and categorized
- Filter - Binary files and oversized files are skipped
- Process - Text files are syntax highlighted, Markdown is rendered
- Generate - Single HTML file is created with embedded CSS/JS
- Cleanup - Temporary files are automatically removed
- β Included: Text files, source code, documentation
- β Skipped: Binary files (images, executables, archives)
- β Skipped: Files larger than
--max-bytes(default 100KB) - β Skipped:
.gitdirectories and VCS files
CodeCrush processes and displays:
- Source Code - All programming languages with syntax highlighting
- Documentation - Markdown files rendered as HTML
- Configuration - JSON, YAML, TOML, XML files
- Scripts - Shell scripts, batch files, etc.
- Data Files - CSV, text files, logs (within size limits)
Thanks to Pygments, CodeCrush supports syntax highlighting for 200+ languages including:
- Popular Languages: Python, JavaScript, TypeScript, Java, C++, C#, Go, Rust
- Web Technologies: HTML, CSS, SCSS, React JSX, Vue
- Data Formats: JSON, YAML, XML, SQL, GraphQL
- DevOps: Dockerfile, Kubernetes YAML, Terraform
- And many more...
CodeCrush automatically detects and handles:
- Multiple programming languages in one repository
- Mixed documentation formats
- Large repositories (with smart filtering)
- Complex directory structures
- Files larger than the size limit are listed but not processed
- Binary files are automatically detected and skipped
- Git history and metadata are ignored
- Efficient processing for repositories with thousands of files
Adjust the maximum file size to process:
python3 main.py https://github.com/repo --max-bytes 1048576 # 1MB# Don't open browser automatically
python3 main.py https://github.com/repo --no-open
# Specify output location
python3 main.py https://github.com/repo -o /path/to/output.htmlWe welcome contributions! Here are some ways you can help:
- π Bug Reports - Found an issue? Please report it
- π‘ Feature Requests - Have an idea? We'd love to hear it
- π§ Code Contributions - Submit pull requests for improvements
- π Documentation - Help improve our docs
- Python: 3.10 or higher
- Dependencies:
markdown,pygments - System: Git must be installed and available in PATH
- Memory: Sufficient RAM for repository size (typically minimal)
Repository clone fails
- Ensure the repository URL is correct and accessible
- Check internet connection
- Verify Git is installed:
git --version
Large repositories are slow
- Use
--max-bytesto limit file processing - Consider focusing on specific directories if possible
Missing syntax highlighting
- Ensure
pygmentsis installed:pip install pygments - Check if your file extension is supported
Browser doesn't open
- Use
--no-openflag and manually open the HTML file - Check your system's default browser settings
MIT License - see LICENSE file for details
- Pygments - For excellent syntax highlighting
- Python Markdown - For Markdown processing
- GitHub - For hosting amazing open source projects to analyze
- Repository: https://github.com/deepmonapara9/codecrush
- Issues: https://github.com/deepmonapara9/codecrush/issues
- Author: Deep Monapara
Made with β€οΈ for developers who love exploring code