{"id":26645010,"url":"https://github.com/context-hub/generator","last_synced_at":"2026-02-08T11:21:23.755Z","repository":{"id":281322568,"uuid":"944922104","full_name":"context-hub/generator","owner":"context-hub","description":"CTX: a tool that solves the context management gap when working with LLMs like ChatGPT or Claude. It helps developers organize and automatically collect information from their codebase into structured documents that can be easily shared with AI assistants.","archived":false,"fork":false,"pushed_at":"2026-01-26T18:42:45.000Z","size":2548,"stargazers_count":290,"open_issues_count":13,"forks_count":18,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-01-27T06:30:31.783Z","etag":null,"topics":["context","context-aware-ai","context-engineering","context-extractor","hacktoberfest","instructions","llm","mcp","mcp-server","mcp-servers","mcp-tools","php","prompt-engineering","vibe-coding"],"latest_commit_sha":null,"homepage":"https://docs.ctxllm.com","language":"PHP","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/context-hub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"patreon":"butschster"}},"created_at":"2025-03-08T08:37:28.000Z","updated_at":"2026-01-26T18:42:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f2acd3c-e629-43c0-bd92-df12582a8015","html_url":"https://github.com/context-hub/generator","commit_stats":null,"previous_names":["butschster/context-generator","context-hub/generator"],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/context-hub/generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/context-hub%2Fgenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/context-hub%2Fgenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/context-hub%2Fgenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/context-hub%2Fgenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/context-hub","download_url":"https://codeload.github.com/context-hub/generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/context-hub%2Fgenerator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29229021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T09:43:19.170Z","status":"ssl_error","status_checked_at":"2026-02-08T09:42:55.556Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["context","context-aware-ai","context-engineering","context-extractor","hacktoberfest","instructions","llm","mcp","mcp-server","mcp-servers","mcp-tools","php","prompt-engineering","vibe-coding"],"created_at":"2025-03-24T21:21:27.736Z","updated_at":"2026-02-08T11:21:23.748Z","avatar_url":"https://github.com/context-hub.png","language":"PHP","readme":"# CTX: Professional AI Development for Every Developer\r\n\r\n\u003e Create LLM-ready contexts in minutes\r\n\r\n\u003cp\u003e\r\n    \u003ca href=\"https://docs.ctxllm.com\"\u003e\u003cimg alt=\"Docs\" src=\"https://img.shields.io/badge/docs-green?style=for-the-badge\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json\"\u003e\u003cimg alt=\"Json schema\" src=\"https://img.shields.io/badge/json_schema-blue?style=for-the-badge\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://discord.gg/YmFckwVkQM\"\u003e\u003cimg src=\"https://img.shields.io/badge/discord-chat-magenta.svg?style=for-the-badge\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://github.com/context-hub/generator/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/downloads/context-hub/generator/total?style=for-the-badge\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://t.me/spiralphp/2504\"\u003e\u003cimg alt=\"Telegram\" src=\"https://img.shields.io/badge/telegram-blue.svg?style=for-the-badge\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEyIDI0YzYuNjI3IDAgMTItNS4zNzMgMTItMTJTMTguNjI3IDAgMTIgMCAwIDUuMzczIDAgMTJzNS4zNzMgMTIgMTIgMTJaIiBmaWxsPSJ1cmwoI2EpIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01LjQyNSAxMS44NzFhNzk2LjQxNCA3OTYuNDE0IDAgMCAxIDYuOTk0LTMuMDE4YzMuMzI4LTEuMzg4IDQuMDI3LTEuNjI4IDQuNDc3LTEuNjM4LjEgMCAuMzIuMDIuNDcuMTQuMTIuMS4xNS4yMy4xNy4zMy4wMi4xLjA0LjMxLjAyLjQ3LS4xOCAxLjg5OC0uOTYgNi41MDQtMS4zNiA4LjYyMi0uMTcuOS0uNSAxLjE5OS0uODE5IDEuMjI5LS43LjA2LTEuMjI5LS40Ni0xLjg5OC0uOS0xLjA2LS42ODktMS42NDktMS4xMTktMi42NzgtMS43OTgtMS4xOS0uNzgtLjQyLTEuMjA5LjI2LTEuOTA4LjE4LS4xOCAzLjI0Ny0yLjk3OCAzLjMwNy0zLjIyOC4wMS0uMDMuMDEtLjE1LS4wNi0uMjEtLjA3LS4wNi0uMTctLjA0LS4yNS0uMDItLjExLjAyLTEuNzg4IDEuMTQtNS4wNTYgMy4zNDgtLjQ4LjMzLS45MDkuNDktMS4yOTkuNDgtLjQzLS4wMS0xLjI0OC0uMjQtMS44NjgtLjQ0LS43NS0uMjQtMS4zNDktLjM3LTEuMjk5LS43OS4wMy0uMjIuMzMtLjQ0Ljg5LS42NjlaIiBmaWxsPSIjZmZmIi8+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iMTEuOTkiIHkxPSIwIiB4Mj0iMTEuOTkiIHkyPSIyMy44MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiMyQUFCRUUiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMyMjlFRDkiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4K\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://github.com/context-hub/generator/actions/workflows/testing.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/context-hub/generator/testing.yml?style=for-the-badge\u0026label=Tests\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://zread.ai/context-hub/generator\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Ask_Zread-_.svg?style=for-the-badge\u0026color=00b0aa\u0026labelColor=000000\u0026logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42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2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K\u0026logoColor=ffffff\" alt=\"zread\"/\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n![Good morning, LLM](https://github.com/user-attachments/assets/8129f227-dc3f-4671-bc0e-0ecd2f3a1888)\r\n\r\n## Table of Contents\r\n\r\n- [Quick Start](#quick-start)\r\n- [Full Documentation](https://docs.ctxllm.com)\r\n- [License](#license)\r\n\r\nDuring development, your codebase constantly evolves. Files are added, modified, and removed. Each time you need to\r\ncontinue working with an LLM, you need to regenerate context to provide updated information about your current codebase\r\nstate.\r\n\r\n**CTX** is a context management tool that gives developers full control over what AI sees from their codebase. Instead\r\nof letting AI tools guess what's relevant, you define exactly what context to provide - making your AI-assisted\r\ndevelopment more predictable, secure, and efficient.\r\n\r\nIt helps developers organize contexts and automatically collect information from their codebase into structured\r\ndocuments that can be easily shared with LLM.\r\n\r\nFor example, a developer describes what context they need:\r\n\r\n```yaml\r\n# context.yaml\r\ndocuments:\r\n  - description: User Authentication System\r\n    outputPath: auth.md\r\n    sources:\r\n      - type: file\r\n        description: Authentication Controllers\r\n        sourcePaths:\r\n          - src/Auth\r\n        filePattern: \"*.php\"\r\n\r\n      - type: file\r\n        description: Authentication Models\r\n        sourcePaths:\r\n          - src/Models\r\n        filePattern: \"*User*.php\"\r\n\r\n  - description: Another Document\r\n    outputPath: another-document.md\r\n    sources:\r\n      - type: file\r\n        sourcePaths:\r\n          - src/SomeModule\r\n```\r\n\r\nThis configuration will gather all PHP files from the `src/Auth` directory and any PHP files containing \"**User**\" in\r\ntheir name from the `src/Models` directory into a single context file `.context/auth.md`. This file can then be pasted\r\ninto a chat session or provided via the built-in [MCP server](https://docs.ctxllm.com/mcp/).\r\n\r\n### Why CTX?\r\n\r\nCurrent AI coding tools automatically scan your entire codebase, which creates several issues:\r\n\r\n- **Security risk**: Your sensitive files (env vars, tokens, private code) get uploaded to cloud services\r\n- **Context dilution**: AI gets overwhelmed with irrelevant code, reducing output quality\r\n- **No control**: You can't influence what the AI considers when generating responses\r\n- **Expensive**: Premium tools charge based on how much they scan, not how much you actually need\r\n\r\n### The CTX Approach\r\n\r\nYou know your code better than any AI. CTX puts you in control:\r\n\r\n- ✅ Define exactly what context to share - no more, no less\r\n- ✅ Keep sensitive data local - works with local LLMs or carefully curated cloud contexts\r\n- ✅ Generate reusable, shareable contexts - commit configurations to your repo\r\n- ✅ Improve code architecture - designing for AI context windows naturally leads to better modular code\r\n- ✅ Works with any LLM - Claude, ChatGPT, local models, or future tools\r\n\r\n## Quick Start\r\n\r\nDownload and install the tool using our installation script:\r\n\r\n### Linux / Wsl\r\n\r\n```bash\r\ncurl -sSL https://raw.githubusercontent.com/context-hub/generator/main/download-latest.sh | sh\r\n```\r\n\r\n### Windows\r\n\r\n```bash\r\npowershell -c \"\u0026 ([ScriptBlock]::Create((irm 'https://raw.githubusercontent.com/context-hub/generator/main/download-latest.ps1'))) -AddToPath\"\r\n```\r\n\r\nThis installs the `ctx` command to your system (typically in `/usr/local/bin`).\r\n\r\n\u003e **Want more options?** See the complete [Installation Guide](https://docs.ctxllm.com/getting-started.html) for\r\n\u003e alternative installation methods.\r\n\r\n## 5-Minute Setup\r\n\r\n1. **Initialize your project:**\r\n\r\n```bash\r\ncd your-project\r\n\r\nctx init\r\n```\r\n\r\nThis generates a `context.yaml` file with a basic configuration and shows your project structure, helping you understand\r\nwhat contexts might be useful.\r\n\r\n\u003e Check the [Command Reference](https://docs.ctxllm.com/getting-started/command-reference.html) for all available\r\n\u003e commands and options.\r\n\r\n2. Create your first context:\r\n\r\n```bash\r\nctx generate\r\n```\r\n\r\n3. Use with your favorite AI:\r\n\r\n- Copy the generated markdown files to your AI chat\r\n- Or use the built-in MCP server with your MCP client (e.g., Claude Desktop, Cursor, Continue, Windsurf)\r\n- Or process locally with open-source models\r\n\r\n## Real-World Use Cases\r\n\r\n### 🚀 Onboarding New Team Member\r\n\r\n```yaml\r\n# Quick project overview for new developers\r\ndocuments:\r\n  - description: \"Project Architecture Overview\"\r\n    outputPath: \"docs/architecture.md\"\r\n    sources:\r\n      - type: tree\r\n        sourcePaths: [ \"src\" ]\r\n        maxDepth: 2\r\n      - type: file\r\n        description: \"Core interfaces and main classes\"\r\n        sourcePaths: [ \"src\" ]\r\n        filePattern: \"*Interface.php\"\r\n```\r\n\r\n### 📝 Feature Development\r\n\r\n```yaml\r\n# Context for developing a new feature\r\ndocuments:\r\n  - description: \"User Authentication System\"\r\n    outputPath: \"contexts/auth-context.md\"\r\n    sources:\r\n      - type: file\r\n        sourcePaths: [ \"src/Auth\", \"src/Models\" ]\r\n        filePattern: \"*.php\"\r\n      - type: git_diff\r\n        description: \"Recent auth changes\"\r\n        commit: \"last-week\"\r\n```\r\n\r\n### 📚 Documentation Generation\r\n\r\n```yaml\r\n# Generate API documentation\r\ndocuments:\r\n  - description: \"API Documentation\"\r\n    outputPath: \"docs/api.md\"\r\n    sources:\r\n      - type: file\r\n        sourcePaths: [ \"src/Controllers\" ]\r\n        modifiers: [ \"php-signature\" ]\r\n        contains: [ \"@Route\", \"@Api\" ]\r\n```\r\n\r\n## Key Features\r\n\r\n### 🎯 **Precise Context Control**\r\n\r\n- Define exactly which files, directories, or code patterns to include\r\n- Filter by content, file patterns, date ranges, or size\r\n- Apply modifiers to extract only relevant parts (e.g., function signatures)\r\n\r\n### 🔒 **Security by Design**\r\n\r\n- **Local-first**: Generate contexts locally, choose what to share\r\n- **No automatic uploads**: Unlike tools that scan everything, you control what gets sent\r\n- **Works with local models**: Use completely offline with Ollama, LM Studio, etc.\r\n\r\n### 🔄 **Version Control Integration**\r\n\r\n- Context configurations are part of your project\r\n- Team members get the same contexts\r\n- Evolve contexts as your codebase changes\r\n- Include git diffs to show recent changes\r\n\r\n### 🛠 **Developer Experience**\r\n\r\n- **Fast**: Generate contexts in seconds, not minutes of manual copying\r\n- **Flexible**: Works with any AI tool or local model\r\n- **Shareable**: Commit configurations, share with team\r\n- **Extensible**: Plugin system for custom sources and modifiers\r\n\r\n## Architecture\r\n\r\nCTX follows a simple pipeline:\r\n\r\n```\r\nConfiguration → Sources → Filters → Modifiers → Output\r\n```\r\n\r\n- **Sources**: Where to get content (files, GitHub, git diffs, URLs, etc.)\r\n- **Filters**: What to include/exclude (patterns, content, dates, sizes)\r\n- **Modifiers**: How to transform content (extract signatures, remove comments)\r\n- **Output**: Structured markdown ready for AI consumption\r\n\r\n## Connect to an MCP Client (Optional)\r\n\r\nFor a more seamless experience, you can connect CTX to any MCP-compatible client using the built-in MCP server.\r\n\r\n```bash\r\n# Interactive setup: detect OS and install config for your client\r\nctx mcp:config\r\n```\r\n\r\nThis command:\r\n\r\n- 🔍 Auto-detects your OS (Windows, Linux, macOS, WSL)\r\n- 🧩 Lets you choose your MCP client (e.g., Claude Desktop, Cursor, Continue, Windsurf)\r\n- 🎯 Generates and optionally installs the correct config for your environment\r\n- 📋 Provides copy‑paste ready JSON if you prefer manual setup\r\n- 🧭 Includes setup instructions and troubleshooting tips\r\n\r\n**Global Registry Mode** (recommended for multiple projects/clients):\r\n\r\n```json\r\n{\r\n  \"mcpServers\": {\r\n    \"ctx\": {\r\n      \"command\": \"ctx\",\r\n      \"args\": [\r\n        \"server\"\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nIf you prefer manual setup, point your MCP client to the CTX server:\r\n\r\n```json\r\n{\r\n  \"mcpServers\": {\r\n    \"ctx\": {\r\n      \"command\": \"ctx\",\r\n      \"args\": [\r\n        \"server\",\r\n        \"-c\",\r\n        \"/path/to/project\"\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n\u003e Note: Read more about the [MCP server](https://docs.ctxllm.com/mcp/#setting-up) for detailed setup instructions and troubleshooting. Specific config file locations vary by client.\r\n\r\nNow you can use your preferred MCP client (including Claude Desktop) to ask questions about your codebase without manually uploading context files.\r\n\r\n## Custom Tools\r\n\r\nDefine project-specific commands that can be executed through the MCP interface:\r\n\r\n```yaml\r\ntools:\r\n  - id: run-tests\r\n    description: \"Run project tests with coverage\"\r\n    type: run\r\n    commands:\r\n      - cmd: npm\r\n        args: [ \"test\", \"--coverage\" ]\r\n```\r\n\r\n## Full Documentation\r\n\r\nFor complete documentation, including all available features and configuration options, please visit:\r\n\r\nhttps://docs.ctxllm.com\r\n\r\n## Join Our Community\r\n\r\nJoin hundreds of developers using CTX for professional AI-assisted coding:\r\n\r\n[![Join Discord](https://img.shields.io/discord/1419284404315881633?color=5865F2\u0026label=Join%20Discord\u0026logo=discord\u0026logoColor=white\u0026style=for-the-badge)](https://discord.gg/YmFckwVkQM)\r\n\r\n**What you'll find in our Discord:**\r\n\r\n- 💡 Share and discover context configurations\r\n- 🛠️ Get help with setup and advanced usage\r\n- 🚀 Showcase your AI development workflows\r\n- 🤝 Connect with like-minded developers\r\n- 📢 First to know about new releases and features\r\n\r\n---\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License.\r\n\r\n\r\n","funding_links":["https://patreon.com/butschster"],"categories":["📚 Projects (1974 total)","🤖 AI/ML","Content Creation","MCP Servers","PHP","Prompts","Code Analysis \u0026 Search","Developer Tools Mcp Servers","Natural Language Processing"],"sub_categories":["MCP Servers","Software Development","Other IDEs","Utilities \u0026 Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontext-hub%2Fgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontext-hub%2Fgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontext-hub%2Fgenerator/lists"}