https://github.com/cased/kit
🛠️ The toolkit for codebase mapping, symbol extraction, and many kinds of search. Build AI-powered devtools!
https://github.com/cased/kit
Last synced: 14 days ago
JSON representation
🛠️ The toolkit for codebase mapping, symbol extraction, and many kinds of search. Build AI-powered devtools!
- Host: GitHub
- URL: https://github.com/cased/kit
- Owner: cased
- License: mit
- Created: 2025-04-21T22:26:21.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-05-08T01:07:37.000Z (16 days ago)
- Last Synced: 2025-05-08T01:25:05.604Z (16 days ago)
- Language: Python
- Homepage: https://kit.cased.com
- Size: 2.81 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - cased/kit - 🛠️ The toolkit for codebase mapping, symbol extraction, and many kinds of code search. Build AI-powered devtools! (Python)
README
# kit 🛠️ Code Intelligence Toolkit
`kit` is a production-ready Python toolkit for codebase mapping, symbol extraction, code search, and building LLM-powered developer tools, agents, and workflows.
Use `kit` to build things like code reviewers, code generators, even IDEs, all enriched with the right code context.
## Quick Installation
### Install from PyPI
```bash
pip install cased-kit
```### Install from Source
```bash
git clone https://github.com/cased/kit.git
cd kit
uv venv .venv
source .venv/bin/activate
uv pip install -e .
```## Basic Usage
```python
from kit import Repository# Load a local repository
repo = Repository("/path/to/your/local/codebase")# Load a remote public GitHub repo
# repo = Repository("https://github.com/owner/repo")# Explore the repo
print(repo.get_file_tree())
# Output: [{"path": "src/main.py", "is_dir": False, ...}, ...]print(repo.extract_symbols('src/main.py'))
# Output: [{"name": "main", "type": "function", "file": "src/main.py", ...}, ...]
```## Key Features & Capabilities
`kit` helps your apps and agents understand and interact with codebases, with components to build your own AI-powered developer tools.
* **Explore Code Structure:**
* High-level view with `repo.get_file_tree()` to list all files and directories.
* Dive down with `repo.extract_symbols()` to identify functions, classes, and other code constructs, either across the entire repository or within a single file.* **Pinpoint Information:**
* Run regular expression searches across your codebase using `repo.search_text()`.
* Track specific symbols (like a function or class) with `repo.find_symbol_usages()`.* **Prepare Code for LLMs & Analysis:**
* Break down large files into manageable pieces for LLM context windows using `repo.chunk_file_by_lines()` or `repo.chunk_file_by_symbols()`.
* Get the full definition of a function or class off a line number within it using `repo.extract_context_around_line()`.* **Generate Code Summaries:**
* Use LLMs to create natural language summaries for files, functions, or classes using the `Summarizer` (e.g., `summarizer.summarize_file()`, `summarizer.summarize_function()`).
* Build a searchable semantic index of these AI-generated docstrings with `DocstringIndexer` and query it with `SummarySearcher` to find code based on intent and meaning.* **Analyze Code Dependencies:**
* Map import relationships between modules using `repo.get_dependency_analyzer()` to understand your codebase structure.
* Generate dependency reports and LLM-friendly context with `analyzer.generate_dependency_report()` and `analyzer.generate_llm_context()`.* **And much more...** `kit` also offers capabilities for semantic search on raw code, building custom context for LLMs, and more.
Explore the **[Full Documentation](https://kit.cased.com)** for detailed usage, advanced features, and practical examples.
## License
MIT License
## Contributing
Please see our [Roadmap](https://kit.cased.com/development/roadmap) for project directions.