Skip to content

Latest commit

 

History

History
352 lines (270 loc) · 8.07 KB

File metadata and controls

352 lines (270 loc) · 8.07 KB

AI Editor Toolkit - Installation & Testing Guide

🎯 Enhanced Features Added

New Developer-Focused Features:

  1. Developer Insights - Comprehensive workspace analysis
  2. Project Health Check - Real-time health scoring and issue detection
  3. Enhanced Cleanup - Advanced cleanup with workspace optimization
  4. Workspace Analysis - Detailed storage and environment analysis

Enhanced Capabilities:

  • ✅ Project size analysis and optimization recommendations
  • ✅ Node.js dependency management and cleanup
  • ✅ VS Code extension monitoring and management
  • ✅ Git repository analysis and cleanup
  • ✅ Code quality issue detection
  • ✅ Comprehensive workspace health scoring
  • ✅ Automated optimization recommendations

📦 Installation Methods

Method 1: Global NPM Installation (Recommended)

# Install globally from your project directory
npm install -g .

# Or if you want to install from npm registry (when published)
npm install -g ai-editor-toolkit

Method 2: Local Development Installation

# Clone and install dependencies
git clone <your-repo-url>
cd ai-editor-toolkit
npm install
npm run build

# Link locally for global access
npm link

Method 3: Direct Usage

# Without global installation, run directly
node dist/cli-simple.js <command>

🚀 CLI Usage Guide

Basic Commands

# Show system status and health
ai-toolkit status
# or
ait status

# Get developer insights
ai-toolkit insights
ait insights

# Check project health
ai-toolkit health
ait health

# Perform enhanced cleanup
ai-toolkit cleanup --enhanced
ait cleanup --enhanced

# Monitor system in real-time
ai-toolkit monitor
ait monitor

# Get optimization recommendations
ai-toolkit optimize
ait optimize

Advanced Commands

# Force cleanup without confirmation
ai-toolkit cleanup --force

# Aggressive cleanup (includes high-resource processes)
ai-toolkit cleanup --aggressive

# Clean specific ports
ai-toolkit kill-port 3000 3001 8080

# Show detailed workspace analysis
ai-toolkit workspace-analysis

# Export system report
ai-toolkit status --json > system-report.json

🧩 VS Code Extension Installation

Method 1: VSIX Package (Recommended for testing)

# Build the extension
cd extension
npm install
npm run compile

# Package the extension (requires vsce)
npm install -g vsce
vsce package

# Install the generated .vsix file
code --install-extension ai-editor-toolkit-extension-1.0.0.vsix

Method 2: Development Mode

# Open the extension folder in VS Code
code extension/

# Press F5 to launch a new VS Code window with the extension loaded
# The extension will be available in the Command Palette

Extension Commands in VS Code

Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P):

  • AI Toolkit: Show Status - Display system status
  • AI Toolkit: Developer Insights - Show workspace insights
  • AI Toolkit: Project Health Check - Analyze project health
  • AI Toolkit: Enhanced Cleanup - Perform comprehensive cleanup
  • AI Toolkit: Workspace Analysis - Detailed workspace analysis
  • AI Toolkit: Cleanup Orphaned Processes - Clean up orphaned processes
  • AI Toolkit: Optimize System - System optimization
  • AI Toolkit: Toggle Monitoring - Enable/disable monitoring
  • AI Toolkit: Open Settings - Open extension settings

🧪 Testing Guide

1. Test CLI Functionality

# Test basic functionality
ai-toolkit status

# Test enhanced features
node test-enhanced-features.js

# Test different cleanup modes
ai-toolkit cleanup --dry-run
ai-toolkit cleanup --force
ai-toolkit cleanup --enhanced

2. Test VS Code Extension

  1. Install the extension (see installation methods above)
  2. Open Command Palette (Ctrl+Shift+P)
  3. Try each command:
    • Start with AI Toolkit: Show Status
    • Test AI Toolkit: Developer Insights
    • Try AI Toolkit: Project Health Check
    • Test AI Toolkit: Enhanced Cleanup

3. Test API Usage

const { AIEditorToolkit } = require('ai-editor-toolkit');

