Skip to main content

A modular toolkit for LLM-powered codebase understanding.

Project description

kit 🛠️ Code Intelligence Toolkit

kit is a modular, production-grade 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

# Installation (includes all features)
pip install cased-kit

Install from Source

git clone https://github.com/cased/kit.git
cd kit
uv venv .venv
source .venv/bin/activate
uv pip install -e .

Basic Usage

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 deeply understand and interact with codebases, providing the core components to build your own AI-powered developer tools. Here are just a few of the things you can do:

  • Explore Code Structure:

    • Get a bird's-eye view with repo.get_file_tree() to list all files and directories.
    • Dive into specifics with repo.extract_symbols() to identify all functions, classes, and other code constructs, either across the entire repository or within a single file.
  • Pinpoint Information:

    • Perform precise textual or regular expression searches across your codebase using repo.search_text().
    • Track down every definition and reference of a specific symbol (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().
    • Instantly grab the full definition of a function or class just by knowing a line number within it using repo.extract_context_around_line().
  • Generate Code Summaries (Alpha):

    • Leverage 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.
    • Detect circular dependencies and visualize module relationships with analyzer.find_cycles() and analyzer.visualize_dependencies().
    • Generate dependency reports and LLM-friendly context with analyzer.generate_dependency_report() and analyzer.generate_llm_context().
    • Currently supports Python and Terraform (HCL), with a flexible architecture for adding more languages.
  • And much more... kit also offers capabilities for semantic search on raw code, building custom context for LLMs, and more.

Explore the Full Documentation for detailed usage, advanced features, and practical examples.

License

MIT License

Contributing

We welcome contributions! Please see our Roadmap for project directions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cased_kit-0.1.3.tar.gz (67.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cased_kit-0.1.3-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

Details for the file cased_kit-0.1.3.tar.gz.

File metadata

  • Download URL: cased_kit-0.1.3.tar.gz
  • Upload date:
  • Size: 67.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for cased_kit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c83b6667e97272f921af27a695f16b2b85e2e6f530c3e5f42eba8b6f06fe0264
MD5 c1ac71c6739df0137c922c08ec9416c0
BLAKE2b-256 494183f671d3d18f8258ae47bdff19dd97b52d5e28a42ade1c816774ddc89d63

See more details on using hashes here.

File details

Details for the file cased_kit-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cased_kit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 51.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for cased_kit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cd98cd6187a4c97cca46420945839c876c68953ce485805dc13f540cff6186b7
MD5 5f21d7ab435166c70406c044849337c8
BLAKE2b-256 2ac9e98e1f43b63e7b883c9421fd25b59def3fe05e1e48983a2afc9be019d7d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page