deprecopilot
Version:
Automated dependency management with AI-powered codemods
176 lines (129 loc) • 5.49 kB
Markdown
# Deprecopilot
> **Automated dependency management with AI-powered codemods**
Deprecopilot is a powerful CLI tool that keeps your dependencies up-to-date and automatically applies necessary code changes when upgrading major versions. Stop manually fixing breaking changes - let AI handle the heavy lifting.
[](https://badge.fury.io/js/deprecopilot)
[](https://opensource.org/licenses/MIT)
## ✨ Key Features
- 🔍 **Smart Dependency Auditing** - Find outdated and vulnerable dependencies
- 🚀 **Automated Upgrades** - Upgrade with intelligent version selection
- 🤖 **AI-Powered Codemods** - Generate and apply code transformations automatically
- 👀 **Preview Mode** - See changes before applying them
- 🔧 **Custom Codemods** - Support for your own transformation scripts
- 📊 **CI/CD Ready** - JSON output for automation
- 🔌 **Plugin System** - Extensible architecture
## 🚀 Quick Start
### Install
```bash
npm install -g deprecopilot
```
### Audit Dependencies
```bash
# Check for outdated packages
deprecopilot audit
# Get detailed JSON output
deprecopilot audit --json
```
### Preview Upgrades
```bash
# See what changes would be made
deprecopilot fix --preview
# Preview with AI codemods
deprecopilot fix --preview --ai
```
### Apply Upgrades
```bash
# Upgrade with AI assistance
deprecopilot fix --ai
# Interactive upgrade
deprecopilot upgrade --interactive
```
## 📖 Documentation
- **[Getting Started](https://github.com/TrialLord/depre-copilot/blob/main/docs/getting-started.md)** - Installation and first steps
- **[CLI Reference](https://github.com/TrialLord/depre-copilot/blob/main/docs/cli.md)** - Complete command documentation
- **[Preview Mode](https://github.com/TrialLord/depre-copilot/blob/main/docs/preview-mode.md)** - See changes before applying
- **[AI Codemods](https://github.com/TrialLord/depre-copilot/blob/main/docs/advanced-usage.md)** - AI-powered code transformations
- **[Custom Codemods](https://github.com/TrialLord/depre-copilot/blob/main/docs/writing-codemods.md)** - Write your own transformations
- **[Troubleshooting](https://github.com/TrialLord/depre-copilot/blob/main/docs/troubleshooting.md)** - Common issues and solutions
## 🎯 Example Output
### Preview Mode
```bash
$ deprecopilot fix --preview --ai
```
```
Index: src/index.js
===================================================================
--- src/index.js
+++ src/index.js
@@ -1,6 +1,9 @@
import _ from 'lodash'
+// Updated for lodash v4 compatibility
console.log(_.map([1,2,3], n => n * 2))
+// Note: _.map is now deprecated, consider using Array.prototype.map
```
### JSON Output
```json
{
"results": [
{
"name": "lodash",
"from": "3.10.1",
"to": "4.0.0",
"files": ["src/index.js"],
"codemodResult": {
"applied": true,
"files": ["src/index.js"],
"diff": "Index: src/index.js\n..."
}
}
]
}
```
## 🔧 Installation Options
### Global Install (Recommended)
```bash
npm install -g deprecopilot
```
### Local Install
```bash
npm install --save-dev deprecopilot
npx deprecopilot audit
```
### Binary Download
Coming soon - direct binary downloads for all platforms.
## ⚠️ System Requirements
**Important:** The `audit` command requires `npm` to be available in your system PATH. This is because deprecopilot uses npm's built-in commands to analyze your dependencies.
- ✅ **Windows:** npm should be installed and accessible from Command Prompt/PowerShell
- ✅ **macOS/Linux:** npm should be in your PATH environment variable
- ✅ **CI/CD:** Ensure npm is available in your build environment
If you get an "ENOENT: spawn npm" error, make sure npm is properly installed and accessible.
## 🤝 Contributing
We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for details.
- 🐛 [Report Bugs](https://github.com/TrialLord/depre-copilot/issues)
- 💡 [Request Features](https://github.com/TrialLord/depre-copilot/issues)
- 📝 [Submit PRs](https://github.com/TrialLord/depre-copilot/pulls)
## 📄 License
MIT License - see [LICENSE](LICENSE) file for details.
## 🔒 Privacy
Telemetry is strictly opt-in and disabled by default. See [PRIVACY.md](PRIVACY.md) for details.
## AI-Powered Codemods
Deprecopilot can generate codemods using AI to handle breaking changes automatically. **You provide your own API keys** - no data is sent to external services without your explicit configuration.
### Setup AI Providers
#### Google Gemini (Default)
```bash
# Get API key from https://makersuite.google.com/app/apikey
export GEMINI_API_KEY=your-gemini-api-key
deprecopilot fix --ai
```
#### OpenAI GPT
```bash
# Get API key from https://platform.openai.com/api-keys
export OPENAI_API_KEY=your-openai-api-key
deprecopilot fix --ai --llm-provider openai
```
### Security & Privacy
- ✅ **Your API keys stay on your machine**
- ✅ **No code or data sent to external services by default**
- ✅ **Telemetry is opt-in only**
- ✅ **All AI requests use your own API keys**
---
**Ready to automate your dependency management?** [Get started now →](https://github.com/TrialLord/depre-copilot/blob/main/docs/getting-started.md)