Skip to content

Comments

feat(cmd): add ask option to commands#2701

Open
vmaerten wants to merge 2 commits intomainfrom
feat/command-level-prompt
Open

feat(cmd): add ask option to commands#2701
vmaerten wants to merge 2 commits intomainfrom
feat/command-level-prompt

Conversation

@vmaerten
Copy link
Member

@vmaerten vmaerten commented Feb 21, 2026

Summary

Add an ask attribute to commands that shows a y/n confirmation before executing. If the user declines, the command is skipped but the task continues with the next command.

Example:

cmds:
  - cmd: echo "Deploying..."
    ask: "Deploy to production?"
  - task: run-migrations
    ask: "Run database migrations?"

This differs from task-level prompt: which cancels the entire task if declined. Command-level ask: only skips the individual command.

The motivation is building interactive workflows (e.g. "commit? → changelog? → push?") where each step can be individually confirmed. This is technically achievable today by combining if: with interactive variables, but the ergonomics are poor and require verbose boilerplate for what should be a simple pattern.

Add an `ask` attribute to commands that shows a y/n confirmation
before executing. If the user declines, the command is skipped but
the task continues with the next command.

Example:
```yaml
cmds:
  - cmd: echo "Deploying..."
    ask: "Deploy to production?"
  - task: run-migrations
    ask: "Run database migrations?"
```

Behavior:
- Default: asks for y/n confirmation
- --yes: auto-confirms all asks
- --dry: shows commands without asking

This differs from task-level `prompt:` which cancels the entire task
if declined. Command-level `ask:` only skips the individual command.
@vmaerten vmaerten marked this pull request as ready for review February 22, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant