Smart Dependency Assistant
A production-ready VS Code extension that helps developers quickly identify and resolve dependency-related issues while coding.

Features
🎯 Smart Dependency Detection
- Automatically monitors terminal output for dependency-related errors
- Detects missing packages, version conflicts, and environment issues
- Supports Python and Node.js projects
📦 Beginner-Friendly Explanations
- Converts technical error messages into simple, understandable language
- Explains what went wrong and why
- Provides context-aware solutions
🚀 One-Click Installation
- Generates correct installation commands for detected packages
- Provides copy-to-clipboard functionality
- Optional one-click installation with safety checks
- Shows alternative installation methods
🎨 Beautiful UI
- Clean, modern webview panel in VS Code
- Dark mode support
- Real-time status updates
- Confidence indicators for detection accuracy
Supported Errors
Python
ModuleNotFoundError: No module named 'package'
ImportError: No module named 'package'
cannot import name 'module'
- Version conflicts and environment issues
Node.js
Cannot find module 'package'
MODULE_NOT_FOUND
npm ERR! 404 (package not found)
ERESOLVE (dependency conflicts)
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Smart Dependency Assistant"
- Click Install
How to Use
Basic Usage
- Run your code - Execute your Python script or Node.js application in the terminal
- Get notified - When a dependency error occurs, the extension detects it
- Review the issue - The Smart Dependency Panel explains what's wrong
- Install the package - Click "Install Package" or copy the command manually
Manual Check
If you want to manually check your terminal output:
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type "Smart Dependency Assistant: Check Terminal"
- The extension will analyze the current terminal output
Project Structure
src/
├── extension.ts # Main entry point
├── analyzer/
│ ├── errorAnalyzer.ts # Error detection and analysis
│ ├── languageDetector.ts # Detects project language
│ └── dependencyParser.ts # Parses dependency files
├── commands/
│ ├── installCommandGenerator.ts # Generates install commands
│ └── commandRegistry.ts # Registers VS Code commands
├── terminal/
│ └── terminalMonitor.ts # Monitors terminal output
├── ui/
│ ├── webviewProvider.ts # Webview UI panel
│ └── notificationManager.ts # Handle notifications
├── types/
│ └── types.ts # TypeScript type definitions
└── utils/
└── helpers.ts # Utility functions
Development
Prerequisites
- Node.js 18+
- npm or yarn
- VS Code 1.85+
- TypeScript 5.3+
Setup
# Clone or create project
cd smart-dependency-assistant
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode (for development)
npm run watch
Build and Package
# Compile with optimizations
npm run vscode:prepublish
# Create VSIX package for distribution
npx vsce package
Running Locally
- Open the project in VS Code
- Press
F5 to start debugging
- A new VS Code window will open with the extension loaded
- Test by running Python or Node.js commands that trigger dependency errors
Running Tests
# Run test suite
npm test
# Run with coverage
npm test -- --coverage
Configuration
The extension works out-of-the-box with no configuration needed. However, you can customize behavior with VS Code settings:
{
"smartDependencyAssistant.autoInstall": false,
"smartDependencyAssistant.showNotifications": true,
"smartDependencyAssistant.confidenceThreshold": 60,
"smartDependencyAssistant.languages": ["python", "nodejs"]
}
How It Works
Architecture
- Terminal Monitoring - Listens to terminal output for error patterns
- Language Detection - Identifies project type (Python/Node.js)
- Error Analysis - Uses regex patterns to detect dependency issues
- Package Extraction - Extracts package name from error message
- Command Generation - Generates appropriate install commands
- UI Display - Shows issues in a beautiful webview panel
- Safe Installation - Executes commands with safety validation
Error Detection Flow
Terminal Output
↓
[Terminal Monitor]
↓
[Error Analyzer] → Pattern Matching
↓
[Language Detector] → Language Detection
↓
[Dependency Parser] → Check if package exists
↓
[Issue Created] → Confidence Scoring
↓
[Webview Display] → Show UI Panel
↓
[Command Generator] → Generate install command
↓
[User Action] → Install or Copy Command
Type System
The extension uses strict TypeScript typing for reliability:
// Core types (see types/types.ts)
- SupportedLanguage enum (Python, NodeJS)
- IssueType enum (Missing, Conflict, Environment, NonDependency)
- DependencyIssue interface
- InstallCommand interface
- AnalysisResult interface
Safety
The extension implements multiple safety layers:
✅ Pattern Matching Only - Doesn't execute unknown commands
✅ Command Validation - Checks for injection attempts
✅ Confidence Scoring - Only acts on high-confidence detections
✅ User Approval - Requires explicit approval before installation
✅ Terminal Execution - Runs commands visibly in user's terminal
Limitations
- Requires terminal output to contain error message (doesn't intercept VS Code's run output yet)
- Supports Python and Node.js (other languages in roadmap)
- Confidence scoring based on pattern matching (not AST analysis)
- Limited to common error patterns
Troubleshooting
Extension not detecting errors?
- Make sure error is printed to terminal
- Check that error message matches known patterns
- Open Command Palette and run "Smart Dependency Assistant: Check Terminal"
- Enable debug logs:
"smartDependencyAssistant.debug": true
Installation not working?
- Verify package name is correct
- Check you have internet connection
- Try copying command and running manually
- Check pip/npm installation locally
Panel not showing?
- Click on "Smart Dependency Panel" in the Activity Bar
- Press
Ctrl+Shift+P and search "Smart Dependency Assistant"
- Reload VS Code window (F1 → Developer: Reload Window)
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
npm test
- Submit a pull request
Adding Support for New Languages
- Add language to
SupportedLanguage enum in types/types.ts
- Add error patterns to
errorAnalyzer.ts
- Add install command logic to
installCommandGenerator.ts
- Update documentation
- Memory: ~15-20MB base + dependencies
- CPU: Minimal impact (only analyzes terminal output when changed)
- Startup: <1 second extension activation
License
MIT © 2024
Support
Happy coding! Let Smart Dependency Assistant handle your dependency issues! 🚀