A simple utility to help manage your VS Code extensions by exporting a list of installed extensions and selectively removing them.
This project provides a script to manage your VS Code extensions:
vscode-extensions-manager.sh - A unified tool that handles both exporting and removing extensions with various options.
- vscode-extensions-manager.sh: All-in-one script for exporting and removing extensions with command-line options
- check_dependencies.sh: Helper script that contains common dependency checks for jq and VS Code CLI
- vscode-extensions-to-be-removed.json: A list of extensions to be considered for removal
- vscode-extensions-*.json: Timestamped backups of your extension lists
- README.md: This documentation file with instructions and troubleshooting tips
./vscode-extensions-manager.sh [options] [operation]export: Export all installed extensions to a JSON fileremove: Interactively remove extensions from the JSON fileclean: Export and then remove in one operation
-h, --help: Show help message-f, --file FILE: Use a specific file (default: vscode-extensions-to-be-removed.json)-y, --yes: Answer yes to all prompts (dangerous!)-v, --verbose: Show more detailed output
# Export extensions to a timestamped file
./vscode-extensions-manager.sh export
# Remove extensions interactively
./vscode-extensions-manager.sh remove
# Export and then remove in one step
./vscode-extensions-manager.sh clean
# Use a custom file
./vscode-extensions-manager.sh --file my-extensions.json remove- Visual Studio Code (
codecommand must be in your PATH) - jq (JSON processor) - Required for parsing JSON data
The script automatically checks for these dependencies and will display helpful error messages if they're missing.
To make the code command available in your terminal:
- Open VS Code
- Press
F1orCtrl+Shift+Pto open the command palette - Type "shell command" and select "Install 'code' command in PATH"
- Restart your terminal
If jq is not installed on your system:
- Ubuntu/Debian:
sudo apt-get install jq - Fedora/RHEL:
sudo dnf install jq - macOS:
brew install jq - Windows: Use Chocolatey:
choco install jqor download from stedolan.github.io/jq
- Clone this repository
- Make the scripts executable:
chmod +x vscode-extensions-manager.sh check_dependencies.sh- Keep your latest extension exports as backups before major system changes
- Edit the
vscode-extensions-to-be-removed.jsonfile to customize which extensions you want to remove - Use the
-yflag with caution as it will remove extensions without prompting - You can skip any extension by answering 'n' to its prompt when not using
-y
- "jq is not installed": The scripts will check for jq and notify you if it's missing. See the Requirements section for installation instructions.
- "VS Code CLI is not installed or not in PATH": Make sure VS Code is installed and the
codecommand is available from your terminal. Follow the instructions in the "Setting up the VS Code CLI" section above. - Permission denied errors: If you encounter permission errors when running the scripts, make sure they are executable using
chmod +x *.sh. - Empty extension list: If no extensions are listed, make sure VS Code is properly installed and the
codecommand works in your terminal.
Contributions are welcome! Please read the Contributing Guide for more information.
Please read the Code of Conduct to understand the community expectations.
This project is licensed under the MIT License - see the LICENSE file for details.
Jean-Philippe Maquestiaux (maquejp)
- Dependency Checks: Automatically verifies jq and VS Code are properly installed
- Interactive Prompts: Confirms each extension removal to prevent accidental deletions
- Timestamped Backups: Creates dated backups of your extension lists
- Detailed Error Messages: Provides clear instructions when issues are encountered
- Command Line Options: Flexible usage with various options for automation