Description
scorpiox-askuserquestion is a core CLI tool that presents interactive multiple-choice questions to users through a terminal user interface (TUI). It accepts a JSON-formatted questions payload, renders a navigable selection UI in the terminal, and returns structured JSON with the user's selected answers. This tool is used by ScorpioX Code agents and automation workflows to gather user input during interactive sessions — such as selecting configuration options, confirming actions, or choosing between alternatives.
Flags & Options
| Flag | Short | Description | Takes Value |
|---|---|---|---|
--help |
-h |
Display help information and usage guide | Yes |
--version |
— | Print the version number and exit | No |
Usage Examples
Basic — Single question with options
# Present a single question with three choices scorpiox-askuserquestion '{"questions":[{"text":"Which database do you want to use?","options":["PostgreSQL","SQLite","MySQL"]}]}' # User sees a TUI with arrow-key navigation, selects an option # Returns JSON to stdout: {"answers":[{"question":"Which database do you want to use?","selected":"PostgreSQL"}]}
Multiple questions in one session
# Ask several questions in sequence scorpiox-askuserquestion '{"questions":[ {"text":"Select your target platform:","options":["Linux","macOS","Windows","All"]}, {"text":"Build type:","options":["Debug","Release","RelWithDebInfo"]}, {"text":"Enable tests?","options":["Yes","No"]} ]}' # Output after user completes all selections: {"answers":[ {"question":"Select your target platform:","selected":"Linux"}, {"question":"Build type:","selected":"Release"}, {"question":"Enable tests?","selected":"Yes"} ]}
Piping into automation scripts
# Capture user choice and branch on the result ANSWER=$(scorpiox-askuserquestion '{"questions":[{"text":"Deploy to which environment?","options":["staging","production","canary"]}]}') # Parse the selected value with jq ENV=$(echo "$ANSWER" | jq -r '.answers[0].selected') echo "Deploying to $ENV..."
Agent workflow integration
# ScorpioX Code agents invoke this tool when they need user decisions # The agent sends a questions_json parameter via the tool interface: scorpiox-askuserquestion '{"questions":[ {"text":"The config file already exists. What should I do?","options":["Overwrite","Backup and replace","Skip","Abort"]} ]}' # The agent receives the structured response and acts accordingly {"answers":[{"question":"The config file already exists. What should I do?","selected":"Backup and replace"}]}
Version check
scorpiox-askuserquestion --version scorpiox-askuserquestion 1.0.0
Source & Build Info
Source File
scorpiox/scorpiox-askuserquestion.c
Lines of Code
934
Dependencies
libsxutil