Adding hints to APIs that are potentially destructive was handled in elastic/schemas-js#25. The hints will be used by MCP and Agent Builder, so we should add a corresponding feature to the CLI.
Proposed experience:
- By default, destructive actions wait for interactive confirmation:
This is a potentially destructive action. Do you want to continue? [y/N]
- Confirmation step is skipped if any of the following are true:
--yes CLI flag is used
YES=true env var is set
require_confirmation: false is set in the config file
- allow/blocklist filtering configuration (
commands.allowed, commands.blocked) is extended to include commands.block_destructive that takes a boolean.
- if
true, destructive commands are implicitly added to commands.blocked
- if
false or unset, destructive commands are allowed
- if
false but a commands.allowed list is also present, the option is ignored to avoid accidentally making the allowlist overly permissive
Adding hints to APIs that are potentially destructive was handled in elastic/schemas-js#25. The hints will be used by MCP and Agent Builder, so we should add a corresponding feature to the CLI.
Proposed experience:
This is a potentially destructive action. Do you want to continue? [y/N]--yesCLI flag is usedYES=trueenv var is setrequire_confirmation: falseis set in the config filecommands.allowed,commands.blocked) is extended to includecommands.block_destructivethat takes a boolean.true, destructive commands are implicitly added tocommands.blockedfalseor unset, destructive commands are allowedfalsebut acommands.allowedlist is also present, the option is ignored to avoid accidentally making the allowlist overly permissive