Skip to content

stellar keys rm should require confirmation before deleting a key #2420

@leighmcculloch

Description

@leighmcculloch

What problem does your feature solve?

It's too easy to remove a key. Destructive actions, especially with keys that can hold value, should be harder to perform. The CLI already makes it harder to overwrite a key, but it's trivial to delete one with no confirmation:

$ stellar keys rm me
ℹ️ Removing the key's cli config file

A key may hold significant value (e.g., funds on a network), and accidentally deleting it with no way to recover could result in permanent loss.

What would you like to see?

stellar keys rm should require an interactive confirmation prompt before deleting a key, similar to how other destructive CLI operations work. For example:

$ stellar keys rm me
⚠️ Are you sure you want to remove the key 'me'? This action cannot be undone. (y/N)

Defaulting to "No" would prevent accidental deletions. A --force / -f flag could skip the confirmation for scripting use cases.

What alternatives are there?

  • A "trash" or soft-delete mechanism that allows recovery within some period.
  • Requiring the user to type the key name again to confirm (e.g., stellar keys rm me --confirm me).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog (Not Ready)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions