Metadata-Version: 2.5
Name: node-walk
Version: 0.1.0
Summary: Semantic code intelligence — local-first graph of your codebase for humans and LLMs
Author: CodeGraph Contributors
License: MIT
License-File: LICENSE
Keywords: code-analysis,developer-tools,llm,semantic-graph
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: tree-sitter-python>=0.23.0
Requires-Dist: tree-sitter>=0.23.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# CodeGraph

**Semantic code intelligence for humans and LLMs.**

Local-first · Lightweight · Python first · SQLite backed

---

## Quickstart

### 1. Install & Setup
```bash
# Clone and setup the environment
git clone <repo-url> CodeGraph
cd CodeGraph
python -m venv .venv
.venv\Scripts\activate     # Windows (or source .venv/bin/activate on Unix)
pip install -e ".[dev]"
```

### 2. Indexing and Querying
All CLI commands discover the graph database by searching for a `.node_walk/` directory in the current directory or walking up parent directories.

**To index any directory:**
```bash
# Activate CodeGraph venv, then go to the repository you want to index
cd /path/to/your/project
node_walk index .
```

**Run queries within that project's directory:**
```bash
# Find a symbol
node_walk find UserService

# See its definition
node_walk definition UserService

# Find callers (shows interactive picker if multiple symbols match)
node_walk callers UserService.create_user

# Trace outgoing dependencies (out-edges)
node_walk trace UserService.create_user --depth 5

# Blast radius (in-edges - what breaks if this changes?)
node_walk blast-radius UserService.create_user

# View source code of a symbol
node_walk source UserService.create_user

# Graph statistics
node_walk stats

# Export to JSON
node_walk export --output graph.json
```


## Architecture

```
Repository → Language Analysis → Code IR → SQLite Graph → Query Engine → CLI
```

- **Language analysis**: Tree-sitter based Python parser
- **Code IR**: Pydantic v2 models — Symbol, Relationship, FileInfo
- **Storage**: SQLite with 10 indexes, WAL mode
- **Query engine**: Pure SQLite including recursive CTEs for graph traversal
- **CLI**: Typer + Rich

## Development

```bash
python -m venv .venv
.venv\Scripts\activate     # Windows
pip install -e ".[dev]"
pytest tests/ -v
```

## Graph data

Stored in `.node_walk/graph.db` inside the indexed repository.
Safe to delete and re-index at any time.