async function testAPI() {
    const toolkit = new AIEditorToolkit();
    await toolkit.initialize();
    
    // Test enhanced features
    const insights = await toolkit.getDeveloperInsights();
    const health = await toolkit.getProjectHealth();
    const cleanup = await toolkit.performEnhancedCleanup();
    
    console.log('Insights:', insights);
    console.log('Health:', health);
    console.log('Cleanup:', cleanup);
    
    await toolkit.shutdown();
}

testAPI();

🔧 Configuration

Default Configuration Location

  • Windows: %USERPROFILE%\.ai-editor-toolkit\config.json
  • macOS/Linux: ~/.ai-editor-toolkit/config.json

Enhanced Configuration Options

{
  "monitoring": {
    "enabled": true,
    "interval": 30,
    "thresholds": {
      "memory": 500,
      "cpu": 80,
      "orphanedProcessTimeout": 30
    },
    "autoCleanup": false,
    "notifications": true,
    "logLevel": "info"
  },
  "cleanup": {
    "enhanced": true,
    "includeWorkspace": true,
    "includeTempFiles": true,
    "includeCache": true,
    "confirmBeforeKill": true,
    "backupConfigs": true
  },
  "insights": {
    "analyzeProjects": true,
    "includeGitInfo": true,
    "scanExtensions": true,
    "calculateSizes": true
  },
  "health": {
    "enableScoring": true,
    "autoRecommendations": true,
    "criticalThresholds": {
      "memoryUsage": 90,
      "diskUsage": 85,
      "processCount": 100
    }
  }
}

🐛 Troubleshooting

Common Issues and Solutions

  1. "Cannot find module" errors

    npm install
    npm run build
  2. Permission denied errors

    # Run as administrator (Windows) or with sudo (macOS/Linux)
    sudo ai-toolkit cleanup
  3. VS Code extension not loading

    # Reload VS Code window
    Ctrl+Shift+P -> "Developer: Reload Window"
  4. High memory usage during cleanup

    # Use gentle cleanup mode
    ai-toolkit cleanup --gentle

Debug Mode

# Enable debug logging
export DEBUG=ai-toolkit:*  # Linux/macOS
set DEBUG=ai-toolkit:*     # Windows

ai-toolkit status

📊 Performance Metrics

The enhanced toolkit provides detailed performance metrics:

  • Memory Usage: Real-time memory monitoring
  • Process Count: Active AI editor processes
  • Workspace Size: Total project size analysis
  • Health Score: 0-100 health rating
  • Cleanup Efficiency: Space freed and processes optimized
  • Response Time: Command execution speed

🎯 Use Cases

For Individual Developers

  • Monitor development environment health
  • Clean up orphaned processes and files
  • Optimize workspace storage usage
  • Get insights into project structure

For Development Teams

  • Standardize environment cleanup
  • Monitor team workspace health
  • Share optimization recommendations
  • Automate maintenance tasks

For System Administrators

  • Monitor multiple development environments
  • Automated cleanup scheduling
  • Performance optimization reporting
  • Resource usage analytics

🔄 Automatic Updates

# Check for updates
npm update -g ai-editor-toolkit

# Update VS Code extension
# Use VS Code's extension auto-update feature

📞 Support

If you encounter any issues:

  1. Check the logs: Debug mode provides detailed information
  2. Review configuration: Ensure settings are correct
  3. Test core features: Verify basic functionality works
  4. Report issues: Include system info and error messages

✅ Verification Checklist

  • CLI commands work (ai-toolkit status)
  • Enhanced features function (ai-toolkit insights)
  • VS Code extension loads and commands work
  • Configuration file is properly loaded
  • Cleanup operations complete successfully
  • Monitoring and notifications work
  • API usage works programmatically
  • All tests pass

🎉 Success!

You now have a fully enhanced AI Editor Toolkit with:

  • ✅ Comprehensive developer insights
  • ✅ Project health monitoring
  • ✅ Advanced cleanup capabilities
  • ✅ Workspace optimization
  • ✅ VS Code integration
  • ✅ Automated recommendations

Happy developing! 🚀