The Consolidate extension for Visual Studio Code allows you to quickly consolidate all or selected files from your workspace into a single text file. This is particularly useful for sharing project files in a single document, reviewing multiple files at once, or even preparing files for use in AI tools like GPT, where referencing multiple files in a web prompt can be challenging.
Features
Consolidate All Files: Combines the contents of all files in your workspace into a single output file, respecting .gitignore and hidden files.
Consolidate Selected Files: Right-click on selected files or folders in the explorer to combine their contents into a single output file, with the option to include hidden or ignored files.
Custom Output File Name: Easily specify the name of the output file.
Usage
1. Consolidate All Files
Open the command palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux).
Type Consolidate Files and press Enter.
Enter the desired output file name (e.g., consolidated_output.txt).
The contents of all non-hidden, non-ignored files will be consolidated into the specified file.
2. Consolidate Selected Files
Select the files or folders in the explorer that you want to consolidate.
Right-click and choose Consolidate Selected Files.
Enter the desired output file name.
The contents of the selected files will be consolidated into the specified file.
Installation
Open VS Code.
Go to the Extensions view (Cmd+Shift+X on macOS, Ctrl+Shift+X on Windows/Linux).