Skip to main content

Code analysis and security review CLI for LLMs

Project description

CodeSight

Code analysis CLI — reviews, bugs, docs, and refactoring from your terminal.

CodeSight sends your code to LLMs (OpenAI, Anthropic, Google Vertex AI, Ollama, or any OpenAI-compatible endpoint) with structured prompts 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
Custom (OpenAI-compatible) OpenRouter, Groq, Together AI, Mistral, xAI (Grok), Fireworks, DeepSeek, Perplexity, Cerebras, Cohere, Azure AI Foundry, or any OpenAI-compatible URL codesight config -> Custom, or base_url + API key in ~/.codesight/config.json

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
codesight review my_file.py --provider openrouter  # any OpenAI-compatible endpoint you saved in config

Custom OpenAI-compatible providers (OpenRouter, Groq, Together, Mistral, xAI, Fireworks, DeepSeek, Perplexity, Cerebras, Cohere, Azure AI Foundry) are set up through the wizard:

codesight config
# Select: Custom (OpenRouter / Groq / Together / any OpenAI-compat)
# Pick a preset or enter a custom base URL, save under a label (e.g. "openrouter")
codesight review my_file.py --provider openrouter

Architecture

codesight/
├── cli.py              # CLI entry point (argparse)
├── analyzer.py         # Core analysis engine
├── config.py           # Config management (~/.codesight/)
├── compression.py      # Context compression / code maps
├── streaming.py        # Streaming output (OpenAI, Anthropic, Ollama)
├── templates.py        # Custom prompt templates
├── pipeline.py         # Multi-model triage → verify pipeline
├── sarif.py            # SARIF output for CI/CD
├── benchmark.py        # LLM benchmark runner
├── cost.py             # Token cost tracking
└── providers/
    ├── base.py
    ├── factory.py
    ├── openai_provider.py
    ├── anthropic_provider.py
    ├── google_provider.py
    ├── ollama_provider.py
    └── custom_provider.py    # OpenAI-compatible adapter (OpenRouter, Groq, Azure, etc.)

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
  • OpenAI-compatible providers (OpenRouter, Groq, Azure, 10+ presets)
  • Publish to PyPI
  • VS Code extension (scaffold)
  • VS Code Marketplace publish
  • Web dashboard
  • Pre-commit hook integration
  • .codesight.yml per-project config

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.3.0.tar.gz (40.4 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.3.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codesight-0.3.0.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codesight-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f1cbae9ea5a1e6335b2c60f682d4685c96a068e0e99762204dfd2de24809781d
MD5 2f477b50f6768cf2e204140f7537654b
BLAKE2b-256 6ab209dcfa61f714170310074e3159217d5d3a609f00d9b7b9824cc927ed143d

See more details on using hashes here.

Provenance

The following attestation bundles were made for codesight-0.3.0.tar.gz:

Publisher: publish.yml on AvixoSec/codesight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: codesight-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codesight-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 351520111fb5958d0929ca03bbc1dc3691e898830cf37c373b53278c951e722d
MD5 92d893b6ae379210b112981b3b1b9985
BLAKE2b-256 3bf6e17c5dfc4cbe63f84db7dafa9f53e4f2b81279376cfa1d18de5398d333cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for codesight-0.3.0-py3-none-any.whl:

Publisher: publish.yml on AvixoSec/codesight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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