{"id":31027670,"url":"https://github.com/markshawn2020/context-packer","last_synced_at":"2025-09-13T19:51:51.613Z","repository":{"id":311530351,"uuid":"1008630517","full_name":"MarkShawn2020/context-packer","owner":"MarkShawn2020","description":"The Webpack for AI Context - Package your entire project into a single markdown file optimized for LLMs and documentation","archived":false,"fork":false,"pushed_at":"2025-09-02T19:42:25.000Z","size":64,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-02T21:21:51.310Z","etag":null,"topics":["ai","bundler","claude","code-analysis","context","developer-tools","documentation","gpt","llm","markdown","packaging","symlinks"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/context-packer/","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/MarkShawn2020.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2025-06-25T21:06:48.000Z","updated_at":"2025-09-02T19:42:29.000Z","dependencies_parsed_at":"2025-08-25T04:39:35.376Z","dependency_job_id":"e17a23d9-da68-459a-b1d3-c6d34734e47b","html_url":"https://github.com/MarkShawn2020/context-packer","commit_stats":null,"previous_names":["markshawn2020/context-packer"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MarkShawn2020/context-packer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkShawn2020%2Fcontext-packer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkShawn2020%2Fcontext-packer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkShawn2020%2Fcontext-packer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkShawn2020%2Fcontext-packer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarkShawn2020","download_url":"https://codeload.github.com/MarkShawn2020/context-packer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkShawn2020%2Fcontext-packer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275020168,"owners_count":25391651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"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":["ai","bundler","claude","code-analysis","context","developer-tools","documentation","gpt","llm","markdown","packaging","symlinks"],"created_at":"2025-09-13T19:51:47.781Z","updated_at":"2025-09-13T19:51:51.602Z","avatar_url":"https://github.com/MarkShawn2020.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Context Packer - The Webpack for AI Context\n\n[![PyPI version](https://badge.fury.io/py/context-packer.svg)](https://badge.fury.io/py/context-packer)\n[![Python Support](https://img.shields.io/pypi/pyversions/context-packer.svg)](https://pypi.org/project/context-packer/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub Stars](https://img.shields.io/github/stars/MarkShawn2020/context-packer.svg)](https://github.com/MarkShawn2020/context-packer/stargazers)\n\n\u003e 🎯 **One file, full context** - Package your entire project into a single markdown file optimized for LLMs and documentation.\n\n## 🌟 Why Context Packer?\n\nIn the age of AI-powered development, we face a critical challenge: **Large Language Models need complete project context**, but sharing multiple files is cumbersome and inefficient. \n\nJust as **webpack** revolutionized JavaScript bundling and **esbuild** transformed build speeds, **Context Packer** transforms how we share code with AI models and documentation systems.\n\n### The Problem\n- 📁 **LLMs work best with single-file contexts** - No need to manage multiple uploads\n- 🔄 **Modern documentation systems** (like Next.js) support single-file downloads for offline viewing\n- 🤖 **AI code reviews** require complete project understanding in one shot\n- 📚 **Knowledge sharing** becomes complex with scattered files\n\n### The Solution\nContext Packer intelligently bundles your entire project into a **single, AI-optimized markdown file** - complete with structure visualization, smart filtering, and symlink support for complex project organization.\n\n## ✨ Key Features\n\n- **🔗 Advanced Symlink Support**: Organize complex projects with symbolic links - perfect for selective file inclusion\n- **🎯 AI-Optimized Output**: Formatted specifically for LLM consumption with clear structure and syntax highlighting\n- **📊 Smart Filtering**: Automatically excludes build artifacts, dependencies, and binary files\n- **🌳 Visual Project Tree**: Instant understanding of project structure with status indicators\n- **⚡ Lightning Fast**: Efficient processing even for large codebases\n- **🔧 Highly Configurable**: Fine-tune output with extensive options\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# Using pip\npip install context-packer\n\n# Using uv (10-100x faster)\nuv pip install context-packer\n\n# Using pipx (isolated environment)\npipx install context-packer\n```\n\n### Basic Usage\n\n```bash\n# Pack current directory\nctxpack .\n\n# Pack specific project\nctxpack /path/to/project -o project_context.md\n\n# Pack with custom settings\nctxpack . --max-size 20 --ignore \"*.test.js\" \"docs/*\"\n```\n\n## 🎨 Advanced: The Symlink Workflow\n\nContext Packer's **symlink support** enables a powerful workflow for complex projects where you need fine-grained control over what gets packed.\n\n### Scenario: Selective Project Packing\n\nInstead of using complex ignore patterns, create a \"packing directory\" with symlinks to exactly what you need:\n\n```bash\n# Create a packing directory\nmkdir my-project-pack\ncd my-project-pack\n\n# Symlink specific files and directories\nln -s ../src/core core\nln -s ../src/utils/helpers.js helpers.js\nln -s ../config config\nln -s ../package.json package.json\nln -s ../README.md README.md\n\n# Pack only what you've selected\nctxpack . -o ../my-project-context.md\n```\n\n### Real-World Example: Multi-Module Project\n\n```bash\n# You have a monorepo with multiple packages\nproject/\n├── packages/\n│   ├── frontend/     # React app\n│   ├── backend/      # Node.js API  \n│   ├── shared/       # Shared utilities\n│   └── mobile/       # React Native app\n\n# Create a context for AI review of web platform only\nmkdir web-platform-context\ncd web-platform-context\n\n# Link only web-related packages\nln -s ../packages/frontend frontend\nln -s ../packages/backend backend  \nln -s ../packages/shared shared\nln -s ../docker-compose.yml docker-compose.yml\nln -s ../.env.example .env.example\n\n# Generate context\nctxpack . -o web-platform.md --follow-symlinks\n```\n\nThis approach gives you **surgical precision** in creating contexts for different purposes:\n- 🎯 **Code Review Context**: Only the files changed in a PR\n- 🏗️ **Architecture Context**: High-level structure without implementation details  \n- 🐛 **Debug Context**: Specific module with its dependencies\n- 📖 **Documentation Context**: README files and examples only\n\n## 📋 Output Format\n\nContext Packer generates a structured markdown file with:\n\n### 1. Project Structure Visualization\n```\nMyProject\n├── src/\n│   ├── index.js ✅      # High-priority file\n│   ├── utils/ 🔗📁      # Symlinked directory\n│   │   └── helper.js ☑️  # Included file\n│   └── tests/ ⏭️        # Ignored directory\n├── package.json ✅      # Configuration file\n└── README.md ✅         # Documentation\n```\n\n### 2. Status Indicators\n- ✅ High-priority files (configs, README)\n- ☑️ Source code files\n- 🔗 Symbolic links\n- 🔗📁 Symlinked directories  \n- ⚠️ Circular reference detected\n- 📊 Large files (truncated)\n- ⏭️ Ignored files\n\n### 3. Complete File Contents\nEach file is presented with:\n- Relative path\n- Syntax highlighting\n- Smart truncation for large files\n- Clear section separators\n\n## 🎯 Perfect For\n\n### 🤖 AI Development\n```bash\n# Prepare context for AI analysis\nctxpack . -o for_claude.md --max-size 30\n\n# Get AI to review your architecture\nctxpack src/ -o architecture_review.md --max-depth 2\n```\n\n### 📚 Documentation\n```bash\n# Create offline documentation bundle\nctxpack docs/ -o documentation.md --ignore \"*.png\" \"*.jpg\"\n```\n\n### 🔍 Code Review\n```bash\n# Package PR changes for review\nctxpack . -o pr_context.md --ignore \"node_modules\" \"*.test.*\"\n```\n\n### 🎓 Learning \u0026 Teaching\n```bash\n# Create educational material\nctxpack examples/ -o tutorial_code.md --max-files 20\n```\n\n## 🛠️ Command Line Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `project_path` | Directory to pack | Required |\n| `-o, --output` | Output file path | `{project}_context_{timestamp}.md` |\n| `--ignore` | Additional ignore patterns | None |\n| `--max-size` | Maximum total size (MB) | 10 |\n| `--max-files` | Maximum number of files | 100 |\n| `-L, --max-depth` | Maximum directory depth | Unlimited |\n| `--follow-symlinks` | Follow symbolic links | Yes |\n| `--no-follow-symlinks` | Don't follow symbolic links | No |\n| `-v, --verbose` | Show detailed progress | No |\n\n## ⚡ Performance Tips\n\n1. **Large Codebases**: Use `--verbose` to monitor progress\n2. **Selective Packing**: Use symlinks for precise control\n3. **Size Management**: Adjust `--max-size` based on LLM limits\n4. **Speed Optimization**: Use `--max-depth` to limit traversal\n\n## 🔒 Security \u0026 Best Practices\n\n- **Automatic Exclusions**: `.env`, `.git`, `node_modules` are ignored by default\n- **Gitignore Respect**: Honors your `.gitignore` patterns\n- **Size Limits**: Prevents accidental huge outputs\n- **Review Before Sharing**: Always check output before sending to third parties\n\n## 🧑‍💻 Development\n\n### Setting up with UV (Recommended)\n```bash\n# Install uv\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Clone and setup\ngit clone https://github.com/MarkShawn2020/context-packer.git\ncd context-packer\n\n# Install in development mode\nuv pip install -e .\nuv pip install -r requirements-dev.txt\n\n# Run tests\nuv run pytest\n```\n\n### Quick Commands\n```bash\nmake test      # Run tests\nmake lint      # Check code quality\nmake format    # Format code\nmake build     # Build package\nmake publish   # Publish to PyPI\n```\n\n## 📦 Publishing\n\nWith PyPI token configured:\n\n```bash\n# One-command publish (with version bump)\nmake release VERSION=patch  # or minor, major\n\n# Or manual steps\npython bump_version.py patch\ngit commit -am \"Bump version\"\ngit tag v1.2.3\ngit push --tags\nmake publish\n```\n\n## 🌍 Ecosystem\n\nContext Packer is part of the modern AI development workflow:\n\n- **Use with Claude, GPT-4, Gemini** for code analysis\n- **Integrate with CI/CD** for automatic documentation\n- **Combine with AI editors** like Cursor, Windsurf\n- **Works with documentation systems** like Docusaurus, Next.js\n\n## 🤝 Contributing\n\nWe welcome contributions! Context Packer is designed to be the definitive solution for project context packaging.\n\n### Ideas for Contribution\n- 🎨 GUI interface (planned)\n- 🔌 Plugin system for custom processors\n- 🌐 Web service API\n- 📊 Context analytics\n- 🔄 Incremental packing\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\nCreated by [MarkShawn2020](https://github.com/MarkShawn2020) to solve the real-world challenge of sharing complete project context with AI models. Inspired by the elegance of webpack and the speed of esbuild, Context Packer brings the same innovation to AI-assisted development.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**🚀 Transform how you share code with AI**\n\n[Documentation](https://github.com/MarkShawn2020/context-packer#readme) • \n[Issues](https://github.com/MarkShawn2020/context-packer/issues) • \n[PyPI](https://pypi.org/project/context-packer/) • \n[Releases](https://github.com/MarkShawn2020/context-packer/releases)\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkshawn2020%2Fcontext-packer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkshawn2020%2Fcontext-packer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkshawn2020%2Fcontext-packer/lists"}