{"id":18798584,"url":"https://github.com/liteobject/ai-code-reviewer","last_synced_at":"2026-02-24T21:32:54.458Z","repository":{"id":247663587,"uuid":"823798460","full_name":"LiteObject/ai-code-reviewer","owner":"LiteObject","description":"AI Code Reviewer automates the code review process using AI, helping developers identify issues and improve code quality. It supports multiple languages and integrates seamlessly into development workflows, providing insightful feedback and suggestions.","archived":false,"fork":false,"pushed_at":"2025-09-01T21:26:48.000Z","size":29,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T23:27:36.236Z","etag":null,"topics":["ai","ollama","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiteObject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-03T18:33:23.000Z","updated_at":"2025-09-01T21:26:52.000Z","dependencies_parsed_at":"2024-11-07T22:12:33.696Z","dependency_job_id":null,"html_url":"https://github.com/LiteObject/ai-code-reviewer","commit_stats":null,"previous_names":["liteobject/ai-code-reviewer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LiteObject/ai-code-reviewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fai-code-reviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fai-code-reviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fai-code-reviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fai-code-reviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiteObject","download_url":"https://codeload.github.com/LiteObject/ai-code-reviewer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fai-code-reviewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29801021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T21:02:39.706Z","status":"ssl_error","status_checked_at":"2026-02-24T21:02:21.834Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ollama","python"],"created_at":"2024-11-07T22:12:25.346Z","updated_at":"2026-02-24T21:32:54.440Z","avatar_url":"https://github.com/LiteObject.png","language":"Python","readme":"# AI Code Reviewer\n\nAn intelligent code review tool that leverages AI models to analyze code files and provide detailed feedback, suggestions, and improvements. The tool integrates with GitHub APIs to review pull requests and can analyze local code files.\n\n## Features\n\n- **AI-Powered Code Reviews**: Uses Ollama with Llama3 model for intelligent code analysis\n- **Multiple Language Support**: Supports Python, TypeScript, JavaScript, and JSX files\n- **GitHub Integration**: Can analyze GitHub pull requests and commits\n- **Batch Processing**: Review entire directories with exclude filters\n- **Markdown Reports**: Generates detailed review reports in markdown format\n- **Customizable Prompts**: Structured prompt templates for consistent review quality\n\n## Prerequisites\n\n- Python 3.11+\n- [Ollama](https://ollama.ai/) installed and running locally\n- Llama3 model pulled in Ollama (`ollama pull llama3`)\n- GitHub Personal Access Token (for GitHub integration)\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/LiteObject/ai-code-reviewer.git\ncd ai-code-reviewer\n```\n\n2. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n3. Set up environment variables:\n```bash\n# Create .env file\necho \"GITHUB_TOKEN=your_github_token_here\" \u003e .env\n```\n\n4. Ensure Ollama is running:\n```bash\nollama serve\n```\n\n## Usage\n\n### Review Local Files\n\n```python\nfrom reviewer import review_file, review_files\n\n# Review a single file\nreview_file(\"path/to/your/file.py\")\n\n# Review all files in a directory\nexclude_keywords = [\"venv\", \"node_modules\", \"__pycache__\"]\nreview_files(\"path/to/directory\", exclude_keywords)\n```\n\n### GitHub Integration\n\n```python\nimport git_client as git\n\n# Get pull request data\npr_data = git.get_pull_request_data(token, owner, repo, pull_number)\n\n# Get pull request changes\npr_changes = git.get_pull_request_changes(token, owner, repo, pull_number)\n```\n\n### Run the Main Application\n\n```bash\npython app.py\n```\n\n## Project Structure\n\n```\nai-code-reviewer/\n├── app.py                 # Main application entry point\n├── reviewer.py            # Core review logic using LangChain\n├── git_client.py          # GitHub API integration\n├── file_helper.py         # File operations utilities\n├── test_git_client.py     # Manual testing script\n├── requirements.txt       # Python dependencies\n├── .env                   # Environment variables (create this)\n├── reviews/              # Generated review reports\n│   ├── REVIEW_*_BY_llama3.md\n└── test_files/           # Sample files for testing\n    ├── bad_code_examples.py\n    └── delete_folders.py\n```\n\n## Configuration\n\n### Supported File Extensions\n- `.py` (Python)\n- `.ts` (TypeScript)\n- `.js` (JavaScript)\n- `.jsx` (React JSX)\n\n### Exclude Keywords\nConfigure which directories/files to skip during batch processing:\n```python\nexclude_keywords = [\"venv\", \"Python311\", \"node_modules\", \"__pycache__\"]\n```\n\n### Ollama Configuration\nThe tool uses Ollama running on `http://localhost:11434` with the `llama3` model. You can modify these settings in `reviewer.py`:\n\n```python\nllm = Ollama(\n    base_url='http://localhost:11434',\n    model=\"llama3\"\n)\n```\n\n## Review Output\n\nReviews are saved in the `reviews/` directory with the format:\n```\nREVIEW_{filename}_BY_{model}.md\n```\n\nEach review includes:\n- Code analysis summary\n- Specific recommendations with before/after code examples\n- Complete revised code when necessary\n- Markdown formatting for easy reading\n\n## API Functions\n\n### Core Review Functions\n- `review_file(file_path)` - Review a single file\n- `review_files(folder_path, exclude_keywords)` - Review multiple files\n- `get_code_review(filename, code)` - Generate AI review for code\n\n### GitHub Integration\n- `get_pull_request_data(token, owner, repo, pull_number)`\n- `get_pull_request_changes(token, owner, repo, pull_number)`\n- `get_commit_messages(token, owner, repo, pull_number)`\n\n### File Operations\n- `create_file(filename, content)` - Create new file\n- `append_to_file(filename, content)` - Append to existing file\n\n## Dependencies\n\nKey dependencies include:\n- `langchain` - AI model integration\n- `requests` - HTTP requests for GitHub API\n- `python-dotenv` - Environment variable management\n- `pydantic` - Data validation\n\nSee `requirements.txt` for complete list.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nThis project is open source. Please check the repository for license details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fai-code-reviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliteobject%2Fai-code-reviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fai-code-reviewer/lists"}