Skip to main content

Local-first CLI code intelligence tool with LangChain-powered RAG

Project description

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

Recommended: pipx

We strongly recommend installing CodeSage with pipx to run it in an isolated environment.

  1. Install pipx (if not already installed):

    # macOS
    brew install pipx
    pipx ensurepath
    
    # Linux/Windows
    python3 -m pip install --user pipx
    python3 -m pipx ensurepath
    
  2. Install CodeSage:

    pipx install pycodesage
    

    Note: To add optional features later (e.g., multi-language support), use pipx inject:

    pipx inject pycodesage pycodesage[multi-language]
    

Alternative: pip

You can also install via standard pip, though this may conflict with other packages:

pip install pycodesage

Or from source:

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

Requirements

Ollama must be running with these models:

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

Usage

# 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

{
  "mcpServers": {
    "codesage": {
      "command": "codesage",
      "args": ["mcp", "serve", "--global"]
    }
  }
}
Other MCP clients (Cursor, Windsurf)

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

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

Commands

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
More commands
# 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

Configuration

Stored in .codesage/config.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

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycodesage-0.2.1.tar.gz (141.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycodesage-0.2.1-py3-none-any.whl (181.7 kB view details)

Uploaded Python 3

File details

Details for the file pycodesage-0.2.1.tar.gz.

File metadata

  • Download URL: pycodesage-0.2.1.tar.gz
  • Upload date:
  • Size: 141.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pycodesage-0.2.1.tar.gz
Algorithm Hash digest
SHA256 65a3f2eeb2085b7b537925940ecc9044047059e9db10a69312b0d038a060630b
MD5 4abd90e6e4a97f9a9f43de6ef1eadb4c
BLAKE2b-256 9ce14bbb495e3ad5257fa3f60023b709da7fd58ee7cf24aff147a5f4b038ccb4

See more details on using hashes here.

File details

Details for the file pycodesage-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pycodesage-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 181.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pycodesage-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0f9d7a8283f4852800401532c2ea09a6e316544451e6c375a293f39e4e8d043
MD5 a48d2010938c02a355922598193e49c0
BLAKE2b-256 b6b9179e7574aaa898383cdd0473dafb61a38ae0034f8e7709124151c1a8a045

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page