Skip to content

Conversation

@tnm
Copy link
Contributor

@tnm tnm commented Dec 9, 2025

Summary

Add MultiRepo class for unified analysis across multiple repositories - ideal for microservices, frontend/backend splits, and team projects.

Proposed API

from kit import MultiRepo

# Initialize with multiple repo paths
repos = MultiRepo([
    "~/code/frontend",
    "~/code/backend",
    "~/code/shared-lib",
])

# Access
repos.names                              # list of repo names
repos.repos                              # Dict[str, Repository]
repos["frontend"]                        # Get single Repository
for name, repo in repos: ...             # Iterate

# Text search
repos.search("handleAuth")
repos.search("TODO", file_pattern="*.py", max_results_per_repo=10)

# Semantic search (most valuable for multi-repo!)
repos.index_all(embed_fn=model.encode)   # Build indexes once
repos.search_semantic("authentication and session management", top_k=10)

# Symbol operations  
repos.find_symbol("UserModel", symbol_type="class")
repos.extract_all_symbols(symbol_type="function")

# Auditing & summaries
repos.audit_dependencies()               # Python, JS, Rust, Go
repos.summarize()                        # File counts, languages

# File access
repos.get_file_content("frontend", "src/App.tsx")

CLI Commands

kit multi search ~/frontend ~/backend -q "handleAuth"
kit multi symbols ~/frontend ~/backend -n "UserModel" -t class
kit multi deps ~/frontend ~/backend ~/shared-lib
kit multi summary ~/project-*

Changes

  • src/kit/multi_repo.py - Core MultiRepo class (~400 lines)
  • src/kit/cli.py - CLI commands
  • tests/test_multi_repo.py - 26 tests
  • docs/src/content/docs/api/multi-repo.mdx - Full API docs
  • Brief references in README and usage guide

Test plan

  • 26 unit tests passing
  • ruff check passing
  • mypy passing
  • Manual testing with real repos

tnm added 8 commits December 8, 2025 18:32
Enables unified analysis across multiple codebases with:
- Unified text search (grep) across repos
- Semantic search with merged, relevance-ranked results
- Cross-repo symbol extraction and lookup
- Dependency auditing (Python, JS, Rust, Go)
- Repository summaries with language detection

Useful for microservices, frontend/backend splits, and
finding patterns across team repositories.
CLI commands (kit multi <cmd>):
- search: Text/regex search across repos
- symbols: Find or list symbols across repos
- deps: Audit dependencies (Python, JS, Rust, Go)
- summary: File counts and language detection

Tests expanded from 11 to 26, covering:
- Custom repo names
- File pattern filtering
- Class symbol extraction
- Go dependency parsing
- Mixed language auditing
- TypeScript/Rust detection
- Edge cases (empty results, collisions)
- New API reference page with use cases (microservices, frontend/backend,
  team repos, dependency auditing)
- Brief reference in usage guide
- Mention in README key capabilities
@tnm tnm marked this pull request as ready for review December 9, 2025 03:57
@tnm tnm changed the title WIP: Add MultiRepo for multi-repository analysis Add MultiRepo for multi-repository analysis Dec 9, 2025
@tnm tnm merged commit 81eeb62 into main Dec 9, 2025
2 checks passed
tnm added a commit that referenced this pull request Dec 9, 2025
Add entries for:
- MultiRepo multi-repository analysis (#164)
- Rust dependency analyzer (#163)
- JavaScript/TypeScript dependency analyzer (#159)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants