{"id":28017882,"url":"https://github.com/cased/kit","last_synced_at":"2026-01-05T23:17:26.866Z","repository":{"id":292063969,"uuid":"970357908","full_name":"cased/kit","owner":"cased","description":"🛠️ The toolkit for codebase mapping, symbol extraction, and many kinds of search. Build AI-powered devtools!","archived":false,"fork":false,"pushed_at":"2025-05-08T01:07:37.000Z","size":2947,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-08T01:25:05.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kit.cased.com","language":"Python","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/cased.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2025-04-21T22:26:21.000Z","updated_at":"2025-05-08T01:13:33.000Z","dependencies_parsed_at":"2025-05-08T01:35:26.578Z","dependency_job_id":null,"html_url":"https://github.com/cased/kit","commit_stats":null,"previous_names":["cased/kit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cased%2Fkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cased%2Fkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cased%2Fkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cased%2Fkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cased","download_url":"https://codeload.github.com/cased/kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253411522,"owners_count":21904147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-05-10T12:01:39.284Z","updated_at":"2026-01-05T23:17:26.860Z","avatar_url":"https://github.com/cased.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# kit 🛠️ Code Intelligence Toolkit\n\n\u003cimg src=\"https://github.com/user-attachments/assets/7bdfa9c6-94f0-4ee0-9fdd-cbd8bd7ec060\" width=\"360\"\u003e\n\n`kit` is a production-ready toolkit for codebase mapping, symbol extraction, code search, and building LLM-powered developer tools, agents, and workflows. \n\nUse `kit` to build things like code reviewers, code generators, even IDEs, all enriched with the right code context. Work with `kit` directly from Python, or with MCP + function calling, REST, or CLI.\n\nExplore the **[full documentation](https://kit.cased.com)** for detailed usage, advanced features, and practical examples. Check out docs for kit's [local dev MCP server](https://kit-mcp.cased.com), too.\n\n\n## Quick Installation\n\n### Install from PyPI\n\n```bash\nuv pip install cased-kit\n\n# With ML features for advanced analysis and vector search\nuv pip install 'cased-kit[all]'\n```\n\n### Install Globally with uv (easiest for CLI usage)\n\nIf you want to use the `kit` CLI globally without affecting your system Python, use `uv tool install`. This creates an isolated environment for `kit` while making the CLI available from anywhere:\n\n```bash\n# Install the base kit CLI globally\nuv tool install cased-kit\n\n# Everything (including MCP server and all features)\nuv tool install cased-kit[all]\n```\n\nAfter installation, the `kit` and `kit-dev-mcp` commands will be available globally. To manage your uv tool installations:\n\n```bash\n# List installed tools\nuv tool list\n\n# Uninstall if needed\nuv tool uninstall cased-kit\n```\n\n### Claude Code Plugin\n\nUse kit directly in [Claude Code](https://claude.ai/code) with the official plugin:\n\n```bash\n/plugin marketplace add cased/claude-code-plugins\n/plugin install kit-cli\n```\n\nThe plugin gives Claude autonomous access to kit's codebase analysis tools. Claude will automatically use kit when you ask questions like:\n- \"How does authentication work in this codebase?\"\n- \"Find all usages of the UserModel class\"\n- \"What are the dependencies of this project?\"\n- \"Show me the file structure of src/\"\n\nSee the [Claude Code Integration Guide](https://kit.cased.com/introduction/claude-code) for details.\n\n## Toolkit Usage\n\n### Basic Python API\n\n```python\nfrom kit import Repository\n\n# Load a local repository\nrepo = Repository(\"/path/to/your/local/codebase\")\n\n# Load a remote public GitHub repo\nrepo = Repository(\"https://github.com/owner/repo\")\n\n# Load a private GitHub repo (automatically uses KIT_GITHUB_TOKEN if set)\nrepo = Repository(\"https://github.com/owner/private-repo\")\n\n# Or explicitly\nrepo = Repository(\"https://github.com/owner/private-repo\", github_token=\"ghp_...\")\n\n# At a specific commit, tag, or branch\n# repo = Repository(\"https://github.com/owner/repo\", ref=\"v1.2.3\")\n```\n\n```python\n# Explore a repo\nprint(repo.get_file_tree())\n# Output: [{\"path\": \"src/main.py\", \"is_dir\": False, ...}, ...]\n\nprint(repo.extract_symbols('src/main.py'))\n# Output: [{\"name\": \"main\", \"type\": \"function\", \"file\": \"src/main.py\", ...}, ...]\n\n# Access git metadata\nprint(f\"Current SHA: {repo.current_sha}\")\nprint(f\"Branch: {repo.current_branch}\")\n\n# Read one file\nmain_py = repo.get_file_content(\"src/main.py\")\n\n# Read many files in one round-trip\ncontents = repo.get_file_content([\n    \"src/main.py\",\n    \"src/utils/helper.py\",\n    \"tests/test_main.py\",\n])\nprint(contents[\"src/utils/helper.py\"])\n```\n\n### Command Line Interface\n\n`kit` provides a comprehensive CLI for repository analysis and code exploration.\n\n**Repository Analysis:**\n```bash\n# Get repository file structure\nkit file-tree /path/to/repo\n\n# Extract symbols (functions, classes, etc.)\nkit symbols /path/to/repo --format table\n\n# Search for code patterns\nkit search /path/to/repo \"def main\" --pattern \"*.py\"\n\n# Find symbol usages\nkit usages /path/to/repo \"MyClass\"\n\n# Export data for external tools\nkit export /path/to/repo symbols symbols.json\n```\n\n**PR Reviews:**\n```bash\n# Initialize configuration\nkit review --init-config\n\n# Review GitHub PRs\nkit review --dry-run https://github.com/owner/repo/pull/123\nkit review https://github.com/owner/repo/pull/123\n\n# Review local git diffs (no PR required!)\nkit review main..feature  # Compare branches\nkit review HEAD~3..HEAD   # Review last 3 commits\nkit review --staged       # Review staged changes\n```\n\n**PR Summaries:**\n```bash\n# Generate PR summaries for quick triage\nkit summarize https://github.com/owner/repo/pull/123\nkit summarize --update-pr-body https://github.com/owner/repo/pull/123\n```\n\n**Commit Messages:**\n```bash\n# Generate intelligent commit messages from staged changes\ngit add .  # Stage your changes first\nkit commit  # Analyze and commit with AI-generated message\n```\n\n**Package Search** (requires Chroma API key):\n```bash\nkit package-search-grep numpy \"def.*fft\" --max-results 10  # Plain grep-style output\nkit package-search-grep numpy \"def.*fft\" --json           # Structured JSON output\nkit package-search-hybrid django \"authentication middleware\"\nkit package-search-read requests \"requests/models.py\"\n```\n\nSee the [CLI Documentation](https://kit.cased.com/introduction/cli) for comprehensive usage examples.\n\n## Key Toolkit Capabilities\n\n`kit` helps your apps and agents understand and interact with codebases, with components to build your own AI-powered developer tools.\n\n*   **Explore Code Structure:**\n    *   High-level view with `repo.get_file_tree()` to list all files and directories. You can also pass a subdirectory for a more limited scan.\n    *   Dive down with `repo.extract_symbols()` to identify functions, classes, and other code constructs, either across the entire repository or within a single file.\n    *   Use `repo.extract_symbols_incremental()` to get fast, cache-aware symbol extraction—best when dealing with small changes to repositories.\n\n*   **Pinpoint Information:**\n    *   Run fast regular expression searches across your codebase using `repo.search_text()` (automatically uses [ripgrep](https://github.com/BurntSushi/ripgrep) when available for 10x speedup).\n    *   Track specific symbols (like a function or class) with `repo.find_symbol_usages()`.\n    *   Find code by structure with AST-based pattern matching (async functions, try blocks, class inheritance, etc.).\n\n*   **Prepare Code for LLMs \u0026 Analysis:**\n    *   Break down large files into manageable pieces for LLM context windows using `repo.chunk_file_by_lines()` or `repo.chunk_file_by_symbols()`.\n    *   Get the full definition of a function or class off a line number within it using `repo.extract_context_around_line()`.\n\n*   **Generate Code Summaries:**\n    *   Use LLMs to create natural language summaries for files, functions, or classes using the `Summarizer` (e.g., `summarizer.summarize_file()`, `summarizer.summarize_function()`).\n    *   Build a searchable index of these AI-generated docstrings with `DocstringIndexer` and query it with `SummarySearcher` for intelligent code discovery.\n\n*   **Analyze Code Dependencies:**\n    *   Map import relationships between modules using `repo.get_dependency_analyzer()` to understand your codebase structure.\n    *   Generate dependency reports and LLM-friendly context with `analyzer.generate_dependency_report()` and `analyzer.generate_llm_context()`.\n\n*   **Search Package Source Code (via Chroma):**\n    *   Search through popular package source code using `ChromaPackageSearch` for regex patterns and semantic queries.\n    *   Access source code from packages like numpy, django, fastapi, pandas, and more.\n    *   Integrated into kit-dev MCP for seamless package exploration in AI assistants.\n\n*   **Repository Versioning \u0026 Historical Analysis:**\n    *   Analyze repositories at specific commits, tags, or branches using the `ref` parameter.\n    *   Compare code evolution over time, work with diffs, ensure reproducible analysis results\n    *   Access git metadata including current SHA, branch, and remote URL with `repo.current_sha`, `repo.current_branch`, etc.\n\n*   **Multi-Repository Analysis:**\n    *   Analyze multiple repositories together with `MultiRepo` for microservices, monorepos, or team projects.\n    *   Unified search, symbol lookup, and dependency auditing across all repos.\n    *   CLI support: `kit multi search`, `kit multi deps`, `kit multi summary`.\n\n## MCP Server (kit-dev MCP)\n\n`kit` includes an enhanced MCP (Model Context Protocol), **kit-dev**, designed especially for individual local dev work. It includes kit's production-grade code intelligence and context building, and adds in multi-source documentation research and package searching.\n\n**Environment Variables:** `OPENAI_API_KEY`, `OPENAI_BASE_URL` (for proxies/custom endpoints), `ANTHROPIC_API_KEY`\n\n**[→ Full kit-dev MCP Documentation](https://kit-mcp.cased.com)**\n\n## kit-powered Features \u0026 Utilities\n\nAs both demonstrations of this library, and as standalone products,\n`kit` ships with MIT-licensed, CLI-based pull request review and summarization features.\n\n### PR Reviews\n\nThe pull request reviewer ranks with the better closed-source paid options, but at \na fraction of the cost with cloud models. At Cased we use `kit` extensively\nwith models like Sonnet 4 and gpt4.1, paying just for the price of tokens.\n\n```bash\nkit review --init-config\nkit review https://github.com/owner/repo/pull/123\n```\n\n**[→ Complete PR Reviewer Documentation](src/kit/pr_review/README.md)**\n\n### PR Summaries\n\nFor quick PR triage and understanding, `kit` includes a fast, cost-effective PR summarization feature.\nPerfect for teams that need to quickly understand what PRs do before deciding on detailed review.\n\n```bash\nkit summarize https://github.com/owner/repo/pull/123\nkit summarize --update-pr-body https://github.com/owner/repo/pull/123\n```\n\n**Key Features:**\n- **5-10x cheaper** than full reviews (~$0.005-0.02 vs $0.01-0.05+)\n- **Fast triage**: Quick overview of changes, impact, and key modifications\n\n### Commit Messages\n\nGenerate intelligent commit messages from staged changes using the same repository intelligence:\n\n```bash\ngit add .       # Stage your changes\nkit commit      # Analyze and commit with AI-generated message\n```\n\n## Documentation\n\n**[Full Documentation](https://kit.cased.com)** - Detailed usage, advanced features, and practical examples.\nFull REST documentation is also available.\n\n**[kit-dev MCP Documentation](https://kit-mcp.cased.com)** - Complete guide for the enhanced MCP server\n\n**[Changelog](https://kit.cased.com/changelog)** - Track all changes and improvements across kit releases\n\n## License\n\nMIT License\n\n## Contributing\n\n- **Local Development**: Check out our [Running Tests](https://kit.cased.com/development/running-tests) guide to get started with local development.\n- **Project Direction**: See our [Roadmap](https://kit.cased.com/development/roadmap) for future plans and focus areas.\n\nTo contribute, fork the repository, make your changes, and submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcased%2Fkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcased%2Fkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcased%2Fkit/lists"}