denoland/deno

Add interactive task picker: `deno task --interactive`

Opened this issue · 2 comments

Summary

Today, running deno task with no args lists the available tasks, but there’s no built-in way to pick and run one interactively. I’m proposing an --interactive (-i) flag that opens a simple TUI where you can navigate with ↑/↓ and press Enter to run the selected task. This would improve discoverability and ergonomics in projects with many tasks and in workspaces.

Current behavior

  • deno task prints the available tasks (from the current and ancestor configs) and exits. There is no --interactive flag today.
  • Existing flags include --filter/--recursive for workspaces, but nothing for interactive selection.

Proposed behavior

  • deno task --interactive (alias -i) launches a full-screen or inline selector that lists tasks.
  • Keyboard: ↑/↓ to move, Enter to run, Esc/q to quit.
  • Optional type-to-filter (basic substring or fuzzy).
  • Each row shows the task name; if present, show the "description" field as a subtitle.
  • Workspace-aware: respects --filter and --recursive to limit what’s shown.
  • After selection, pass through any extra CLI args, e.g. deno task -i -- --watch.
  • Non-interactive output remains unchanged; --interactive only affects the selection UI.

Why this helps

  • Faster discovery and execution when a project has many tasks or a monorepo workspace.
  • Matches common CLI patterns; for example, the just task runner offers an interactive chooser via --choose.

Prior art / alternatives

  • External tools like fzf can be scripted to approximate this, but a first-party --interactive mode would be cross-platform and require no extra dependencies.

Open questions

  • Should filtering be fuzzy or plain substring?
  • Do we show tasks from ancestor deno.json files by default (as deno task does today), or limit to the nearest config unless --recursive/--filter is provided?
  • Should there be a DENO_TASK_INTERACTIVE=1 env toggle for users who always want this mode?

Does any other JS package manager have this functionality?

yarn has an interactive one when you do yarn run. Haven't heard many people use that part specifically. Don't think other package managers have this.