-ai-code-optimizer-
v1.0.1
Published
AI-powered tool to scan and optimize Node.js code for performance.
Maintainers
Readme
AI Code Optimizer
AI Code Optimizer is a CLI tool that uses AI (OpenAI or Grok) to scan your Node.js codebase for performance issues and automatically suggests or applies fixes.
Features
- 🚀 AI-Powered Scanning: Detects performance bottlenecks, anti-patterns, and inefficiencies.
- 🤖 Multi-Model Support: Works with OpenAI (GPT-4) and xAI (Grok-2, Grok-3).
- 🛠️ Auto-Fix: Interactively apply AI-suggested fixes directly to your code.
- ⚙️ Configurable: use
.envor.ai-optimizer-rcfor flexible configuration.
Installation
npm install -g ai-code-optimizerUsage
1. Configuration
Create a .env file in your project root:
# Choose your AI provider
AI_MODEL=grok # or openai
# API Keys
GROK_API_KEY=your_xai_api_key
# OPENAI_API_KEY=your_openai_api_key
# Optional: Specific Model Version
# GROK_MODEL=grok-22. Run a Scan
To scan the current directory for issues:
ai-code-optimizer scanThe tool will analyze .js and .ts files, report issues, and offer to fix them.
3. Check Configuration
ai-code-optimizer configDevelopment
- Clone the repository.
- Install dependencies:
npm install - Run locally:
npm run dev(requirests-node)
License
ISC
