Skip to content

feat: add user confirmation for keys rm command#2452

Open
mootz12 wants to merge 4 commits intomainfrom
issues/2420-confirm-key-rm
Open

feat: add user confirmation for keys rm command#2452
mootz12 wants to merge 4 commits intomainfrom
issues/2420-confirm-key-rm

Conversation

@mootz12
Copy link
Copy Markdown
Contributor

@mootz12 mootz12 commented Mar 16, 2026

What

Add a confirmation prompt when deleting keys. The confirmation prompt can be bypassed with a --force flag. Confirmation also works by piping y into stdin.

$ stellar keys rm rmtest           
⚠️  Are you sure you want to remove the key 'rmtest' at '/my-config-path/.config/stellar/identity/rmtest.toml'? This action cannot be undone. (y/N)
y
ℹ️  Removing the key's cli config file
$ stellar keys rm rmtest --force          
ℹ️  Removing the key's cli config file
$ stellar keys rm rmtest      
⚠️  Are you sure you want to remove the key 'rmtest'? This action cannot be undone. (y/N)
N
❌ error: removal cancelled by user

Why

Closes: #2420

Known limitations

None

@mootz12 mootz12 requested review from a team and Copilot March 16, 2026 17:24
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Mar 16, 2026
@fnando
Copy link
Copy Markdown
Member

fnando commented Mar 16, 2026

This is a breaking change, so I think we should hold it until the next protocol release.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a safety confirmation step to stellar keys rm to prevent accidental identity deletion, with a --force escape hatch for non-interactive use. This aligns CLI behavior with the request in #2420 for destructive-action confirmation.

Changes:

  • Add interactive confirmation handling to keys rm, plus a new --force flag to skip confirmation.
  • Add integration tests covering confirmation-required behavior and --force.
  • Update user-facing docs/help to mention --force and reflect the new behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
cookbook/stellar-keys.mdx Updates the “Remove the Identity” example command.
cmd/soroban-cli/src/commands/keys/rm.rs Implements confirmation prompt + --force flag for key removal.
cmd/crates/soroban-test/tests/it/integration/keys.rs Adds integration tests for confirmation and --force.
FULL_HELP_DOCS.md Documents the new --force option in generated help.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One ask otherwise lgtm.

@mootz12 mootz12 requested a review from fnando April 8, 2026 00:06
@mootz12 mootz12 force-pushed the issues/2420-confirm-key-rm branch from 336b07f to ed1e40b Compare April 8, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

stellar keys rm should require confirmation before deleting a key

4 participants