Skip to content

Commit b82d72e

Browse files
euxaristiaclaude
andcommitted
fix(cli): add confirmation prompt to spacetime delete
`spacetime delete` previously deleted databases immediately with no confirmation. Add a y/N prompt before sending the delete request, skippable with `--yes`/`-y` for scripting. Closes #4679 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 18f6da6 commit b82d72e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

crates/cli/src/subcommands/delete.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ pub async fn exec(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::E
5050
let auth_header = get_auth_header(&mut config, false, server, !force).await?;
5151
let client = reqwest::Client::new();
5252

53+
if !y_or_n(
54+
force,
55+
&format!(
56+
"Are you sure you want to delete database '{}'? This action cannot be undone.",
57+
resolved.database
58+
),
59+
)? {
60+
println!("Aborting");
61+
return Ok(());
62+
}
63+
5364
let response = send_request(&client, &request_path, &auth_header, None).await?;
5465
match response.status() {
5566
StatusCode::PRECONDITION_REQUIRED => {

0 commit comments

Comments
 (0)