workspace-templater is a VS Code extension for managing reusable project templates from one place and applying them safely to a workspace.
Features
- Register local template source directories.
- Browse template sets in the
Workspace TemplaterActivity Bar view. - Apply a template set to the current workspace.
- Detect existing-file conflicts before writing.
- Choose skip, overwrite, rename, or cancel for conflicts.
- Replace
{{workspaceName}},{{date}},{{year}}, and custom variables.
Quick Start
- Run
Workspace Templater: Add Template Source. - Select a directory that contains reusable template files or folders.
- Open the
Workspace TemplaterActivity Bar view. - Pick a template set and run
Apply Template. - Review any conflicts before files are written.
Template Structure
The selected source folder itself, every descendant folder, and every descendant file are treated as template sets.
You do not need to create a child folder with the same name as the selected source folder. A same-name child folder directly under the selected source is treated as a legacy workaround and is ignored.
templates/
ai-agent-docs/
template.json
AGENT.md
.codex/
config.toml
Optional template.json:
{
"displayName": "AI Agent Docs",
"description": "AGENT.md and assistant configuration files.",
"variables": [
{
"name": "projectName",
"label": "Project name",
"default": "{{workspaceName}}",
"required": true
}
],
"ignore": [".DS_Store"]
}
template.json is metadata for the folder that contains it and is not copied when applying templates. A single file template applies that one file to the workspace root.
Commands
Workspace Templater: Add Template SourceWorkspace Templater: Remove Template SourceWorkspace Templater: Refresh TemplatesWorkspace Templater: Apply TemplateWorkspace Templater: Preview TemplateWorkspace Templater: Diff Template FileWorkspace Templater: Open Template Source
Extension Settings
templater.sources: Template source directories.templater.defaultConflictAction: Default conflict action:ask,skip,overwrite, orrename.templater.enableVariableReplacement: Replace{{variable}}placeholders in text files.templater.renameSuffix: Suffix used when conflict action isrename.
Manual Check
- Run
npm installandnpm run compile. - Press F5 in VS Code to launch an Extension Development Host.
- Run
Workspace Templater: Add Template Sourceand select the repositoryexamplesdirectory. - Open another workspace, choose
AI Agent Docsin theWorkspace Templaterview, and runApply Template. - Re-run apply against the same workspace to verify conflict handling and
Diff Template File.
Development
npm install
npm run compile
npm run test
npm run lint