Metadata-Version: 2.4
Name: pycodesage
Version: 0.2.0
Summary: Local-first CLI code intelligence tool with LangChain-powered RAG
Author: Keshav Ashiya
License: MIT
Keywords: code,ai,cli,devtools,rag,langchain
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer[all]>=0.9.0
Requires-Dist: rich>=13.7.0
Requires-Dist: langchain>=0.3.0
Requires-Dist: langchain-community>=0.3.0
Requires-Dist: langchain-ollama>=0.2.0
Requires-Dist: lancedb>=0.4.0
Requires-Dist: kuzu>=0.3.0
Requires-Dist: pyarrow>=14.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: gitpython>=3.1.0
Requires-Dist: numpy<2.0.0,>=1.26.0
Requires-Dist: pandas>=2.0.0
Provides-Extra: openai
Requires-Dist: langchain-openai>=0.1.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: langchain-anthropic>=0.1.0; extra == "anthropic"
Provides-Extra: multi-language
Requires-Dist: tree-sitter>=0.23.0; extra == "multi-language"
Requires-Dist: tree-sitter-javascript>=0.23.0; extra == "multi-language"
Requires-Dist: tree-sitter-typescript>=0.23.0; extra == "multi-language"
Requires-Dist: tree-sitter-go>=0.23.0; extra == "multi-language"
Requires-Dist: tree-sitter-rust>=0.23.0; extra == "multi-language"
Provides-Extra: mcp
Requires-Dist: mcp>=1.0.0; extra == "mcp"
Requires-Dist: starlette>=0.27.0; extra == "mcp"
Requires-Dist: uvicorn>=0.23.0; extra == "mcp"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.12.0; extra == "dev"
Requires-Dist: ruff>=0.1.8; extra == "dev"
Requires-Dist: mypy>=1.7.0; extra == "dev"
Provides-Extra: all
Requires-Dist: pycodesage[anthropic,dev,mcp,multi-language,openai]; extra == "all"
Dynamic: license-file

# CodeSage

Local-first code intelligence CLI with MCP support for Claude Desktop, Cursor, and Windsurf.

Index your codebase and search it using natural language. Everything runs locally with Ollama.
Supports Python, JavaScript, TypeScript, Go, and Rust.

## Install

```bash
pip install pycodesage
```

Or from source:

```bash
git clone https://github.com/keshavashiya/codesage.git
cd codesage
pip install -e .
```

## Requirements

**Ollama** must be running with these models:

```bash
ollama pull qwen2.5-coder:7b
ollama pull mxbai-embed-large
ollama serve
```

## Usage

```bash
# Initialize and index your project
cd your-project
codesage init
codesage index

# Search your code
codesage suggest "validate email"

# Check everything is working
codesage health
```

## MCP Setup

```json
{
  "mcpServers": {
    "codesage": {
      "command": "codesage",
      "args": ["mcp", "serve", "--global"]
    }
  }
}
```

<details>
<summary>Other MCP clients (Cursor, Windsurf)</summary>

**Cursor:** Settings → Features → MCP Servers, add same config.

**Windsurf:** Settings → MCP → Add Server. Command: `codesage`, Args: `mcp serve --global`

</details>

## Commands

```bash
codesage init           # Initialize project
codesage index          # Index codebase
codesage suggest QUERY  # Search code
codesage stats          # Show stats
codesage health         # System check
codesage review         # AI code review
codesage chat           # Interactive mode
```

<details>
<summary>More commands</summary>

```bash
# MCP
codesage mcp serve          # Start server
codesage mcp serve --global # All projects
codesage mcp test           # Test tools

# Security
codesage security scan      # Scan vulnerabilities
codesage hooks install      # Pre-commit hook

# Storage
codesage storage info       # Backend details
codesage storage stats      # Metrics

# Profile
codesage profile show       # Developer profile
codesage profile patterns   # Learned patterns
```

</details>

## Configuration

Stored in `.codesage/config.yaml`:

```yaml
project_name: my-project
languages:
  - python
  - typescript

llm:
  provider: ollama
  model: qwen2.5-coder:7b
  embedding_model: mxbai-embed-large

exclude_dirs:
  - venv
  - node_modules
  - .git
```

## Development

```bash
pip install -e ".[dev]"
pytest tests/ -v
```

## License

MIT
