Skip to content

Use destructive hints on JSON specs to provide confirmation DX #542

Description

@JoshMock

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions