elastic / elastic/cli

Use destructive hints on JSON specs to provide confirmation DX

Open
#542 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
41
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
56

Description

Adding hints to APIs that are potentially destructive was handled in https://github.com/elastic/schemas-js/issues/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.