Workspace Templater
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 Templater Activity 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 Templater Activity 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 Source
Workspace Templater: Remove Template Source
Workspace Templater: Refresh Templates
Workspace Templater: Apply Template
Workspace Templater: Preview Template
Workspace Templater: Diff Template File
Workspace Templater: Open Template Source
Extension Settings
templater.sources: Template source directories.
templater.defaultConflictAction: Default conflict action: ask, skip, overwrite, or rename.
templater.enableVariableReplacement: Replace {{variable}} placeholders in text files.
templater.renameSuffix: Suffix used when conflict action is rename.
Manual Check
- Run
npm install and npm run compile.
- Press F5 in VS Code to launch an Extension Development Host.
- Run
Workspace Templater: Add Template Source and select the repository examples directory.
- Open another workspace, choose
AI Agent Docs in the Workspace Templater view, and run Apply 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