UNPKG

shai-analyzer

Version:

A CLI tool to analyze package dependencies and detect breaking changes

77 lines (53 loc) • 2.26 kB
# shai-analyzer šŸ› ļøšŸ“¦ Smart Dependency Analyzer for JavaScript/TypeScript projects Detect breaking changes before they break your app! šŸ”„ ## ✨ What is shai-analyzer? shai-analyzer is a CLI tool designed to analyze your project’s dependencies and detect possible breaking changes when updating packages. šŸš€ It uses AI (DeepSeek-R1 B7 with Ollama) to provide precise recommendations on whether updating a package might cause issues in your project. ## ⚔ Features - āœ… Scans your dependencies in package.json and detects outdated versions. - āœ… Checks for breaking changes using AI-powered analysis. - āœ… Distinguishes TypeScript support: - 🟢 Native TypeScript support - 🟔 Uses @types/package for TypeScript - šŸ”“ No TypeScript support detected - āœ… Integrates AI to analyze changelogs for better accuracy. - āœ… Works locally with Ollama for privacy & offline AI analysis. ## šŸ“¦ Installation Before installing, make sure you have [Ollama](https://ollama.com/) installed and have downloaded the required AI model: ```bash ollama pull deepseek-r1:b7 ``` Then, install shai-analyzer globally via NPM: ```bash npm install -g shai-analyzer ``` ## šŸš€ Usage šŸ” Scan your dependencies Run the following command in the root of your project: ```bash shai-analyzer scan ``` This will: - 1ļøāƒ£ Analyze all dependencies in package.json. - 2ļøāƒ£ Check if updates are available. - 3ļøāƒ£ Detect breaking changes with AI. - 4ļøāƒ£ Show TypeScript support for each dependency. Example output: ![img.png](img.png) ## šŸ› ļø How AI is used - šŸ”¹ shai-analyzer uses AI to analyze the changelog of each package before updating. - šŸ”¹ AI is powered by Ollama with DeepSeek-R1 B7 to determine: - āœ”ļø If a package update introduces breaking changes. - āœ”ļø If changes impact TypeScript compatibility. - āœ”ļø If a safer version upgrade is recommended. ## šŸ› ļø Requirements - šŸ”¹ Node.js (v16+) - šŸ”¹ Ollama installed → Install Ollama - šŸ”¹ DeepSeek-R1 B7 model → Install with: ```bash ollama pull deepseek-r1:b7 ``` ## šŸ“œ License This project is licensed under the MIT License. šŸ“Œ Contributions are welcome! If you find a bug or want to add features, feel free to open a pull request.