Summary
Currently pip install codectx installs tree-sitter grammars for all supported languages regardless of what the user actually needs. This issue tracks introducing optional extras so users install only the grammars relevant to their codebase.
Motivation
- Users analyzing Python-only repos have no reason to install Go or Rust grammars
- Fewer installed packages means faster dependency resolution and smaller conflict surface in user environments
- Explicit extras (
codectx[go]) communicate supported languages clearly at install time
- Cleaner dependency graph for downstream tools that inspect transitive dependencies
Proposed Interface
pip install codectx # core + Python grammar (default use case)
pip install codectx[go] # core + Python + Go
pip install codectx[rust] # core + Python + Rust
pip install codectx[go,rust] # core + Python + Go + Rust
pip install codectx[all] # core + all supported language grammars
Python grammar is bundled by default since the primary audience is Python developers and bare pip install codectx must work out of the box for the most common case.
pyproject.toml Changes
[project.dependencies]
tree-sitter-python = "*" # always included
[project.optional-dependencies]
go = ["tree-sitter-go"]
rust = ["tree-sitter-rust"]
javascript = ["tree-sitter-javascript"]
typescript = ["tree-sitter-typescript"]
all = [
"tree-sitter-go",
"tree-sitter-rust",
"tree-sitter-javascript",
"tree-sitter-typescript",
]
Runtime Behavior
When a user runs codectx on a repository containing a language whose grammar
is not installed, codectx should fail with a clear, actionable error:
Language 'go' detected but tree-sitter-go is not installed.
Run: pip install codectx[go]
No silent fallback, no partial analysis without warning.
Implementation Notes
Acceptance Criteria
Out of Scope
- Adding support for new languages (separate issue)
- Auto-detecting and prompting to install missing grammars interactively
Summary
Currently
pip install codectxinstalls tree-sitter grammars for all supported languages regardless of what the user actually needs. This issue tracks introducing optional extras so users install only the grammars relevant to their codebase.Motivation
codectx[go]) communicate supported languages clearly at install timeProposed Interface
Python grammar is bundled by default since the primary audience is Python developers and bare
pip install codectxmust work out of the box for the most common case.pyproject.toml Changes
Runtime Behavior
When a user runs codectx on a repository containing a language whose grammar
is not installed, codectx should fail with a clear, actionable error:
No silent fallback, no partial analysis without warning.
Implementation Notes
pyproject.tomlwith extras as aboverequired grammar is missing
README.mdinstall sectionAcceptance Criteria
pip install codectxinstalls only core and Python grammarcodectx[all]installs all grammarsOut of Scope