{"id":48923680,"url":"https://github.com/pandaxbacon/github-copilot-chat-exporter","last_synced_at":"2026-04-17T05:35:49.604Z","repository":{"id":328955398,"uuid":"1111212035","full_name":"pandaxbacon/github-copilot-chat-exporter","owner":"pandaxbacon","description":"Export GitHub Copilot Chat (copilot.share) conversations to Markdown \u0026 PDF.","archived":false,"fork":false,"pushed_at":"2025-12-08T06:40:20.000Z","size":227,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T06:39:22.543Z","etag":null,"topics":["exporter","github-copilot-chat","markdown","playwright-python","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pandaxbacon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-06T13:52:15.000Z","updated_at":"2025-12-08T06:40:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pandaxbacon/github-copilot-chat-exporter","commit_stats":null,"previous_names":["pandaxbacon/github-copilot-chat-exporter"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pandaxbacon/github-copilot-chat-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fgithub-copilot-chat-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fgithub-copilot-chat-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fgithub-copilot-chat-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fgithub-copilot-chat-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pandaxbacon","download_url":"https://codeload.github.com/pandaxbacon/github-copilot-chat-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fgithub-copilot-chat-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31917120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exporter","github-copilot-chat","markdown","playwright-python","python"],"created_at":"2026-04-17T05:35:47.232Z","updated_at":"2026-04-17T05:35:49.586Z","avatar_url":"https://github.com/pandaxbacon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✨ GitHub Copilot Chat Exporter ✨\n\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n![Python Version](https://img.shields.io/badge/python-3.9%2B-blue)\n![Playwright](https://img.shields.io/badge/playwright-1.48.0-green)\n[![PyPI version](https://img.shields.io/pypi/v/github-copilot-chat-exporter.svg)](https://pypi.org/project/github-copilot-chat-exporter/)\n[![Homebrew](https://img.shields.io/badge/homebrew-pandaxbacon%2Ftap-orange)](https://github.com/pandaxbacon/homebrew-tap)\n[![Python CI](https://github.com/pandaxbacon/github-copilot-chat-exporter/actions/workflows/python-ci.yml/badge.svg)](https://github.com/pandaxbacon/github-copilot-chat-exporter/actions)\n[![codecov](https://codecov.io/gh/pandaxbacon/github-copilot-chat-exporter/branch/main/graph/badge.svg)](https://codecov.io/gh/pandaxbacon/github-copilot-chat-exporter)\n\n**Export GitHub Copilot shared conversations to clean Markdown with inline attachments. No API key required!**\n\nA Python-based toolkit to extract and archive GitHub Copilot chat share pages with full authentication support, file attachment capture, and inline file linking.\n\n## Features\n\n* ✅ Export Copilot shared conversations to Markdown\n* ✅ **File attachment capture** - Extracts CSV, TXT, JSON, YAML, XML, MD, and code files\n* ✅ **Inline attachment links** - Files appear where they're referenced in the conversation\n* ✅ Authenticated access via manual login (saves reusable session state)\n* ✅ Headless automation with Playwright\n* ✅ Fallback static scraper for public pages\n* ✅ JSON API extraction with DOM fallback\n* ✅ Debugging artifacts (`page.html`, network logs)\n* ✅ Clean, simple folder structure (attachments only)\n* ✅ Works on macOS, Linux, and Windows\n\n## Installation\n\n### macOS/Linux (Homebrew) - Recommended\n\n```bash\nbrew tap pandaxbacon/tap\nbrew install github-copilot-chat-exporter\n```\n\nThat's it! The `copilot-exporter` command is now available.\n\n### All Platforms (Manual Setup)\n\n#### Prerequisites\n\n* Python 3.9 or higher\n* pip (Python package installer)\n\n#### Setup\n\n1. **Create a virtual environment:**\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n```\n\n2. **Install dependencies:**\n\n```bash\npip install -r requirements.txt\npython -m playwright install chromium\n```\n\n## Quick Start\n\n### Homebrew Users\n\n1. **Authenticate (One-time setup):**\n\n```bash\ncopilot-exporter --mode login --url https://github.com/copilot/share/YOUR-SHARE-ID\n```\n\n* A browser window will open\n* Sign in to GitHub\n* Press **Enter** in the terminal to save authentication\n\n2. **Export Conversations:**\n\n```bash\n# Markdown only (text and code blocks)\ncopilot-exporter --mode run --url https://github.com/copilot/share/YOUR-SHARE-ID\n\n# With file attachments (captures CSV, TXT, JSON, YAML, code files, etc.)\ncopilot-exporter --mode run --url https://github.com/copilot/share/YOUR-SHARE-ID --with-assets\n```\n\n### Manual Setup Users\n\n1. **Authenticate (One-time setup):**\n\n```bash\npython scraper_playwright.py --mode login --url https://github.com/copilot/share/YOUR-SHARE-ID\n```\n\n* A browser window will open\n* Sign in to GitHub\n* Press **Enter** in the terminal to save `storage_state.json`\n\n2. **Export Conversations:**\n\n```bash\npython scraper_playwright.py --mode run --url https://github.com/copilot/share/YOUR-SHARE-ID\n\n# With CSV attachments (captures uploaded and generated files)\npython scraper_playwright.py --mode run --url https://github.com/copilot/share/YOUR-SHARE-ID --with-assets\n```\n\n### Output Files\n\n* `chat-export.md` - Clean Markdown format with inline attachment links\n* `page.html` - Full page HTML for debugging\n* `storage_state.json` - Saved authentication state (reusable)\n* Asset folder (when using `--with-assets`):\n  * `output/\u003cconversation\u003e/attachments/` - CSV files and user uploads with inline links\n\n## Usage\n\n### Playwright Scraper (Recommended)\n\nThe Playwright-based scraper supports authenticated access and renders JavaScript-heavy pages.\n\n#### Authentication Mode\n\n```bash\npython scraper_playwright.py --mode login --url \u003cSHARE_URL\u003e\n```\n\nOpens a headed browser for manual GitHub login, then saves authentication to `storage_state.json`.\n\n#### Export Mode\n\n```bash\npython scraper_playwright.py --mode run --url \u003cSHARE_URL\u003e [--with-assets]\n```\n\nRuns headless using saved authentication. Exports to Markdown with optional attachment capture.\n\n**Options:**\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--mode` | `login` or `run` | `run` |\n| `--url` | GitHub Copilot share URL | Sample URL |\n| `--with-assets` | Capture CSV files and attachments | `False` |\n\n### Requests Scraper (Public pages only)\n\nFor publicly accessible share pages (no authentication required):\n\n```bash\npython scraper_requests.py --url \u003cSHARE_URL\u003e\n```\n\n**Note:** This will exit with a warning if the page requires login. Use the Playwright scraper for authenticated pages.\n\n## Examples\n\n### Basic Export\n\n```python\n# Assuming storage_state.json exists from login\nimport asyncio\nfrom pathlib import Path\nfrom scraper_playwright import run_export\n\nasyncio.run(run_export(\n    url=\"https://github.com/copilot/share/YOUR-SHARE-ID\",\n    with_assets=False  # Set to True to capture CSV files\n))\n```\n\n### Batch Export Multiple URLs\n\n```python\nimport asyncio\nfrom scraper_playwright import run_export\n\nurls = [\n    \"https://github.com/copilot/share/ID-1\",\n    \"https://github.com/copilot/share/ID-2\",\n    \"https://github.com/copilot/share/ID-3\",\n]\n\nasync def batch_export():\n    for url in urls:\n        await run_export(url, with_assets=True)\n        print(f\"✓ Exported {url}\")\n\nasyncio.run(batch_export())\n```\n\n## Output Format\n\n### Markdown Structure\n\n```markdown\n# Chat Export\n\n## User\nwe should not pursue a perfect cut\ninstead we may run multiple runs … and then add another workflow at the end to judge and vote which cut is the best\n\n## Copilot\nThat's exactly the right instinct:\n- There isn't one optimal chunking for all tasks.\n- You've already seen two \"valid but different\" interpretations of the same document.\n...\n```\n\n### Attachments \u0026 Folder Structure (`--with-assets`)\n\nWhen `--with-assets` is set, exports are organized under `output/\u003cconversation\u003e/`:\n\n```\noutput/\n  conversation-title/\n    chat-export.md           # Markdown with inline attachment links\n    page.html                # Debug artifact\n    attachments/\n      aia-glossary-001.csv            # User-uploaded CSV\n      aia-glossary-cleaned-001.csv    # Copilot-generated CSV\n      image-001.png                   # User-uploaded image\n```\n\n**Inline Attachment Links:**\n\nAttachments appear directly where they're referenced in the conversation:\n\n```markdown\n## User\n📎 **Attachment:** [aia_glossary.csv](attachments/aia-glossary-001.csv)\n\nhere you are file\n\n## Assistant  \nHere's the cleaned file I produced:\n\n📎 **Attachment:** [aia_glossary_cleaned.csv](attachments/aia-glossary-cleaned-001.csv)\n```\n\nSee [`examples/sample-export/`](examples/sample-export/) for a complete real-world example.\n\n## Troubleshooting\n\n### \"storage_state.json not found\"\n\n**Solution:** Run the login mode first:\n\n```bash\npython scraper_playwright.py --mode login --url \u003cSHARE_URL\u003e\n```\n\n### Empty or missing messages\n\n**Possible causes:**\n\n1. **Selectors changed:** GitHub may have updated the page structure\n   * Check `page.html` to inspect the rendered DOM\n   * Update `MESSAGE_SELECTORS` in `scraper_playwright.py`\n\n2. **Network timing:** Page didn't fully load\n   * Increase wait timeout in `run_export()` function\n   * Run in headed mode (`headless=False`) to visually confirm rendering\n\n### \"Page redirected to login\"\n\n**Cause:** Authentication expired or not captured\n\n**Solution:** Re-run login mode to refresh `storage_state.json`\n\n## Platform Support\n\n| Platform  | Status          |\n| --------- | --------------- |\n| ✅ macOS   | Fully supported |\n| ✅ Linux   | Fully supported |\n| ✅ Windows | Fully supported |\n\n## Development\n\n### Running Tests\n\n```bash\n# Install dev dependencies\npip install -r requirements-dev.txt\n\n# Run tests\npytest\n\n# Run tests with coverage\npytest --cov=. --cov-report=html\n\n# View coverage report\nopen htmlcov/index.html\n```\n\n### Code Quality\n\n```bash\n# Format code\nblack scraper_playwright.py scraper_requests.py\n\n# Lint\nflake8 scraper_playwright.py scraper_requests.py\n\n# Type check\nmypy scraper_playwright.py scraper_requests.py\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Credits\n\n* Built with [Playwright](https://playwright.dev/) for browser automation\n* Inspired by the need to archive AI-assisted development conversations\n\n## Support\n\n* 📖 Documentation: See [developer-notes/](developer-notes/) for R\u0026D details\n* 🐛 Issues: Report on GitHub Issues\n* ⭐ Like this project? Give it a star!\n\n---\n\n**Made with ❤️ for developers who want to own their AI conversation history**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaxbacon%2Fgithub-copilot-chat-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpandaxbacon%2Fgithub-copilot-chat-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaxbacon%2Fgithub-copilot-chat-exporter/lists"}