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.
What it does
codesight review— code review with severity-tagged issues (crit/warn/info)codesight bugs— find logic errors, race conditions, resource leakscodesight security— security audit with CWE IDs and OWASP mappingcodesight scan .— scan an entire directory with progress barcodesight docs— auto-generate docstrings and module docscodesight explain— plain-language breakdown of complex codecodesight refactor— refactoring suggestions with before/after diffs
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.ymlper-project config
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1cbae9ea5a1e6335b2c60f682d4685c96a068e0e99762204dfd2de24809781d
|
|
| MD5 |
2f477b50f6768cf2e204140f7537654b
|
|
| BLAKE2b-256 |
6ab209dcfa61f714170310074e3159217d5d3a609f00d9b7b9824cc927ed143d
|
Provenance
The following attestation bundles were made for codesight-0.3.0.tar.gz:
Publisher:
publish.yml on AvixoSec/codesight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codesight-0.3.0.tar.gz -
Subject digest:
f1cbae9ea5a1e6335b2c60f682d4685c96a068e0e99762204dfd2de24809781d - Sigstore transparency entry: 1356886393
- Sigstore integration time:
-
Permalink:
AvixoSec/codesight@eb2bf63038cc262d3720de40d26a71e7c8bfabeb -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/AvixoSec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eb2bf63038cc262d3720de40d26a71e7c8bfabeb -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
351520111fb5958d0929ca03bbc1dc3691e898830cf37c373b53278c951e722d
|
|
| MD5 |
92d893b6ae379210b112981b3b1b9985
|
|
| BLAKE2b-256 |
3bf6e17c5dfc4cbe63f84db7dafa9f53e4f2b81279376cfa1d18de5398d333cd
|
Provenance
The following attestation bundles were made for codesight-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on AvixoSec/codesight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codesight-0.3.0-py3-none-any.whl -
Subject digest:
351520111fb5958d0929ca03bbc1dc3691e898830cf37c373b53278c951e722d - Sigstore transparency entry: 1356886425
- Sigstore integration time:
-
Permalink:
AvixoSec/codesight@eb2bf63038cc262d3720de40d26a71e7c8bfabeb -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/AvixoSec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eb2bf63038cc262d3720de40d26a71e7c8bfabeb -
Trigger Event:
release
-
Statement type: