generator  by context-hub

Codebase context generation for AI assistants

Created 8 months ago
268 stars

Top 95.8% on SourcePulse

GitHubView on GitHub
Project Summary

CTX is a context management tool designed to bridge the gap between developer codebases and Large Language Models (LLMs) like ChatGPT or Claude. It empowers developers to precisely define and organize information extracted from their code into structured documents, enhancing the predictability, security, and efficiency of AI-assisted development workflows. The tool targets developers seeking greater control over the context provided to AI assistants, moving beyond the limitations of broad, automatic codebase scanning.

How It Works

CTX operates on a declarative, configuration-driven pipeline. Users define context requirements in a context.yaml file, specifying sources (files, directories, git diffs), filters (patterns, content, dates, sizes), and modifiers (e.g., extracting function signatures). This process transforms raw codebase information into structured markdown documents, ready to be shared with LLMs. This approach offers a significant advantage by ensuring only relevant, curated information is shared, thereby mitigating security risks associated with sensitive data exposure, preventing context dilution that degrades AI output quality, and eliminating unnecessary costs tied to broad code scanning.

Quick Start & Requirements

Installation is straightforward via a provided script for Linux/WSL (curl) or Windows (powershell). After installation, navigate to your project directory and run ctx init to generate a basic context.yaml configuration file. Use ctx generate to create your context documents. The tool integrates seamlessly with any LLM and supports local models. For enhanced workflow, a built-in MCP server facilitates integration with MCP-compatible clients (e.g., Claude Desktop, Cursor, Continue) via the ctx mcp:config command. Full documentation is available at https://docs.ctxllm.com.

Highlighted Details

  • Precise Context Control: Define inclusion rules via file paths, patterns, content filters, date ranges, and size limits. Apply modifiers to extract specific code elements.
  • Security by Design: Context generation is local-first, preventing automatic uploads of sensitive data. It is compatible with local LLM setups for complete offline use.
  • Version Control Integration: Context configurations can be committed to version control, ensuring consistency across teams and enabling context evolution alongside codebase changes. Git diffs can be included to capture recent modifications.
  • Extensibility: Features a plugin system allowing for custom sources and modifiers to extend functionality.

Maintenance & Community

The project encourages community engagement through a Discord server, serving as a hub for sharing context configurations, seeking setup assistance, showcasing AI development workflows, and staying updated on releases.

Licensing & Compatibility

This project is licensed under the MIT License, which permits broad use, including commercial applications and linking within closed-source projects.

Limitations & Caveats

The README does not explicitly detail limitations, alpha/beta status, or known bugs. Integration with MCP clients may require specific configuration steps depending on the chosen client.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
27 stars in the last 30 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.3%
17k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
Created 1 year ago
Updated 6 hours ago
Feedback? Help us improve.