Convert Git repositories or local folders into structured documentation, including llms.txt format for LLM context.
- Generates structured Markdown documentation from repositories
- Creates Mermaid diagrams of repository structure
- Produces llms.txt following llmstxt.org format
- Supports both remote Git repositories and local folders
- Handles authentication for private repositories
- Provides detailed repository statistics
# Clone the repository
git clone https://github.com/yourusername/git2md.git
cd git2md
# Basic installation
pip install -r requirements.txt
# For development
pip install -r requirements.txt -r requirements-dev.txt
# Convert a public GitHub repository
python git2md.py https://github.com/username/repo
# Convert a local folder
python git2md.py /path/to/folder
# Using a personal access token
python git2md.py https://github.com/username/private-repo --token YOUR_TOKEN
# Using SSH key
python git2md.py git@github.com:username/private-repo.git --ssh-key ~/.ssh/id_rsa
# Specify output directory
python git2md.py https://github.com/username/repo --output-dir ./docs
The tool generates three files in the output directory:
README.md
- Comprehensive Markdown documentationstructure.mmd
- Mermaid diagram of repository structurellms.txt
- LLM-optimized documentation following llmstxt.org format
- Python 3.7+
- GitPython (optional, for enhanced Git support)
- GitHub CLI (optional, for authentication)
GITHUB_TOKEN
- GitHub personal access token (optional)GIT_SSH_COMMAND
- Custom SSH command (optional)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.