Code analysis CLI — reviews, bugs, docs, and refactoring from your terminal.
CodeSight connects to LLM APIs (OpenAI, Anthropic, Google) for code review, bug hunting, docs, and refactoring. Works with any language.
codesight review— code review with severity-tagged issues (crit/warn/info)codesight bugs— find logic errors, race conditions, resource leakscodesight 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
$ codesight review auth/login.py
╭──────────────────────────────────────────────────────────╮
│ CodeSight REVIEW OpenAI (gpt-5.4) │
│ 1,247 tokens │
╰──────────────────────────────────────────────────────────╯
## Summary
Authentication module with 3 issues found.
## Issues
[crit] ln 42 — JWT secret is hardcoded: SECRET = "admin123"
[crit] ln 87 — f-string in SQL query → injection risk
[warn] ln 15 — hashlib imported but never used
## Suggestions
- Move JWT secret to environment variable
- Use parameterized queries for all SQL operations
- Remove unused import to reduce attack surface
# 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 | 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 |
CodeSight stores config in ~/.codesight/config.json. You can configure it interactively:
codesight configOr set environment variables:
export OPENAI_API_KEY="sk-..."
export CODESIGHT_MODEL="gpt-5.4"
codesight review my_file.pySwitch providers on the fly:
codesight review my_file.py --provider anthropic
codesight bugs my_file.py --provider google
codesight explain my_file.py --provider openaicodesight/
├── __init__.py
├── __main__.py
├── cli.py
├── config.py
├── analyzer.py
└── providers/
├── base.py
├── factory.py
├── openai_provider.py
├── anthropic_provider.py
└── google_provider.py
git clone https://github.com/AvixoSec/codesight.git
cd codesight
pip install -e ".[dev]"
pytest tests/ -v
ruff check codesight/-
codesight scan .— analyze a whole directory -
codesight diff— review only git-changed files - Context compression — code maps to reduce token usage
- Exit codes for CI/CD (0 = clean, 1 = warnings, 2 = critical)
- Streaming output for large files
- Cost tracking per query
- GitHub Action
- Custom prompt templates
- Publish to PyPI
MIT — see LICENSE.