# 📁 Bulk File Operations This guide explains how to use the bulk file operations features of the Acode AI CLI Assistant Plugin to manage multiple files efficiently. ## 🎯 Overview Bulk file operations allow you to perform actions on multiple files simultaneously, saving time and effort in project management tasks. ## 🛠️ Available Operations ### Rename Multiple Files - Rename several files at once using patterns - Use `{index}` placeholder for sequential numbering - Preview changes before applying ### Move Files to Folders - Organize multiple files into appropriate directories - Select target folder through file browser - Maintain file structure and references ### Delete Unused Files - Remove temporary, backup, or log files - Specify file extensions to target - Safely clean up your project ### Add Headers to Files - Insert consistent headers across multiple files - Customize header content - Apply to selected files or entire project ### Convert File Formats - Change file extensions in bulk - Convert between compatible formats - Maintain file content integrity ## 📱 Accessing Bulk Operations ### From Chat Interface 1. Open the AI assistant chat 2. Click the menu icon (three dots) 3. Select "Bulk Operations" ### Keyboard Shortcut - **Windows/Linux**: `Ctrl + Shift + B` - **Mac**: `Cmd + Shift + B` ## 🔧 Using Rename Operation ### Pattern-Based Renaming 1. Select "Rename multiple files" from the operations menu 2. Choose files to rename using the file selection interface 3. Enter a naming pattern (e.g., `component_{index}.js`) 4. Preview the changes 5. Confirm to apply renaming ### AI-Assisted Renaming 1. Select "Rename multiple files" 2. Choose files to rename 3. Select "AI Rename" option 4. AI will suggest appropriate names based on file content 5. Review and confirm suggestions ## 📁 Using Move Operation ### Organizing Files 1. Select "Move files to folders" from operations menu 2. Choose files to move 3. Select target directory through file browser 4. Preview file movements 5. Confirm to apply changes ### AI-Based Organization 1. Select "Move files to folders" 2. Choose files to organize 3. Select "AI Organize" option 4. AI analyzes file content and suggests appropriate folders 5. Review and confirm organization ## 🗑️ Using Delete Operation ### Cleanup Process 1. Select "Delete unused files" from operations menu 2. Specify file extensions to target (e.g., `.log`, `.tmp`, `.bak`) 3. AI scans project for matching files 4. Review list of files to be deleted 5. Confirm deletion ### Safety Features - Files are not permanently deleted immediately - Preview of all files to be removed - Confirmation step prevents accidental deletion ## 📄 Using Header Addition ### Adding Headers 1. Select "Add headers to files" from operations menu 2. Choose files to add headers to 3. Enter or generate header content 4. Preview headers 5. Confirm to apply to all selected files ### Header Templates - Create reusable header templates - Include dynamic elements like date, filename, author - Apply consistently across your project ## 🔄 Using Format Conversion ### Converting Files 1. Select "Convert file formats" from operations menu 2. Choose files to convert 3. Specify target format/extension 4. Preview conversions 5. Confirm to apply changes ### Format Compatibility - Only converts between compatible formats - Maintains file content during conversion - Preserves file metadata when possible ## 🤖 AI Integration in Bulk Operations ### Smart File Analysis - AI examines file content to suggest appropriate actions - Context-aware recommendations for organization - Intelligent pattern generation for renaming ### Project Structure Understanding - AI analyzes your entire project structure - Suggests improvements based on best practices - Recommends folder organization patterns ## ⚙️ Configuration Options ### Default Patterns - Set default naming patterns for common operations - Configure frequently-used header templates - Save preferred folder structures ### Performance Settings - Adjust how many files are processed simultaneously - Set timeout values for AI analysis - Configure cache settings for repeated operations ## 📈 Bulk Operation Tracking ### Operation History - Track all bulk operations performed - View success/failure statistics - Undo recent operations if needed ### Token Usage - Monitor API token consumption during bulk operations - Estimate costs before performing large operations - Optimize operations for token efficiency ## 🐛 Troubleshooting Bulk Operations ### Common Issues #### File Selection Problems - Ensure you have proper permissions for selected files - Check that files are not locked by other processes - Verify file paths are accessible #### Operation Failures - Some operations may fail due to file permissions - Network issues can affect AI-assisted operations - Large operations may timeout on slower devices #### Unexpected Results - Preview all operations before confirming - AI suggestions may not always match your intent - Customize AI prompts for better results ### Bulk Operations Verification To verify bulk operations functionality: 1. Create a test directory with several files 2. Access bulk operations through menu or shortcut 3. Try a simple rename operation with a few files 4. Confirm files are properly renamed ## 💡 Best Practices ### Before Performing Bulk Operations 1. Always backup important files 2. Preview changes before confirming 3. Start with small batches to test 4. Ensure sufficient API quota if using AI features ### Efficient Renaming - Use descriptive patterns that reflect file purpose - Include version numbers when appropriate - Maintain consistency across your project ### Safe Deletion - Only delete files you're certain you don't need - Check file extensions carefully - Consider moving files to a "trash" folder first ## 📞 Getting Help If you encounter issues with bulk file operations: 1. Check the [Common Issues](Common-Issues.md) documentation 2. Visit our [GitHub Issues](https://github.com/RenzMc/Acode-Plugin-AI-cli/issues) page 3. Join our [Discussions](https://github.com/RenzMc/Acode-Plugin-AI-cli/discussions) community for support ---