diff --git a/docs/cli/tool-permissions.mdx b/docs/cli/tool-permissions.mdx index 5273a116dd4..5586fd6fdf7 100644 --- a/docs/cli/tool-permissions.mdx +++ b/docs/cli/tool-permissions.mdx @@ -12,7 +12,23 @@ Every tool has one of three permission levels: ## Defaults -Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`) default to `allow`. Write tools (`Edit`, `MultiEdit`, `Write`) and `Bash` default to `ask`. In [headless mode](/cli/headless-mode), `ask` tools are excluded since there's no one to approve them. +Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`, `AskQuestion`, `Checklist`, `Status`, `CheckBackgroundJob`, `ReportFailure`, `UploadArtifact`) default to `allow`. Write tools (`Edit`, `MultiEdit`, `Write`) and `Bash` default to `ask`. In [headless mode](/cli/headless-mode), `ask` tools are excluded since there's no one to approve them. + +## AskQuestion tool + +`AskQuestion` is a built-in read-only tool that lets the agent pause and ask for clarification before continuing. + +### Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `question` | `string` | Yes | The prompt shown to the user | +| `options` | `string[]` | Yes | Suggested choices; use an empty array for free-form input | +| `defaultAnswer` | `string` | No | Used when the user submits without typing a response | + +### Permission behavior + +`AskQuestion` is `allow` by default in normal, plan, and auto modes. It does not modify files or run commands. ## Overriding with flags diff --git a/docs/cli/tui-mode.mdx b/docs/cli/tui-mode.mdx index 44999ed6073..d4c5859912f 100644 --- a/docs/cli/tui-mode.mdx +++ b/docs/cli/tui-mode.mdx @@ -49,6 +49,17 @@ cn --resume This restores the full conversation history, so the agent remembers prior context. +## Interactive questions in TUI mode + +The agent can use the `AskQuestion` tool to gather clarifications before it continues. You will see a quiz-style prompt directly in the terminal. + +- Use / to highlight an option +- Press Enter to submit the highlighted option +- Start typing to send a custom answer (even when options are shown) +- If a default answer is provided, pressing Enter on an empty input submits that default + +This is useful when the agent needs decisions like scope, preferences, or environment details before making edits. + ## Tool Permissions Tools that can modify your system (file writes, terminal commands) prompt for approval before executing. You get three options: @@ -57,4 +68,4 @@ Tools that can modify your system (file writes, terminal commands) prompt for ap - **Continue + don't ask again** — approve and save a policy rule to `~/.continue/permissions.yaml` - **No** — reject the call and give the agent new instructions -Read-only tools (`Read`, `List`, `Search`, `Fetch`) run automatically. See [tool permissions](/cli/tool-permissions) for the full policy system. +Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`, `AskQuestion`) run automatically. See [tool permissions](/cli/tool-permissions) for the full policy system.