Metadata-Version: 2.4
Name: codespine
Version: 0.1.3
Summary: Local Java code intelligence indexer backed by a graph database
Author: CodeSpine contributors
License: MIT License
        
        Copyright (c) 2026 CodeSpine contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/vinayak3022/codeSpine
Project-URL: Repository, https://github.com/vinayak3022/codeSpine
Project-URL: Issues, https://github.com/vinayak3022/codeSpine/issues
Keywords: java,code-indexing,graph,kuzu,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Requires-Dist: kuzu
Requires-Dist: tree-sitter
Requires-Dist: tree-sitter-java
Requires-Dist: fastmcp
Requires-Dist: psutil
Requires-Dist: watchfiles
Provides-Extra: ml
Requires-Dist: sentence-transformers; extra == "ml"
Requires-Dist: numpy; extra == "ml"
Provides-Extra: community
Requires-Dist: igraph; extra == "community"
Requires-Dist: leidenalg; extra == "community"
Provides-Extra: full
Requires-Dist: sentence-transformers; extra == "full"
Requires-Dist: numpy; extra == "full"
Requires-Dist: igraph; extra == "full"
Requires-Dist: leidenalg; extra == "full"
Dynamic: license-file

# CodeSpine

CodeSpine is an intelligence layer for Java teams and AI coding agents.
It maps your codebase into a live graph so you can find anything fast, predict change impact, and ship safer refactors.

## Installation

```bash
pip install codespine
```

## Quick Start

```bash
codespine analyse .
codespine search "payment retry bug" --json
codespine context "processPayment" --json
codespine impact "com.example.Service#processPayment(java.lang.String)" --json
```

Example analyze output:

```text
$ codespine analyse .
Walking files...               142 files found
Parsing code...                142/142
Tracing calls...               847 calls resolved
Analyzing types...             234 type relationships
Detecting communities...       8 clusters found
Detecting execution flows...   34 processes found
Finding dead code...           12 unreachable symbols
Analyzing git history...       18 coupled file pairs
Generating embeddings...       623 vectors stored

Done in 4.2s - 623 symbols, 1847 edges, 8 clusters, 34 flows
```

## What You Get

- Hybrid search: BM25 + semantic vectors + fuzzy + RRF
- Impact analysis: depth groups with confidence scoring
- Java-aware dead code detection with exemption passes
- Execution flow tracing from entry points
- Community detection (Leiden + fallback)
- Git change coupling analysis
- Watch mode incremental reindexing
- Symbol-level branch diff

## Key Commands

- `codespine analyse <path> [--full|--incremental]`
- `codespine search <query> [--k 20] [--json]`
- `codespine context <query> [--max-depth 3] [--json]`
- `codespine impact <symbol> [--max-depth 4] [--json]`
- `codespine deadcode [--limit 200] [--json]`
- `codespine flow [--entry <symbol>] [--max-depth 6] [--json]`
- `codespine community [--symbol <symbol>] [--json]`
- `codespine coupling [--months 6] [--min-strength 0.3] [--min-cochanges 3] [--json]`
- `codespine diff <base>..<head> [--json]`
- `codespine watch [--path .] [--global-interval 30]`

## MCP Setup (`mcp.json`)

```json
{
  "mcpServers": {
    "codespine": {
      "command": "codespine",
      "args": ["mcp"]
    }
  }
}
```

## Runtime Paths

- `~/.codespine_db`
- `~/.codespine.pid`
- `~/.codespine.log`
- `~/.codespine_embedding_cache.sqlite3`

## Project Docs

- [`.github/CONTRIBUTING.md`](.github/CONTRIBUTING.md)
- [`.github/SECURITY.md`](.github/SECURITY.md)
- [`.github/CODE_OF_CONDUCT.md`](.github/CODE_OF_CONDUCT.md)
