The File Generator extension for Visual Studio Code (VS Code) is a handy tool that allows you to generate files and folders based on a predefined configuration. It simplifies the process of creating project structures and boilerplate files by automating the file generation process.
- Create files and folders based on a configuration with two mouse clicks.
- Define project structures using a simple JSON-based configuration.
- Customize the destination directory for file generation.
- Select configuration preset from the file to generate specific structures.
- Installation:
- Install the extension from the VS Code Marketplace.
- Create a configuration in
settings.json;
- Configuration:
- Inside
settings.jsonaddfilesgen.presets - As value you can use object, or array to define file and folder structure
- You can define structure in one of the following ways:
JSON Array Format:
{
"filesgen.presets": ["ui.tsx", "utils.ts", "api.ts"]
}JSON Object Format:
{
"filesgen.presets": {
"my_preset_name_1": [
"api.ts",
{
"ui": ["header.tsx", "content.tsx", "index.ts"]
},
"utils.ts"
],
"my_preset_name_2": {
"helpers": [],
"api": ["index.ts"],
"ui": [
"index.ts",
{
"header": ["header-left.tsx", "header-right.tsx"]
},
"sidebar.tsx",
{
"content": ["banner.tsx", "form.tsx"]
}
]
}
}
}Using Object allows you to store multiple presets and select the one you want to use when generating files.
- Generate Files:
-
To generate files using the mouse:
- Right-click on a specific folder or directory within the project explorer.
- Choose
"Generate Files from JSON"from the context menu.
- Alternatively, you can generate files using the command palette:
- Press
Ctrl+Shift+P(Cmd+Shift+Pon MacOs) to open the command palette. - Search for
"Generate Files"and select"FilesGen: Generate Files from JSON"from the command list. - Follow the prompts to specify the destination directory and select a configuration preset.
- Press
Files and folders will be generated based on the selected configuration.
There are no known issues at the moment. If you encounter any problems, please report them on the FilesGen.
- Version 0.0.1
- Initial release of the FilesGen extension.
- Version 0.0.2
- Added the ability to customize the destination directory.
- Version 0.0.3
- Added the overwrite strategy
- Version 0.0.4
- Minor updates
- Version 0.1.0
- Release MVP
- Version 0.1.1
- Update readme description
- Version 0.1.2
- Minor updates

