A fast and efficient Rust CLI tool to export GitHub repositories to Markdown format.
Perfect for documentation, archiving, or analyzing repository contents offline.
- Multiple Input Methods: Accept GitHub URLs, owner/repo format, or interactive input
- Smart Filtering: Automatically excludes binary files, build artifacts, and common ignored paths
- Progress Tracking: Real-time progress indicators for large repositories
- Rate Limit Handling: Intelligent handling of GitHub API rate limits
- Error Recovery: Robust error handling with retry logic
- Markdown Export: Clean, readable Markdown output with syntax highlighting support
- Rust 1.70+ (install from rustup.rs)
- GitHub Personal Access Token (for private repos or higher rate limits)
git clone https://github.com/tidynest/repo_exporter.git
cd repo_exporter
cargo build --releaseThe binary will be available at target/release/repo_exporter
cargo install --git https://github.com/tidynest/repo_exporter.gitSet your GitHub token as an environment variable:
export GITHUB_TOKEN="your_github_token_here"Or create a .env file in the project directory:
GITHUB_TOKEN=your_github_token_here
Run the tool:
cargo run
# or if installed
repo_exporterThe tool offers three ways to specify a repository:
-
Full GitHub URL
https://github.com/tidynest/security_toolkit -
Owner/Repository Format
tidynest/security_toolkit -
Interactive Input
- Enter username/organization separately
- Then enter repository name
The tool generates a Markdown file with the format:
{repo_name}_repo_export_{timestamp}.md
Example: security_toolkit_repo_export_20250822_200405.md
- Source code files (.rs, .py, .js, .java, etc.)
- Configuration files (Cargo.toml, package.json, etc.)
- Documentation (README, LICENSE, etc.)
- Scripts and text files
- Binary files and executables
- Build directories (target/, node_modules/, dist/)
- Version control (.git/)
- Large files (>1MB)
- System files (.DS_Store, Thumbs.db)
- Documentation: Create offline documentation of repository structure
- Code Review: Export repos for offline code review
- Archiving: Create snapshots of repositories at specific points in time
- Analysis: Prepare repositories for AI/ML analysis
- Teaching: Share complete repository contents in a single file
repo_exporter/
├── src/
│ ├── main.rs # Application entry point
│ ├── lib.rs # Library exports
│ ├── config.rs # Configuration management
│ ├── utils.rs # Utility functions
│ ├── github/ # GitHub API integration
│ │ ├── client.rs # API client implementation
│ │ └── types.rs # API response types
│ ├── input/ # Input handling
│ │ └── parser.rs # Repository input parsing
│ ├── ui/ # User interface
│ │ └── menu.rs # Interactive menu system
│ └── export/ # Export functionality
│ └── markdown.rs # Markdown export implementation
├── Cargo.toml # Dependencies and metadata
├── .env.example # Example environment configuration
├── .gitignore # Git ignore rules
├── LICENSE # MIT License
└── README.md # Project documentation
reqwest- HTTP client for GitHub APItokio- Async runtimebase64- Decode file contents from GitHub APIchrono- Timestamp generationdotenvy- Environment variable managementserde- JSON deserialization
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Processes repositories with thousands of files efficiently
- Implements concurrent file fetching with rate limit respect
- Memory-efficient streaming for large files
- Automatic retry on transient failures
- Never stores or logs your GitHub token
- Validates all user inputs
- Sanitizes file paths and names
- Respects GitHub API rate limits
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rust 🦀
- Uses the GitHub REST API v3
- Inspired by the need for better repository documentation tools
Author: Hans Eric Luiz Jingryd
GitHub: @tidynest
Email: tidynest@proton.me
⭐ If you find this tool useful, please consider giving it a star on GitHub!