VSCode Tasks Integration

Nash bridges the gap between VS Code's task system and nash's native task capabilities. You can define tasks in tasks.json, reference them from nash, and extend them with nash-only features like domain targeting and multi-step execution.

How It Works

When nash detects a .vscode/tasks.json file in your project or workspace, it converts those tasks into nash-compatible entries and merges them with any native nash tasks defined in .nash.toml.

Conversion Flow

tasks.json  ──►  Parse & map fields  ──►  Merge with .nash.toml  ──►  Available in command palette

Field Mapping

VS Code tasks.jsonNash .nash.toml Equivalent
labeltitle
type ("shell" / "process")Determines command vs argv execution style
commandMapped to command (shell) or argv (process)
argsAppended to command string or argv array
options.cwdcwd
options.envenv
options.shell.executableshell override
presentation.panel ("shared")Influences keep behavior
groupUsed for organization in the command palette

Basic Example

A standard VS Code tasks.json:

{ "version": "2.0.0", "tasks": [ { "label": "Build", "type": "shell", "command": "npm run build", "group": "build", "problemMatcher": [] } ] }

Nash converts this to an equivalent task that appears in the command palette with the title "Build", executing npm run build through the shell.

Extending VS Code Tasks with Nash Features

You can supplement VS Code tasks with native nash capabilities that have no VS Code equivalent:

# .nash.toml [[task]] id = "build-with-domain" title = "Build (Dedicated Domain)" command = "npm run build" domain = "build-domain" keep = true focus = false

This gives you the same build command but runs it in a dedicated spawn domain, keeps the output visible, and doesn't steal focus.

Two-Way Sync

  • VS Code → Nash: tasks.json tasks are automatically available in nash
  • Nash → VS Code: Native nash tasks are surfaced back to VS Code through the palette

Priority: when the same label/ID exists in both sources, the native nash definition takes precedence.

Continue to VS Code Task Conversion Details for a complete reference on how each field is handled.