Build, refactor, and debug Bash command-line and terminal UI scripts with safe argument parsing, non-interactive fallback, and robust error handling. Use when tasks involve shell tools with flags/subcommands, interactive prompts/menus (gum/dialog/select), colored output/logging, or portable scripting on Linux/macOS.
Implement reliable Bash CLIs and TUIs that work both interactively and in automation (--yes, CI, cron, SSH).
--help, --verbose, --yes, clear exit codes.set -euo pipefail by default.case loop, not positional guessing.cmd <subcommand> [options]).0 success2 usage/invalid args>=1 runtime errors--yes / env flag).gum if available.gum missing or non-TTY.NO_COLOR.mktemp for transient files and clean up with trap.