Run configurable sequences of VS Code commands and shell commands on file save.
Define ordered pipelines in settings.json — no keybindings, no code, no extra extensions needed.
- Execute any VS Code command ID and shell command in sequence on save
- Filter by
languageIdand globexcludepatterns - Built-in placeholders:
${file},${workspaceFolder},${relativeFile},${env.VAR}and more waitUntil— VS Code waits for all steps to complete before writing to disk- Zero dependencies (pure Node.js + VS Code API)
- Output Channel logging with auto-reveal on errors
- Command validation on startup and config change
- VS Code
^1.80.0
Edit your settings.json:
| Field | Type | Required | Description |
|---|---|---|---|
command |
string |
① | VS Code command ID |
shell |
string |
① | Shell command (placeholders supported) |
cwd |
string |
× | Working directory (default: ${workspaceFolder}) |
timeout |
number |
× | Shell timeout in ms (default: 30000) |
env |
object |
× | Extra env vars for shell step |
① command / shell must specify exactly one per step.
| Field | Type | Required | Description |
|---|---|---|---|
event |
string |
× | Trigger event. v0.1: only "onSave" (default) |
languages |
string[] |
× | Filter by document.languageId. Empty = all files |
label |
string |
× | Shown in Output Channel logs |
exclude |
string[] |
× | Glob patterns to exclude files |
steps |
Step[] |
√ | Ordered steps to execute |
| Placeholder | Example | Replaced with |
|---|---|---|
${file} |
C:\project\docs\guide.md |
Absolute file path |
${fileBasename} |
guide.md |
File name + extension |
${fileBasenameNoExt} |
guide |
File name, no extension |
${fileExtname} |
.md |
File extension |
${fileDirname} |
C:\project\docs |
File directory |
${relativeFile} |
docs\guide.md |
Path relative to workspace |
${workspaceFolder} |
C:\project |
Workspace root |
${cwd} |
— | VS Code process cwd |
${env.VAR} |
— | Environment variable |
- This extension does not disable
editor.formatOnSave. If both are enabled, formatting may run twice. Recommended: disable native format-on-save and addeditor.action.formatDocumentexplicitly in your pipeline. - Shell commands run with the same privileges as the VS Code process. The security model matches VS Code's built-in tasks.
- No
whenclause support yet (v0.2 planned) - Command steps do not support arguments (
argsfield planned in v0.3+) - No data passing between steps
See CHANGELOG.md for version history.