voidzero-dev / voidzero-dev/vite-task

Proposal: per-task shell/interpreter selection (bash/zsh/pwsh/node) + explicit script mode

Open
#275 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
466
Forks
42
Avg merge
1d 15h
Merged PRs (30d)
19

Description

Problem

Vite Tasks currently tries to parse commands statically (e.g. && lists) and otherwise falls back to running a shell (/bin/sh -c on Unix or cmd.exe /c on Windows).
However, many real-world tasks need:

  • PowerShell on Windows,
  • bash-specific features on Unix (vs /bin/sh),
  • or explicit “always run as script” mode (never try to split/parse).

Not being able to choose the interpreter makes scripts less portable and pushes authors to wrap everything manually.

Evidence (primary)

  • Plan has a hard-coded fallback to /bin/sh -c or cmd.exe /c.

Refs:

Proposed behavior (Unspecified syntax)

Add an optional per-task configuration, e.g.:

  • shell: "bash -c" or shell: ["powershell.exe","-NoLogo","-Command"]
    and/or an execution mode:
  • mode: "auto" (current behavior),
  • mode: "shell" (always run as script via chosen shell),
  • mode: "spawn" (strict direct spawn; fail if not representable)

Use cases

  • Windows repos standardizing on PowerShell scripts
  • bash-only constructs (process substitution, arrays, [[ ... ]], etc.)
  • Avoiding accidental fallback when a task should be strictly spawnable

Backward compatibility

  • Default remains current behavior (auto).
  • Opt-in only changes behavior for tasks that specify shell/mode.

Minimal implementation suggestion (MVP)

  • Implement shell override for the existing fallback pipeline first:
    if shell is set, run the task command as one script in that shell (no splitting).
  • Later iterations can decide whether/how to combine with && splitting and caching.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crates/vite_task_plan/src/plan.rs and PR #100 to understand the existing fallback and shell-argument handling. The MVP is complete when an optional per-task shell runs the command as one script while preserving the default behavior; the syntax and interaction with other modes still need design decisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.