# Repo2AI
[](https://github.com/georghildebrand/Repo2Markdown/actions/workflows/ci.yml)
[](https://github.com/georghildebrand/Repo2Markdown/actions/workflows/docs.yml)
[](https://github.com/georghildebrand/Repo2Markdown)
Export Git repository contents to structured Markdown with **AI Chat Integration**. Perfect for code analysis, documentation, and getting AI assistance with your projects.
## π Quick Start
```bash
# Install from source (no PyPI package yet)
git clone https://github.com/georghildebrand/Repo2Markdown.git
cd Repo2Markdown
make install
# Basic export
poetry run repo2ai .
# Copy to clipboard and open ChatGPT
poetry run repo2ai . --open-chat chatgpt
# Open Claude with a specific prompt
poetry run repo2ai . --open-chat claude --prompt "Please analyze this codebase and suggest improvements"
# Try all AI services with a prompt
poetry run repo2ai . --chat-all --prompt "Review this repository structure"
```
## β¨ Features
- **π Smart Repository Scanning** - Respects .gitignore, filters binary files, handles large codebases
- **π€ AI Chat Integration** - Automatic browser integration with ChatGPT, Claude, and Gemini
- **π Multiple Output Options** - File, clipboard, stdout, or combinations
- **π― Intelligent Filtering** - Configurable ignore patterns, file size limits, meta file handling
- **π Language Detection** - Syntax highlighting for 25+ programming languages
- **β‘ Git Integration** - Only includes tracked files, respects Git ignore patterns
## π€ AI Chat Integration
repo2ai now supports automatic browser integration with popular AI services, making it easy to share your repository with AI assistants for code analysis, review, and assistance.
### Quick Start with AI Chat
```bash
# Copy repo to clipboard and open ChatGPT
poetry run repo2ai . --open-chat chatgpt
# Open Claude with a specific prompt
poetry run repo2ai . --open-chat claude --prompt "Please analyze this codebase and suggest improvements"
# Try all AI services with a prompt
poetry run repo2ai . --chat-all --prompt "Review this repository structure"
# Use specific browser
poetry run repo2ai . --open-chat chatgpt --browser firefox
```
### AI Chat Options
```
--open-chat SERVICE Open specific AI service (chatgpt, claude, gemini)
--chat-all Try to open all available AI services
--prompt TEXT Initial prompt to use with the AI service
--browser BROWSER Browser to use (default, chrome, firefox, safari, edge)
```
### Supported AI Services
- **ChatGPT** (`chatgpt`) - OpenAI's ChatGPT at chat.openai.com
- **Claude** (`claude`) - Anthropic's Claude at claude.ai
- **Gemini** (`gemini`) - Google's Gemini at gemini.google.com
### How It Works
1. **Repository Export**: Scans and exports your repository to markdown
2. **Clipboard Copy**: Automatically copies the content to your clipboard
3. **Browser Launch**: Opens the specified AI service in a new browser tab
4. **Instructions**: Shows helpful instructions for pasting content and adding your prompt
## π Usage Examples
### Basic Export
```bash
poetry run repo2ai . # Export current directory to stdout
poetry run repo2ai ./project --output docs.md # Export to file
poetry run repo2ai . --clipboard # Copy to clipboard
```
### AI Chat Integration
```bash
# Code Analysis
poetry run repo2ai . --open-chat claude --prompt "Analyze this code for potential security vulnerabilities"
# Architecture Review
poetry run repo2ai . --open-chat chatgpt --prompt "Review the architecture and suggest improvements"
# Documentation Help
poetry run repo2ai . --open-chat gemini --prompt "Help me write better documentation for this project"
# Quick Questions
poetry run repo2ai . --chat-all --prompt "Where are logs written in this application?"
```
### Advanced Filtering
```bash
# Exclude sensitive files when sharing with AI
poetry run repo2ai . --open-chat claude --ignore "*.env" --ignore "secrets/*" --prompt "Review this code"
# Large repositories with size limits
poetry run repo2ai . --max-file-size 50000 --exclude-meta-files
# Custom ignore patterns
poetry run repo2ai . --ignore "*.log" --ignore "temp/*" --ignore "*.tmp"
```
## π οΈ Installation
> **Note**: This project is currently in development. No PyPI package is available yet.
### From Source (Current Method)
```bash
git clone https://github.com/georghildebrand/Repo2Markdown.git
cd Repo2Markdown
make install
# Run with poetry
poetry run repo2ai --help
```
### Development Setup
```bash
git clone https://github.com/georghildebrand/Repo2Markdown.git
cd Repo2Markdown
make setup # Complete development environment
```
### Future PyPI Installation (Planned)
```bash
# Will be available after first release
pip install repo2ai
```
## π CLI Options
### Basic Options
```
positional arguments:
path Path to repository (default: current directory)
output options:
--output, -o Output file path
--clipboard, -c Copy output to clipboard
--stdout, -s Output to stdout (default if no other output specified)
```
### AI Chat Options
```
AI chat options:
--open-chat Open specific AI service (chatgpt, claude, gemini)
--chat-all Try to open all available AI services
--prompt Initial prompt to send with the repo content
--browser Browser to use (default, chrome, firefox, safari, edge)
```
### Filtering Options
```
filtering options:
--ignore Additional ignore patterns (can be used multiple times)
--exclude-meta-files Exclude meta files like .gitignore, README, LICENSE
--max-file-size Maximum file size in bytes (default: 1MB)
--include-meta Include specific meta files (overrides --exclude-meta-files)
--exclude-meta Exclude specific meta files
-v, --verbose Show lists of all files included and ignored
```
## ποΈ Architecture
The project follows a clean, modular architecture with clear separation of concerns:
### System Overview
```
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β Developer βββββΆβ Repo2md CLI βββββΆβ AI Services β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
βΌ
ββββββββββββββββ
β Git Repositoryβ
ββββββββββββββββ
```
### Core Modules
- **CLI Module**: Command-line interface with argument parsing and validation
- **Core Module**: Repository scanning, filtering, and Markdown generation
- **Output Module**: File writing, clipboard integration, stdout handling
- **Browser Module**: AI chat integration and browser automation
### Architecture Diagrams
The project includes comprehensive C4 model diagrams:
- **System Context**: High-level system interactions
- **Container Diagram**: Internal module architecture
- **Component Diagram**: Detailed component relationships
- **Development Workflow**: Development and CI/CD processes
Generate diagrams with: `make docs`
## π§ Development
### Prerequisites
- Python 3.11+
- Poetry for dependency management
- Make for task automation
- PlantUML for diagram generation (optional)
### Development Workflow
1. **Setup Development Environment**
```bash
git clone https://github.com/georghildebrand/Repo2Markdown.git
cd Repo2Markdown
make setup # Install dependencies + dev tools
```
2. **Development Tasks**
```bash
make format # Format code with Black
make lint # Run linting (flake8 + mypy)
make test # Run tests
make test-cov # Run tests with coverage
```
3. **Quality Assurance**
```bash
make ci # Run all CI checks locally
make all # Complete pipeline (format + lint + test + docs + build)
```
4. **Documentation**
```bash
make docs # Render PlantUML diagrams
```
5. **Testing & Demo**
```bash
make run # Demo on current directory
make demo # Feature demonstration
make run-chat # Test AI integration
```
### Available Make Targets
| Target | Description |
|--------|-------------|
| `make setup` | Complete development environment setup |
| `make install` | Install dependencies only |
| `make format` | Format code with Black |
| `make lint` | Run linting (flake8 + mypy) |
| `make test` | Run tests |
| `make test-cov` | Run tests with coverage |
| `make docs` | Render PlantUML diagrams |
| `make ci` | Run CI checks locally |
| `make all` | Complete pipeline |
| `make clean` | Clean build artifacts |
### Code Quality Standards
- **Code Formatting**: Black with 180 character line length
- **Linting**: Flake8 for PEP8 compliance
- **Type Checking**: MyPy with strict settings
- **Testing**: Pytest with high coverage requirements
- **Documentation**: Comprehensive docstrings and architecture diagrams
## π€ Contributing
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Make your changes and add tests
4. Run quality checks: `make ci`
5. Commit your changes: `git commit -m 'Add amazing feature'`
6. Push to the branch: `git push origin feature/amazing-feature`
7. Open a Pull Request
### Contribution Guidelines
- Follow the existing code style (enforced by Black)
- Add tests for new functionality
- Update documentation for user-facing changes
- Ensure all CI checks pass
- Update architecture diagrams if adding new modules
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π Acknowledgments
- **PlantUML** for architecture diagram generation
- **Poetry** for excellent dependency management
- **GitHub Actions** for robust CI/CD
- **AI Services** (OpenAI, Anthropic, Google) for making code analysis accessible
## π Links
- [GitHub Repository](https://github.com/georghildebrand/Repo2Markdown)
- [Documentation](https://github.com/georghildebrand/Repo2Markdown/tree/main/docs)
- [Architecture Diagrams](https://github.com/georghildebrand/Repo2Markdown/tree/main/docs/images)
- [PyPI Package](https://pypi.org/project/repo2ai/) *(Coming Soon)*
Raw data
{
"_id": null,
"home_page": "https://github.com/georghildebrand/Repo2Markdown",
"name": "repo2ai",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "markdown, documentation, git, repository, export, ai-chat",
"author": "Georg Hildebrand",
"author_email": "your-email@example.com",
"download_url": "https://files.pythonhosted.org/packages/4f/43/8e43dd151739dd2983b11fa88cc43e44a5a66a26d6312794e3927e76cbce/repo2ai-0.1.1.tar.gz",
"platform": null,
"description": "# Repo2AI\n\n[](https://github.com/georghildebrand/Repo2Markdown/actions/workflows/ci.yml)\n[](https://github.com/georghildebrand/Repo2Markdown/actions/workflows/docs.yml)\n[](https://github.com/georghildebrand/Repo2Markdown)\n\nExport Git repository contents to structured Markdown with **AI Chat Integration**. Perfect for code analysis, documentation, and getting AI assistance with your projects.\n\n## \ud83d\ude80 Quick Start\n\n```bash\n# Install from source (no PyPI package yet)\ngit clone https://github.com/georghildebrand/Repo2Markdown.git\ncd Repo2Markdown\nmake install\n\n# Basic export\npoetry run repo2ai .\n\n# Copy to clipboard and open ChatGPT\npoetry run repo2ai . --open-chat chatgpt\n\n# Open Claude with a specific prompt\npoetry run repo2ai . --open-chat claude --prompt \"Please analyze this codebase and suggest improvements\"\n\n# Try all AI services with a prompt\npoetry run repo2ai . --chat-all --prompt \"Review this repository structure\"\n```\n\n## \u2728 Features\n\n- **\ud83d\udcc1 Smart Repository Scanning** - Respects .gitignore, filters binary files, handles large codebases\n- **\ud83e\udd16 AI Chat Integration** - Automatic browser integration with ChatGPT, Claude, and Gemini\n- **\ud83d\udccb Multiple Output Options** - File, clipboard, stdout, or combinations\n- **\ud83c\udfaf Intelligent Filtering** - Configurable ignore patterns, file size limits, meta file handling\n- **\ud83d\udd0d Language Detection** - Syntax highlighting for 25+ programming languages\n- **\u26a1 Git Integration** - Only includes tracked files, respects Git ignore patterns\n\n## \ud83e\udd16 AI Chat Integration\n\nrepo2ai now supports automatic browser integration with popular AI services, making it easy to share your repository with AI assistants for code analysis, review, and assistance.\n\n### Quick Start with AI Chat\n\n```bash\n# Copy repo to clipboard and open ChatGPT\npoetry run repo2ai . --open-chat chatgpt\n\n# Open Claude with a specific prompt\npoetry run repo2ai . --open-chat claude --prompt \"Please analyze this codebase and suggest improvements\"\n\n# Try all AI services with a prompt\npoetry run repo2ai . --chat-all --prompt \"Review this repository structure\"\n\n# Use specific browser\npoetry run repo2ai . --open-chat chatgpt --browser firefox\n```\n\n### AI Chat Options\n\n```\n--open-chat SERVICE Open specific AI service (chatgpt, claude, gemini)\n--chat-all Try to open all available AI services\n--prompt TEXT Initial prompt to use with the AI service\n--browser BROWSER Browser to use (default, chrome, firefox, safari, edge)\n```\n\n### Supported AI Services\n\n- **ChatGPT** (`chatgpt`) - OpenAI's ChatGPT at chat.openai.com\n- **Claude** (`claude`) - Anthropic's Claude at claude.ai\n- **Gemini** (`gemini`) - Google's Gemini at gemini.google.com\n\n### How It Works\n\n1. **Repository Export**: Scans and exports your repository to markdown\n2. **Clipboard Copy**: Automatically copies the content to your clipboard\n3. **Browser Launch**: Opens the specified AI service in a new browser tab\n4. **Instructions**: Shows helpful instructions for pasting content and adding your prompt\n\n## \ud83d\udcd6 Usage Examples\n\n### Basic Export\n```bash\npoetry run repo2ai . # Export current directory to stdout\npoetry run repo2ai ./project --output docs.md # Export to file\npoetry run repo2ai . --clipboard # Copy to clipboard\n```\n\n### AI Chat Integration\n```bash\n# Code Analysis\npoetry run repo2ai . --open-chat claude --prompt \"Analyze this code for potential security vulnerabilities\"\n\n# Architecture Review\npoetry run repo2ai . --open-chat chatgpt --prompt \"Review the architecture and suggest improvements\"\n\n# Documentation Help\npoetry run repo2ai . --open-chat gemini --prompt \"Help me write better documentation for this project\"\n\n# Quick Questions\npoetry run repo2ai . --chat-all --prompt \"Where are logs written in this application?\"\n```\n\n### Advanced Filtering\n```bash\n# Exclude sensitive files when sharing with AI\npoetry run repo2ai . --open-chat claude --ignore \"*.env\" --ignore \"secrets/*\" --prompt \"Review this code\"\n\n# Large repositories with size limits\npoetry run repo2ai . --max-file-size 50000 --exclude-meta-files\n\n# Custom ignore patterns\npoetry run repo2ai . --ignore \"*.log\" --ignore \"temp/*\" --ignore \"*.tmp\"\n```\n\n## \ud83d\udee0\ufe0f Installation\n\n> **Note**: This project is currently in development. No PyPI package is available yet.\n\n### From Source (Current Method)\n```bash\ngit clone https://github.com/georghildebrand/Repo2Markdown.git\ncd Repo2Markdown\nmake install\n\n# Run with poetry\npoetry run repo2ai --help\n```\n\n### Development Setup\n```bash\ngit clone https://github.com/georghildebrand/Repo2Markdown.git\ncd Repo2Markdown\nmake setup # Complete development environment\n```\n\n### Future PyPI Installation (Planned)\n```bash\n# Will be available after first release\npip install repo2ai\n```\n\n## \ud83d\udccb CLI Options\n\n### Basic Options\n```\npositional arguments:\n path Path to repository (default: current directory)\n\noutput options:\n --output, -o Output file path\n --clipboard, -c Copy output to clipboard\n --stdout, -s Output to stdout (default if no other output specified)\n```\n\n### AI Chat Options\n```\nAI chat options:\n --open-chat Open specific AI service (chatgpt, claude, gemini)\n --chat-all Try to open all available AI services\n --prompt Initial prompt to send with the repo content\n --browser Browser to use (default, chrome, firefox, safari, edge)\n```\n\n### Filtering Options\n```\nfiltering options:\n --ignore Additional ignore patterns (can be used multiple times)\n --exclude-meta-files Exclude meta files like .gitignore, README, LICENSE\n --max-file-size Maximum file size in bytes (default: 1MB)\n --include-meta Include specific meta files (overrides --exclude-meta-files)\n --exclude-meta Exclude specific meta files\n -v, --verbose Show lists of all files included and ignored\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\nThe project follows a clean, modular architecture with clear separation of concerns:\n\n### System Overview\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Developer \u2502\u2500\u2500\u2500\u25b6\u2502 Repo2md CLI \u2502\u2500\u2500\u2500\u25b6\u2502 AI Services \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n \u25bc\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 Git Repository\u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### Core Modules\n\n- **CLI Module**: Command-line interface with argument parsing and validation\n- **Core Module**: Repository scanning, filtering, and Markdown generation\n- **Output Module**: File writing, clipboard integration, stdout handling\n- **Browser Module**: AI chat integration and browser automation\n\n### Architecture Diagrams\n\nThe project includes comprehensive C4 model diagrams:\n\n- **System Context**: High-level system interactions\n- **Container Diagram**: Internal module architecture\n- **Component Diagram**: Detailed component relationships\n- **Development Workflow**: Development and CI/CD processes\n\nGenerate diagrams with: `make docs`\n\n## \ud83d\udd27 Development\n\n### Prerequisites\n- Python 3.11+\n- Poetry for dependency management\n- Make for task automation\n- PlantUML for diagram generation (optional)\n\n### Development Workflow\n\n1. **Setup Development Environment**\n ```bash\n git clone https://github.com/georghildebrand/Repo2Markdown.git\n cd Repo2Markdown\n make setup # Install dependencies + dev tools\n ```\n\n2. **Development Tasks**\n ```bash\n make format # Format code with Black\n make lint # Run linting (flake8 + mypy)\n make test # Run tests\n make test-cov # Run tests with coverage\n ```\n\n3. **Quality Assurance**\n ```bash\n make ci # Run all CI checks locally\n make all # Complete pipeline (format + lint + test + docs + build)\n ```\n\n4. **Documentation**\n ```bash\n make docs # Render PlantUML diagrams\n ```\n\n5. **Testing & Demo**\n ```bash\n make run # Demo on current directory\n make demo # Feature demonstration\n make run-chat # Test AI integration\n ```\n\n### Available Make Targets\n\n| Target | Description |\n|--------|-------------|\n| `make setup` | Complete development environment setup |\n| `make install` | Install dependencies only |\n| `make format` | Format code with Black |\n| `make lint` | Run linting (flake8 + mypy) |\n| `make test` | Run tests |\n| `make test-cov` | Run tests with coverage |\n| `make docs` | Render PlantUML diagrams |\n| `make ci` | Run CI checks locally |\n| `make all` | Complete pipeline |\n| `make clean` | Clean build artifacts |\n\n### Code Quality Standards\n\n- **Code Formatting**: Black with 180 character line length\n- **Linting**: Flake8 for PEP8 compliance\n- **Type Checking**: MyPy with strict settings\n- **Testing**: Pytest with high coverage requirements\n- **Documentation**: Comprehensive docstrings and architecture diagrams\n\n## \ud83e\udd1d Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Make your changes and add tests\n4. Run quality checks: `make ci`\n5. Commit your changes: `git commit -m 'Add amazing feature'`\n6. Push to the branch: `git push origin feature/amazing-feature`\n7. Open a Pull Request\n\n### Contribution Guidelines\n\n- Follow the existing code style (enforced by Black)\n- Add tests for new functionality\n- Update documentation for user-facing changes\n- Ensure all CI checks pass\n- Update architecture diagrams if adding new modules\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- **PlantUML** for architecture diagram generation\n- **Poetry** for excellent dependency management\n- **GitHub Actions** for robust CI/CD\n- **AI Services** (OpenAI, Anthropic, Google) for making code analysis accessible\n\n## \ud83d\udd17 Links\n\n- [GitHub Repository](https://github.com/georghildebrand/Repo2Markdown)\n- [Documentation](https://github.com/georghildebrand/Repo2Markdown/tree/main/docs)\n- [Architecture Diagrams](https://github.com/georghildebrand/Repo2Markdown/tree/main/docs/images)\n- [PyPI Package](https://pypi.org/project/repo2ai/) *(Coming Soon)*\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Export Git repository contents to structured Markdown with AI chat integration",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/georghildebrand/Repo2Markdown/issues",
"Changelog": "https://github.com/georghildebrand/Repo2Markdown/releases",
"Documentation": "https://github.com/georghildebrand/Repo2Markdown#readme",
"Homepage": "https://github.com/georghildebrand/Repo2Markdown",
"Repository": "https://github.com/georghildebrand/Repo2Markdown"
},
"split_keywords": [
"markdown",
" documentation",
" git",
" repository",
" export",
" ai-chat"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d8a45c862bc3926bdd5c54110bf80e02d1c345b9656ba7ff1bbcd1c80e3a9666",
"md5": "d204560bccbc5b9f62a96d0c03108b51",
"sha256": "9850654a52c821961f65f28511d91da8fa6e3c1426b7cb71faff17f7316467fe"
},
"downloads": -1,
"filename": "repo2ai-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d204560bccbc5b9f62a96d0c03108b51",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 14769,
"upload_time": "2025-07-20T22:09:14",
"upload_time_iso_8601": "2025-07-20T22:09:14.518274Z",
"url": "https://files.pythonhosted.org/packages/d8/a4/5c862bc3926bdd5c54110bf80e02d1c345b9656ba7ff1bbcd1c80e3a9666/repo2ai-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4f438e43dd151739dd2983b11fa88cc43e44a5a66a26d6312794e3927e76cbce",
"md5": "dcbd1bfed601408ef4b92ab8a8a71a15",
"sha256": "14bb71a2daef8f11ad8f7869fd45bd762ca9c40f27c61c8dcda82be7d8b34a06"
},
"downloads": -1,
"filename": "repo2ai-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "dcbd1bfed601408ef4b92ab8a8a71a15",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 15229,
"upload_time": "2025-07-20T22:09:15",
"upload_time_iso_8601": "2025-07-20T22:09:15.601102Z",
"url": "https://files.pythonhosted.org/packages/4f/43/8e43dd151739dd2983b11fa88cc43e44a5a66a26d6312794e3927e76cbce/repo2ai-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-20 22:09:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "georghildebrand",
"github_project": "Repo2Markdown",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "repo2ai"
}