vstask
A command-line tool to run VS Code tasks from the terminal.
Overview
vstask allows you to execute VS Code tasks defined in .vscode/tasks.json directly from the command line, without needing to open VS Code. It supports all the features of VS Code tasks including:
- Shell and process tasks
- Platform-specific configurations (Windows, Linux, macOS)
- Working directory changes (
cwd) - Environment variables
- Background tasks
- Variable substitution (e.g.,
${workspaceFolder},${env:VAR})
Installation
Using Cargo
If you have Rust installed, you can install vstask directly from crates.io:
This will install the binary to ~/.cargo/bin/ which should be in your PATH.
From Source
The binary will be available at target/release/vstask.
You can then copy it to a location in your PATH:
# or
Usage
Run a Task
List All Available Tasks
# or
Run Without Arguments
Running vstask without any arguments will display a list of available tasks:
Shell Completion
Zsh
Add the following to your ~/.zshrc for dynamic task name completion:
# --- vstask Dynamic Completion ---
After adding this, reload your shell configuration:
Now you can use tab completion when typing task names:
HINT: Use " if the tasks contain spaces for the auto complete to display without the escape character.
Requirements
- A
.vscode/tasks.jsonfile in your project directory - Rust 1.70+ (for building from source)
License
- MIT License
- Apache License, Version 2.0