Skip to main content

AI-powered code analysis and security review CLI

Project description

CodeSight

AI-powered code analysis CLI — reviews, bugs, docs, and refactoring from your terminal.

CodeSight sends your code to LLMs (OpenAI, Anthropic, Google Vertex AI) with structured prompts tuned for code review, bug detection, security analysis, documentation, and refactoring. Multi-provider, configurable, works with any language.

PyPI CI Python 3.10+ License: MIT Docs Downloads Ruff


What it does

  • codesight review — code review with severity-tagged issues (crit/warn/info)
  • codesight bugs — find logic errors, race conditions, resource leaks
  • codesight security — security audit with CWE IDs and OWASP mapping
  • codesight scan . — scan an entire directory with progress bar
  • codesight docs — auto-generate docstrings and module docs
  • codesight explain — plain-language breakdown of complex code
  • codesight refactor — refactoring suggestions with before/after diffs

Demo

CodeSight terminal demo

Quick Start

# Install
pip install codesight

# Configure your provider
codesight config

# Run a review
codesight review src/main.py

# Detect bugs
codesight bugs lib/parser.py

# Scan a whole project
codesight scan . --task review
codesight scan src/ --ext .py .js

# Generate docs
codesight docs utils/helpers.py

Provider Support

Provider Models Setup
OpenAI GPT-5.4, GPT-5.3-Codex OPENAI_API_KEY
Anthropic Claude Opus 4.6, Claude Sonnet 4.6 ANTHROPIC_API_KEY
Google Vertex AI Gemini 3.1 Pro, Gemini 3.1 Flash GOOGLE_CLOUD_PROJECT + ADC
Ollama (local) Llama 3, CodeLlama, Mistral, etc. Just run ollama serve

Configuration

CodeSight stores config in ~/.codesight/config.json. You can configure it interactively:

codesight config

Or set environment variables:

export OPENAI_API_KEY="sk-..."
export CODESIGHT_MODEL="gpt-5.4"
codesight review my_file.py

Switch providers on the fly:

codesight review my_file.py --provider anthropic
codesight bugs my_file.py --provider google
codesight explain my_file.py --provider openai
codesight review my_file.py --provider ollama  # fully offline, no data leaves your machine

Architecture

codesight/
├── __init__.py
├── __main__.py
├── cli.py
├── config.py
├── analyzer.py
└── providers/
    ├── base.py
    ├── factory.py
    ├── openai_provider.py
    ├── anthropic_provider.py
    ├── google_provider.py
    └── ollama_provider.py

Development

git clone https://github.com/AvixoSec/codesight.git
cd codesight
pip install -e ".[dev]"
pytest tests/ -v
ruff check codesight/

Roadmap

  • codesight scan . — analyze a whole directory
  • Ollama support — fully offline analysis with local models
  • codesight security — dedicated security audit with CWE IDs and OWASP mapping
  • codesight diff — review only git-changed files
  • SARIF output — standard format for GitHub Security tab
  • Exit codes for CI/CD (0 = clean, 1 = warnings, 2 = critical)
  • GitHub Action — auto-scan PRs with SARIF upload
  • Multi-model pipeline — fast triage + deep verification
  • Cost tracking per query
  • codesight benchmark — test LLMs on vulnerable codebases
  • Context compression — code maps to reduce token usage
  • Streaming output for large files
  • Custom prompt templates
  • Publish to PyPI
  • VS Code extension
  • Web dashboard

License

MIT — see LICENSE.

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

codesight-0.2.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

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

codesight-0.2.0-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file codesight-0.2.0.tar.gz.

File metadata

  • Download URL: codesight-0.2.0.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for codesight-0.2.0.tar.gz
Algorithm Hash digest
SHA256 98a6d9214c6a9ca1f545f8bd78afa2bda4425c59fa6d9d0f764aed7b27342d82
MD5 8ffdf57e4bf99ca1f58673406b6fe2e8
BLAKE2b-256 2d93234fcb7fe3af8107c7a4efa7c6ef49cd5df31545a55a9aa507789ce371d3

See more details on using hashes here.

File details

Details for the file codesight-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: codesight-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for codesight-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5ba9c478efd4868027f0f8d39925df9a8552ee2876c7819be96bc2ad983cfe5
MD5 ed6ad979c0e075ed5c23ae0278fe42ec
BLAKE2b-256 8c7bd9d4d2f2b06a4d21c703dfb9204e7cbf198b2dc781d2a9c9f9e498b8e15b

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