File Combiner
A VS Code extension that combines multiple files from your workspace into a single text file with customizable ignore patterns, so that it can be provided to LLM models for context.
Features
- Automatic workspace scanning: Combines all files in your workspace automatically
- Customizable ignore patterns: Configure which files and folders to exclude
- Environment file handling: Special handling for .env files with placeholder values
- Configurable output: Customize output filename and format
- Deep directory traversal: Processes files in nested directories
Usage
- Open a workspace/folder in VS Code
- Open the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
)
- Run the command:
File Combiner: Combine Files
- The extension will create a combined file in your workspace root
Configuration
You can customize the extension's behavior through VS Code settings:
fileCombiner.ignoredDirectories
Array of directory names to ignore during file combination.
Default:
[
"node_modules", "dist", "build", "out", "coverage", "__pycache__",
"venv", ".venv", ".idea", ".vscode", "logs", "deploy", "temp", "tmp",
".git", ".svn", ".hg", ".cache"
]
fileCombiner.ignoredFiles
Array of specific filenames to ignore.
Default:
["package-lock.json", "yarn.lock", ".DS_Store", "Thumbs.db"]
fileCombiner.ignoredPatterns
Array of file patterns to ignore (supports wildcards).
Default:
["*.log", "*.bak", "*.swp", "*~", "#*#", "*.iml", "*.class", "*.jar", "*.war", "*.pyc"]
fileCombiner.outputFileName
Name of the output file.
Default: "combined.txt"
fileCombiner.handleEnvFiles
Enable special handling for .env files (replaces values with placeholders).
Default: true
Include file path comments in the output.
Default: true
Environment File Handling
When handleEnvFiles
is enabled:
- If
.env.example
exists in your workspace, .env
files are ignored
- If
.env.example
doesn't exist, .env
files are processed with placeholder values
- Example:
API_KEY=secret123
becomes API_KEY=<api_key>
Customization Examples
Adding Custom Ignore Patterns
To ignore all .temp
files and backup
directories:
{
"fileCombiner.ignoredPatterns": [
"*.log", "*.bak", "*.swp", "*~", "#*#", "*.iml",
"*.class", "*.jar", "*.war", "*.pyc", "*.temp"
],
"fileCombiner.ignoredDirectories": [
"node_modules", "dist", "build", "out", "coverage", "__pycache__",
"venv", ".venv", ".idea", ".vscode", "logs", "deploy", "temp", "tmp",
".git", ".svn", ".hg", ".cache", "backup"
]
}
To change the output filename and disable file comments:
{
"fileCombiner.outputFileName": "merged-code.txt",
"fileCombiner.includeFileComments": false
}
Requirements
Release Notes
1.0.0
- Initial release
- Configurable ignore patterns
- Environment file handling
- Automatic workspace scanning
Contributing
Found a bug or want to contribute? Visit our GitHub repository.
License
MIT License