VS-Code Folder Templates is an extension that creates your folders/files as specified in custom templates.
Why? Because creating the same directories over and over again is annoying to do manually.

To create your templates you have two options.
settings.json from VSCode and create templates manually. (Open the command palette and select "Open Settings (JSON)" to easily access your settings.json)The value <FTName> (or [FTName]) will always be interpolated into the component name you are asked for when creating the structure.
Adding a transformer with this pattern <FTName | transformer> (or <FTName % transformer>) will give you the ability to transform your componentname wherever needed.
The currently supported transformers are:
lowercaseuppercasecamelcasecapitalcaseconstantcasedotcaseheadercasenocaseparamcasepascalcasepathcasesentencecasesnakecasesingularplurallowercasefirstcharcapitalizekebabcaseIt is possible to specify a set of custom Variables which will be interpolated as well. You will be asked to enter a value for every custom variable defined. They can be transformed the same way as the default <FTName>
Examples
| Input | Transformer | Result | Description |
|---|---|---|---|
| LOWERCASE | \<FTName | lowercase> | lowercase | |
| uppercase | \<FTName | uppercase> | UPPERCASE | |
| My-new-component | \<FTName | camelcase> | myNewComponent | (First letter is lowercased. Every letter behind a special character will be capitalized) |
| test string | \<FTName | capitalcase> | Test String | |
| test string | \<FTName | constantcase> | TEST_STRING | |
| test string | \<FTName | dotcase> | test.string | |
| test string | \<FTName | headercase> | Test-String | |
| test string | \<FTName | nocase> | test string | |
| test string | \<FTName | paramcase> | test-string | |
| my-new-component | \<FTName | pascalcase> | MyNewComponent | (First letter and every letter behind a special character will be capitalized) |
| test string | \<FTName | pathcase> | test/string | |
| test string | \<FTName | sentencecase> | Test string | |
| test string | \<FTName | snakecase> | test_string | |
| boxes | \<FTName | singular> | box | |
| box | \<FTName | plural> | boxes | |
| wooden box | \<FTName | plural?snakecase?uppercase> | WOODEN_BOXES | it is possible to combine transformations with the "?" or "&" operator, these will be performed from left to right. |
| wooden box | [FTName \% plural&snakecase&uppercase] | WOODEN_BOXES | "&" operator example of row above |
| MyNewComponent | \<FTName | lowercasefirstchar> | myNewComponent | |
| myNewComponent | \<FTName | capitalize> | MyNewComponent | just like capitalcase |
| myNewComponent | \<FTName | kebabcase> | my-new-component | just like paramcase |
| aaa | \<FTName | replacefirst('a', 'b')> | baa | IMPORTANT: Due to filesystem limitations (thanks Windows) only single quotes (') will work to annotate the string in the replacefirst function. |
| aaa | \<FTName | replacelast('a', 'b')> | aab | IMPORTANT: Due to filesystem limitations (thanks Windows) only single quotes (') will work to annotate the string in the replacelast function. |
| aaa | \<FTName | replace('a', 'b')> | bbb | IMPORTANT: Due to filesystem limitations (thanks Windows) only single quotes (') will work to annotate the string in the replace function. |
As of v3.12.0 it is possible to add dates to a file name or its content. However it will only be possible to add the current time in your local time zone or UTC. The way to achieve this is by using the placeholder [DATE_NOW(FORMATSTRING)] for local timezone or [DATE_NOW_UTC(FORMATSTRING)] for UTC time.
As an example [DATE_NOW('yyyy-mm-dd')] will result in 2024-03-04. Please take a look at this https://date-fns.org/v2.30.0/docs/format documentation to see all the available formatting patterns.
One option is to create a .fttemplates folder in your project root and save all templates you want to access in this project there. This path can be changed via the folderTemplates.templateFolderPath setting in your vscode settings.
To use global templates over multiple projects use the Set Custom Global Folder Templates Directory command to choose a folder which functions as a global .fttemplates directory.
DEPRECATED: You can also use the global template folder that exists in the directory of this extension.
Create a folder with files and folders inside your template directory and use placeholders wherever you need them. That's it. You created your template. It works out of the box but if you need some special settings for a template you can create a .ftsettings.json file inside your template folder.
See more in the examples
This setting is used to deviate from the default .fttemplates folder path at the root of your project folder. If this setting is set then Folder Templates will look for your templates at the specified path (relative to your project root)
.fttemplates| Key | Type | Default | Description |
|---|---|---|---|
| name | string | Name of parent folder | Name of the folder Template |
| customVariables | string[] variableName=>defaultvalue |
- | Custom variables to be interpolated upon folder creation |
| omitParentDirectory | boolean | false | If set to true FT will create all files directly inside the current folder instead of creating a new folder and all the files inside of it. |
| omitFTName | boolean | false | If set to true FT will not ask for a component name. (Can only be set to true if omitParentDirectory is true as well) |
| overwriteExistingFiles | "never" | "always" | "prompt" | "never" | If set to always all existing files will be overwritten. If set to prompt user will be asked which files shall be overwritten upon foldercreation. |
| openFilesWhenDone | string[] | - | List of files to open when the Folder Template is created. (Supports use of variables, see examples) |
| setExecutablePermission | boolean | false | If set to true automatically adds executable permission to created file. Only works if file in the template is also executable. |
| absolutePath | boolean | false | If set to true all files will be created relative to the project root. Not relative to the folder you clicked on. (Can only be set to true if omitParentDirectory is true as well) |
| templateNotation | {start: string[], end: string[]} | {start: ["<","["], end: [">", "]"]} |
If you would like to customize how to annotate strings that should be interpolated use this option |
There are two key parts to creating your FT Templates. Folder Structures and File Templates.
The folderTemplates.structures option takes an array of objects where one object equals one Folder Structure.
Example Structure
{
"name": "My Custom Template",
"customVariables": ["CustomVar", "CustomVar2"],
"omitParentDirectory": true,
"structure": [
{
"fileName": "<FTName>.jsx",
"template": "Typescript Functional Component"
},
{
"fileName": "tests/<FTName>.test.js"
},
{
"fileName": "index.js",
"template": "IndexFile"
},
{
"fileName": "bashfile.sh",
"template": "echo \"Hello World\"",
"isExecutable": true
},
{
"fileName": "<CustomVar>",
"template": "EmptyDirectory"
}
]
}
| Key | Type | Default | Description |
|---|---|---|---|
| name | string | Name of parent folder | Name of the folder Template |
| customVariables | string[] variableName=>defaultvalue |
- | Custom variables to be interpolated upon folder creation |
| structure | {fileName: string, template?: string}[] | - | Every object in this array represents a File or Folder that will be created |
| omitParentDirectory | boolean | false | If set to true FT will create all files directly inside the current folder instead of creating a new folder and all the files inside of it. |
| omitFTName | boolean | false | If set to true FT will not ask for a component name. (Can only be set to true if omitParentDirectory is true as well) |
| overwriteExistingFiles | "never" | "always" | "prompt" | "never" | If set to always all existing files will be overwritten. If set to prompt user will be asked which files shall be overwritten upon foldercreation. |
| openFilesWhenDone | string[] | - | List of files to open when the Folder Template is created. (Supports use of variables, see examples) |
| setExecutablePermission | boolean | false | If set to true automatically adds executable permission to created file. Only works if file in the template is also executable. |
| absolutePath | boolean | false | If set to true all files will |
$ claude mcp add vscode-folder-templates \
-- python -m otcore.mcp_server <graph>