feat(vars): add interactive prompting for required variables by vmaerten · Pull Request #2579 · go-task/task
marked this pull request as ready for review
Add support for interactive variable prompting using Bubble Tea. Variables can be marked as `interactive: true` in the requires section, and users will be prompted to enter values for missing variables when running in a TTY. Features: - New `interactive` field on required variables - Bubble Tea-based text input and select prompts - --no-tty flag to disable interactive prompts - Automatic skip when variable is already set
- Add SyncWriter to synchronize stdout/stderr writes with prompts - Add promptMutex to serialize interactive prompts - Keep rawStdout/rawStderr for BubbleTea to avoid deadlock - Update test Taskfile with nested deps scenario
- Add collectAllRequiredVars to traverse dep tree and find missing vars - Add promptForAllVars to prompt for all vars at once - Store prompted vars on Executor and inject into all RunTask calls - Remove redundant GetTask call in collectAllRequiredVars - Make SyncWriter conditional on TTY presence
Update Charm libraries to v2: - charm.land/bubbletea/v2 v2.0.0-rc.2 - charm.land/bubbles/v2 v2.0.0-rc.1 - charm.land/lipgloss/v2 v2.0.0-beta.3 Adapt code to v2 API changes: - tea.KeyMsg → tea.KeyPressMsg with msg.Keystroke() - View() string → View() tea.View with tea.NewView() - ti.Width field → ti.SetWidth() method - ti.Focus() moved to Init() returning tea.Cmd
Copilot AI pushed a commit to libor-m/task that referenced this pull request
Mar 27, 2026…#2579) Co-authored-by: libor-m <1497769+libor-m@users.noreply.github.com>
Copilot AI pushed a commit to libor-m/task that referenced this pull request
Mar 27, 2026This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters