{"id":22342926,"url":"https://github.com/pirate-emperor/codemuse","last_synced_at":"2026-01-27T01:31:07.084Z","repository":{"id":263041532,"uuid":"889174708","full_name":"Pirate-Emperor/CodeMuse","owner":"Pirate-Emperor","description":"CodeMuse is an AI-powered CLI tool for automated code reviews and PR descriptions. Supports structured Git diff analysis, multiple review modes (brief, detailed, description), markdown outputs, and easy customization. Smart, fast, and developer-friendly!","archived":false,"fork":false,"pushed_at":"2024-11-15T18:56:39.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T18:32:07.585Z","etag":null,"topics":["ai","cli-tool","commanderjs","error-handling","git","git-difftool","llm","logging-system","nodejs","openai-api","winstonjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pirate-Emperor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-11-15T18:55:44.000Z","updated_at":"2025-05-29T11:49:28.000Z","dependencies_parsed_at":"2024-11-15T19:32:15.090Z","dependency_job_id":"ccb19881-e0cc-456c-82d6-210c4354f6fc","html_url":"https://github.com/Pirate-Emperor/CodeMuse","commit_stats":null,"previous_names":["pirate-emperor/codemuse"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pirate-Emperor/CodeMuse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pirate-Emperor%2FCodeMuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pirate-Emperor%2FCodeMuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pirate-Emperor%2FCodeMuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pirate-Emperor%2FCodeMuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pirate-Emperor","download_url":"https://codeload.github.com/Pirate-Emperor/CodeMuse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pirate-Emperor%2FCodeMuse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28795467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"ssl_error","status_checked_at":"2026-01-27T01:07:06.974Z","response_time":59,"last_error":"SSL_read: 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","cli-tool","commanderjs","error-handling","git","git-difftool","llm","logging-system","nodejs","openai-api","winstonjs"],"created_at":"2024-12-04T08:14:09.001Z","updated_at":"2026-01-27T01:31:07.066Z","avatar_url":"https://github.com/Pirate-Emperor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeMuse\n\n**CodeMuse** is an AI-powered code review CLI tool that leverages Large Language Models (LLMs) to analyze pull requests, generate insightful code reviews, and create detailed PR descriptions. Designed for developers, it simplifies code reviews by providing structured insights and markdown-formatted outputs.\n\n---\n\n## Features 🚀\n\n- 🔍 **Automated Code Reviews**: Comprehensive analysis of your code changes.\n- 📝 **PR Description Generation**: Detailed descriptions with technical context and diagrams.\n- 🎯 **Flexible Review Modes**: Choose between brief summaries, in-depth reviews, or PR descriptions.\n- 📊 **Structured Git Diff Analysis**: Organized change breakdowns.\n- 📋 **Extensive Logging**: Detailed logs for easier debugging.\n- 🛡️ **Robust Error Handling**: Graceful failure recovery and cleanup.\n\n---\n\n## Prerequisites 📋\n\n- **Node.js**: Version 14 or higher\n- **npm**: Version 6 or higher\n- **Git**: Installed and configured\n- **OpenAI API Key**: Required for LLM integration\n\n### Setting Up the OpenAI API Key\n\n```bash\n# Linux/macOS\nexport OPEN_API_KEY=your_openai_api_key\n\n# Windows (Command Prompt)\nset OPEN_API_KEY=your_openai_api_key\n\n# Windows (PowerShell)\n$env:OPEN_API_KEY=\"your_openai_api_key\"\n```\n\n---\n\n## Installation 🛠️\n\n1. Install required dependencies:\n   ```bash\n   npm install commander winston\n   ```\n\n2. Install CodeMuse globally:\n   ```bash\n   npm install -g .\n   ```\n\n---\n\n## Usage 📖\n\n### Command Structure\n```bash\ncode-muse [options]\n```\n\n### Options\n```\nOptions:\n  -V, --version                 Output version number\n  -b, --branch \u003cbranch\u003e         Branch name to review (required)\n  -m, --mode \u003cmode\u003e             Review mode (review/description/brief) (default: \"review\")\n  -t, --target-branch \u003cbranch\u003e  Target branch to compare against (default: \"development\")\n  -v, --verbose                 Enable verbose logging\n  -o, --output \u003coutput\u003e         Output folder (default: \"tmp\")\n  -h, --help                    Display help for command\n```\n\n### Examples\n```bash\n# Basic review of a branch\ncode-muse -b feature/new-feature\n\n# Generate a detailed PR description\ncode-muse -b feature/new-feature -m description -t main\n\n# Verbose logging for debugging\ncode-muse -b feature/new-feature -v\n\n# Help menu\ncode-muse --help\n```\n\n---\n\n## Review Modes 📝\n\n1. **review** (default)\n   - Detailed code review with issue identification and improvement suggestions.\n   - Includes best practices and performance analysis.\n\n2. **description**\n   - Comprehensive PR descriptions with technical details and diagrams.\n   - Lists key changes and their impact.\n\n3. **brief**\n   - High-level summary of changes.\n   - Focused on key points for reviewers.\n\n---\n\n## Output 📂\n\nGenerated files include:\n\n- `combined.log`: Full execution log.\n- `error.log`: Logs of errors encountered.\n- Temporary Git diff files (automatically cleaned).\n- AI-generated review or description output in markdown format.\n\n---\n\n## How CodeMuse Works 🔍\n\n1. **Initialization**:\n   - Parses CLI arguments.\n   - Sets up the environment and logging.\n\n2. **Git Diff Analysis**:\n   - Compares the specified branch with the target branch.\n   - Structures the changes for analysis.\n\n3. **AI Processing**:\n   - Sends structured changes to LLM.\n   - Generates markdown-formatted outputs.\n\n4. **Logging \u0026 Cleanup**:\n   - Logs operation details.\n   - Cleans temporary files.\n\n---\n\n## Troubleshooting 🔧\n\n### Common Issues\n1. **Git Operation Failures**:\n   - Ensure Git is installed and configured correctly.\n\n2. **API Key Errors**:\n   - Verify that `OPEN_API_KEY` is correctly set.\n\n3. **Invalid Branch/Diff**:\n   - Check if the branch exists and has valid changes.\n\n---\n\n## Development 💻\n\n### Project Structure\n```\ncode-muse/\n├── src/\n│   ├── GitOperations.js\n│   ├── DiffParser.js\n│   ├── ReviewGenerator.js\n│   ├── LLMAdapter.js\n├── logs/\n│   ├── combined.log\n│   └── error.log\n└── package.json\n```\n\n### Adding Features\n- Follow the modular design of the project.\n- Include proper error handling and logging.\n\n---\n\n## Customizing Prompts ✍️\n\nPrompts can be tailored to fit your needs by editing `prompts.js` in the project root.\n\n```js\nmodule.exports = {\n  PROMPTS: {\n    review: \"Custom review prompt...\",\n    description: \"Custom description prompt...\",\n    brief: \"Custom brief prompt...\",\n  },\n};\n```\n\n---\n\n## Contributing 🤝\n\n1. Fork the repository.\n2. Create a feature branch.\n3. Submit a pull request with a detailed description.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Author\n\n**Pirate-Emperor**\n\n[![Twitter](https://skillicons.dev/icons?i=twitter)](https://twitter.com/PirateKingRahul)\n[![Discord](https://skillicons.dev/icons?i=discord)](https://discord.com/users/1200728704981143634)\n[![LinkedIn](https://skillicons.dev/icons?i=linkedin)](https://www.linkedin.com/in/piratekingrahul)\n\n[![Reddit](https://img.shields.io/badge/Reddit-FF5700?style=for-the-badge\u0026logo=reddit\u0026logoColor=white)](https://www.reddit.com/u/PirateKingRahul)\n[![Medium](https://img.shields.io/badge/Medium-42404E?style=for-the-badge\u0026logo=medium\u0026logoColor=white)](https://medium.com/@piratekingrahul)\n\n- GitHub: [Pirate-Emperor](https://github.com/Pirate-Emperor)\n- Reddit: [PirateKingRahul](https://www.reddit.com/u/PirateKingRahul/)\n- Twitter: [PirateKingRahul](https://twitter.com/PirateKingRahul)\n- Discord: [PirateKingRahul](https://discord.com/users/1200728704981143634)\n- LinkedIn: [PirateKingRahul](https://www.linkedin.com/in/piratekingrahul)\n- Skype: [Join Skype](https://join.skype.com/invite/yfjOJG3wv9Ki)\n- Medium: [PirateKingRahul](https://medium.com/@piratekingrahul)\n\nThank you for visiting the CipherX project!\n\n---\n\nFor more details, please refer to the [GitHub repository](https://github.com/Pirate-Emperor/CipherX).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirate-emperor%2Fcodemuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirate-emperor%2Fcodemuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirate-emperor%2Fcodemuse/lists"}