AI-assisted code review for local projects and public GitHub repositories.
CodeSentry is an interactive terminal agent and desktop-ready review system that scans source code, detects supported languages, runs a safe AI review pipeline, suggests fixes, and generates structured Markdown reports.
CodeSentry is designed as a language-agnostic code review system with initial support for Python, JavaScript, TypeScript, Java, C/C++, Rust, and Go, and an extensible architecture for adding more languages later.
Most code review tools are either static linters or chatbots. CodeSentry sits in the middle: it behaves like a coding agent, but keeps the review engine reusable, testable, and safe.
You can use it from:
- An interactive terminal agent
- A local FastAPI backend
- A Tauri desktop app
All interfaces call the same Python core engine.
- Interactive terminal session with natural-language commands
- Local project review
- Public HTTPS GitHub repository review
- Temporary GitHub clone workspace with cleanup
- Multi-language scanning and language detection
- Language-aware review prompts
- Six-stage LangGraph review pipeline
- Mock, OpenAI, Anthropic, Gemini, Ollama, and NVIDIA provider abstraction
- Markdown report generation
- Local-only FastAPI backend for desktop integration
- Tauri v2 desktop frontend in development mode
- Safe Review Mode by default
| Language | Extensions |
|---|---|
| Python | .py |
| JavaScript | .js, .jsx, .mjs, .cjs |
| TypeScript | .ts, .tsx |
| Java | .java |
| C | .c, .h |
| C++ | .cpp, .cc, .cxx, .hpp, .hh, .hxx |
| Rust | .rs |
| Go | .go |
Language detection is extension-based first, with project config hints such as package.json, tsconfig.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, and CMakeLists.txt.
CodeSentry runs in Safe Review Mode.
It does not:
- Execute reviewed project code
- Install dependencies
- Run tests, package scripts, build tools, or pre-commit hooks
- Compile C/C++/Rust/Go/Java projects
- Modify source files
- Auto-apply fixes
- Ask for GitHub tokens
- Delete user project directories
- Send huge files blindly to cloud LLM providers
It does:
- Read supported source files
- Skip generated, minified, binary, lock, and oversized files
- Clone only validated public HTTPS GitHub repositories
- Use temporary workspaces for cloned repositories
- Ask before saving reports
- Warn before using cloud LLM providers
Install dependencies with uv:
uv syncRun the terminal agent with the offline mock provider:
uv run codesentry --provider mockReview the current project:
CodeSentry > scan this project
CodeSentry > show language breakdown
CodeSentry > review all supported languages
CodeSentry > generate markdown report
CodeSentry > exit
- Python 3.10+
uv- Git
- Optional: Ollama for local model review
- Optional for desktop development: Node.js,
pnpm, Rust, and Cargo
Copy .env.example to .env and configure your provider:
CODESENTRY_PROVIDER=mock
CODESENTRY_MODEL=
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GOOGLE_API_KEY=
GEMINI_API_KEY=
NVIDIA_API_KEY=
OLLAMA_BASE_URL=http://localhost:11434
NVIDIA_BASE_URL=Provider priority:
- Launch argument
- Environment variable
mock
Launch CodeSentry:
uv run codesentry --provider mockLaunch with a specific project:
uv run codesentry --path . --provider mockLaunch with a cloud provider:
uv run codesentry --provider openai --model gpt-4o-miniExample session:
CodeSentry > scan this project
CodeSentry > show language breakdown
CodeSentry > review only TypeScript
CodeSentry > find bugs in Rust files
CodeSentry > suggest fixes
CodeSentry > show high severity bugs
CodeSentry > generate markdown report
CodeSentry > exit
Slash shortcuts are available for common actions:
/help
/languages
/scan
/review
/review --language typescript
/bugs --language rust
/fix --language go
/report
/files
/skipped
/unsupported
/findings
/provider
/model
/clear
/exit
CodeSentry can review public GitHub repositories without GitHub tokens.
Supported URL formats:
https://github.com/user/repo
https://github.com/user/repo.git
Example:
CodeSentry > review this repo https://github.com/user/project
CodeSentry > review branch dev of https://github.com/user/project
CodeSentry > show repo info
CodeSentry > generate report
CodeSentry > cleanup repo
GitHub review rules:
- Public HTTPS repositories only
- No SSH URLs
- No private repo authentication
- No dependency installation
- No code execution
- Temporary clone workspace by default
- Safe cleanup through the workspace manager
If a repository has no supported files, CodeSentry reports that clearly instead of failing.
MockProvider is the default safe option for local testing. It requires no API key and sends no code anywhere.
uv run codesentry --provider mockOllama is the local/offline model option.
ollama serve
uv run codesentry --provider ollama --model qwen2.5-coderOther model names such as llama3, codellama, and deepseek-coder can be used if they are available locally.
OPENAI_API_KEY=...
uv run codesentry --provider openai --model gpt-4o-miniANTHROPIC_API_KEY=...
uv run codesentry --provider anthropic --model claude-3-5-haiku-latestGOOGLE_API_KEY=...
uv run codesentry --provider gemini --model gemini-1.5-flashGEMINI_API_KEY is also supported.
NVIDIA_API_KEY=...
uv run codesentry --provider nvidia --model meta/llama-3.1-70b-instructSet NVIDIA_BASE_URL when using a custom NVIDIA-compatible endpoint.
When using OpenAI, Anthropic, Gemini, or NVIDIA, selected source code snippets may be sent to the selected external LLM provider for analysis. CodeSentry shows a confirmation prompt before cloud-provider review.
MockProvider sends no code anywhere. Ollama keeps model execution local.
CodeSentry includes a Tauri v2 desktop app that uses the same Python core engine through a local FastAPI backend.
Start the backend:
uv run codesentry-apiStart the desktop app:
cd desktop
pnpm install
pnpm tauri devThe desktop app connects to:
http://127.0.0.1:8765
Desktop features:
- Dashboard
- Local folder selection
- GitHub repository input
- Provider and model settings
- Language selection
- Review progress
- Results grouped by severity, language, and file
- Markdown report export
- Review history metadata
Production sidecar packaging is planned. The current desktop flow is development mode.
The local API wraps the shared CodeSentry engine for desktop and future integrations.
Run:
uv run codesentry-apiCore endpoints:
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/health |
Backend health check |
GET |
/providers |
List supported providers |
POST |
/config/provider |
Set provider and model |
POST |
/project/local |
Set local project |
POST |
/project/github |
Validate and prepare GitHub repo |
POST |
/scan |
Scan selected project |
POST |
/review |
Start review job |
GET |
/review/{job_id}/status |
Poll job status |
GET |
/review/{job_id}/result |
Fetch review result |
POST |
/report/export |
Export Markdown report |
GET |
/history |
Get review history |
The API binds to 127.0.0.1 only.
CodeSentry keeps interfaces separate from the review engine.
Terminal UI
Desktop UI
FastAPI API
|
v
Shared Python Core Engine
|
v
Project Loader / Repo Manager
|
v
Language-Aware Scanner and Reader
|
v
LangGraph Six-Agent Pipeline
|
v
LLM Provider Abstraction
|
v
Markdown Report Generator
Six-agent pipeline:
Scanner Agent
-> Reader Agent
-> Reviewer Agent
-> Bug Detector Agent
-> Fix Suggester Agent
-> Report Agent
The Rust desktop frontend does not reimplement scanning, cloning, language detection, LLM provider calls, review logic, or report generation.
codesentry/
agents/ Six review pipeline agents
api/ Local FastAPI backend for desktop integration
cli/ Typer launch commands
core/ Reusable scanner, engine, repo, language, and report logic
llm/ Provider abstraction and provider implementations
models/ Pydantic schemas
prompts/ Language-aware prompt templates
tui/ Interactive terminal interface
utils/ Shared utilities
desktop/
src/ React + TypeScript frontend
src-tauri/ Tauri v2 Rust command layer
docs/
desktop_architecture.md
tests/
Python backend and engine tests
Important files:
codesentry/core/engine.py: shared review enginecodesentry/core/pipeline.py: LangGraph pipelinecodesentry/core/scanner.py: language-aware scannercodesentry/core/repo_manager.py: safe GitHub clone managercodesentry/core/report_generator.py: Markdown reportscodesentry/tui/app.py: terminal appcodesentry/api/routes.py: local API routesdesktop/src/App.tsx: desktop frontend shelldesktop/src-tauri/src/commands.rs: Tauri command bridge
Reports are written only after user request or confirmation.
Default examples:
reports/codesentry_report.md
reports/github_user_project_codesentry_report.md
Reports include:
- Project or repository metadata
- Provider and model
- Supported languages reviewed
- Language breakdown
- Files scanned
- Skipped and unsupported files
- Code quality findings
- Bug findings
- Fix suggestions
- Cross-language observations
- Final recommendation
- Tool metadata
Run the Python test suite:
uv run pytestRun frontend checks:
cd desktop
pnpm install
pnpm buildThe test suite is designed to work without real API keys by using MockProvider.
Contributions are welcome.
Good first contribution areas:
- Bug fixes
- Tests
- Documentation improvements
- UI polish
- Prompt improvements
- Additional provider error handling
- Safer scanner edge cases
- Desktop development-mode improvements
Development workflow:
- Fork the repository.
- Create a feature branch.
- Install Python dependencies with
uv sync. - Use MockProvider for local testing.
- Run
uv run pytest. - If editing the desktop app, run
pnpm buildinsidedesktop/. - Open a pull request with a clear description and test notes.
Please keep these rules in mind:
- Do not move review logic into the terminal UI or desktop UI.
- Keep the Python core engine as the source of truth.
- Do not add code execution, dependency installation, or auto-fix behavior without a separate safety design.
- Do not log API keys.
- Do not store source code in history by default.
- Add focused tests for scanner, engine, API, provider, and UI changes.
Optional future .codesentry.toml shape:
provider = "ollama"
model = "qwen2.5-coder"
max_file_size_kb = 200
max_lines_per_chunk = 250
review_languages = ["python", "typescript", "rust"]
ignore_generated = true
ignore_minified = true
output = "reports/codesentry_report.md"Current known limitations:
- Language detection is extension and config based.
- CodeSentry does not compile or execute code.
- Findings are AI-assisted static review findings, not compiler-grade guarantees.
- Private GitHub repository authentication is not implemented.
- Production desktop sidecar packaging is not implemented yet.
- PDF export is planned, but Markdown export is the supported report format.
- Phase 1: Interactive terminal agent and reusable Python core engine
- Phase 2: Public GitHub repository review
- Phase 3: Language-aware multi-language review
- Phase 4: Tauri desktop app with local backend integration
- Future: production sidecar packaging
- Future: private repository authentication
- Future: AST-based analysis with Tree-sitter
- Future: optional PDF export
- Future: carefully designed auto-fix workflow
This project is intended to be open source. Add a LICENSE file before public release so contributors know the exact terms.