A VSCode extension that allows you to run arbitrary shell tasks and pipe their outputs directly into the editor at cursor position.
- Shell Command Execution: Run any shell command from VSCode
- Text Insertion: Insert command output directly at cursor position
- Multiple Insertion Modes: Cursor, selection replacement, line-end, document-end
- Task Management: Reuse tasks defined in .vscode/tasks.json
- Cross-Platform: Works on Windows, macOS, and Linux
- Output Processing: Format and filter command output
- Variable Substitution: Resolve
${workspace*},${env:*}, and${config:*}placeholders with redacted logging - Progress Tracking: Visual feedback for running commands
- Notifications: User-friendly feedback system
| Command | Description | Command ID |
|---|---|---|
CmdPipe: Run Task |
Show task picker and run selected task | cmdpipe.runTask |
CmdPipe: Quick Command |
Enter and run a custom shell command and insert output | cmdpipe.quickCommand |
CmdPipe: Execute Selection |
Execute selected text as shell command | cmdpipe.executeSelection |
CmdPipe: Insert Date/Time |
Insert current date and time at cursor | cmdpipe.insertDateTime |
CmdPipe Config: Show Logs |
View extension logs | cmdpipe.config.showLogs |
CmdPipe Config: Refresh Tasks |
Refresh task configurations | cmdpipe.config.refreshTasks |
CmdPipe Config: Create Workspace Tasks |
Create tasks.json for workspace | cmdpipe.config.createWorkspaceTasks |
CmdPipe Config: Open User Configuration |
Open user configuration directory | cmdpipe.config.openUserConfig |
CmdPipe Config: Show Task Errors |
Display task configuration errors | cmdpipe.config.showTaskErrors |
CmdPipe Config: Validate Task Configurations |
Validate all task configurations | cmdpipe.config.validateTaskConfigs |
- Workspace-defined tasks are automatically blocked when VS Code marks the workspace as untrusted or undecided.
- User-defined tasks remain runnable and are surfaced separately in the task picker for quick access.
- Blocked workspace tasks display a lock icon and guidance in the picker so the restriction is clear before execution.
- Choosing a blocked task opens trust management actions
-
Open Command Palette:
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS) -
Run a Quick Command:
- Type:
CmdPipe: Quick Command - Type "echo Hello from CmdPipe!" in the prompt
- This will insert "Hello from CmdPipe!" at your cursor
- Type:
-
Run a Task:
- Type:
CmdPipe: Run Task - Select from available tasks that are predefined in .vscode/tasks.json
- Type:
-
Execute Selection:
- Select some text in your editor
- Type:
CmdPipe: Execute Selection as Command - The selected text will be executed as a shell command
The cmdpipe.runTask command opens a task picker that allows you to select and execute tasks defined in your workspace or user configuration. The output of the executed task is inserted at the current cursor position in the active editor.
You can add a custom keyboard shortcut for the cmdpipe.runTask command in your keybindings.json:
{
"key": "alt+shift+m",
"command": "cmdpipe.runTask",
"args": "active-meeting-header"
}This binds Alt+Shift+M to execute the active-meeting-header task and insert its output at your cursor position.
The args parameter specifies the name of the task to execute. If omitted, the task picker will be shown to select a task interactively.
The task must be defined in your workspace's tasks.json or in the user configuration for it to be available for execution.
The cmdpipe.insertDateTime command inserts the current date and time at the cursor position. This is useful for quickly adding timestamps to documents or notes.
The command can be bound to a keyboard shortcut for faster access. The format of the inserted date and time can be customized in the extension settings. The command supports multiple date and time formats, including ISO, locale-specific, and custom formats defined by the user.
Valid formats: iso, local, date, time, us-date, eu-date, long, short, timestamp, custom
You can add a custom keyboard shortcut for the cmdpipe.insertDateTime command in your keybindings.json:
{
"key": "alt+shift+d",
"command": "cmdpipe.insertDateTime",
"args": "us-date"
}
{
"key": "alt+shift+c",
"command": "cmdpipe.insertDateTime",
"args": "time",
}This binds Alt+Shift+D to insert the current date in the us-date format at your cursor position and Alt+Shift+C to insert the current time.
The cmdpipe.quickCommand command allows you to execute any shell command and insert its output directly at the cursor position in the active editor. This is useful for quickly running commands without leaving the editor context.
The cmdpipe.executeSelection command executes the currently selected text in the active editor as a shell command and inserts the output at the cursor position. This is particularly useful for running snippets of code or commands directly from your document similar to a REPL environment like Notebook cells.
The extension provides several commands to manage and configure its behavior:
cmdpipe.config.showLogs: Opens the extension's log output for debugging and monitoring.cmdpipe.config.refreshTasks: Refreshes the task configurations from the workspace and user settings.cmdpipe.config.createWorkspaceTasks: Creates a defaulttasks.jsonfile in the workspace if it doesn't exist.cmdpipe.config.showTaskErrors: Displays any errors found in the task configurations.cmdpipe.config.validateTaskConfigs: Validates all task configurations and reports any issues.
To learn more about configuring the extension, see the Configuration section in the documentation.
CmdPipe resolves VS Code style placeholders before a task executes, so configuration stays portable across machines and workspaces.
- Workspace tokens:
${workspaceFolder},${workspaceFolder:<name>},${workspaceFolderBasename},${relativeFile},${file},${fileDirname},${fileBasename},${fileBasenameNoExtension},${fileExtname} - Environment tokens:
${env:VAR_NAME}mergeprocess.env, workspace defaults, and task-level overrides; missing values block execution and resolved values are redacted in logs. - Configuration tokens:
${config:cmdpipe.shell.defaultWorkingDirectory}(and other settings) honor VS Code scope precedence and require string-like values.
Example task definition:
{
"id": "publish-docs",
"command": "${workspaceFolder}/scripts/publish.sh",
"args": ["--target", "${config:cmdpipe.deploy.channel}"],
"workingDirectory": "${workspaceFolder}",
"environmentVariables": {
"API_TOKEN": "${env:API_TOKEN}"
}
}Use CmdPipe Config: Show Logs to review substitution summaries when troubleshooting placeholder failures or redacted values.
MIT License - see LICENSE file for details.