goharbor / goharbor/harbor-cli

[feature]: Add a confirmation prompt before executing project deletion to prevent accidental destructive operations.

Open
#771 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
163
Forks
211
Avg merge
1m
Merged PRs (30d)
1

Description

## Problem
Currently, deleting projects using the Harbor CLI does not require confirmation.
This can lead to accidental deletion of projects, which is irreversible and may result in unintended data loss.

## Proposed Solution
Add a confirmation prompt before executing project deletion.

- Prompt user before deletion
- Display project name(s) or project ID in the prompt
- Abort operation if user declines
- Skip confirmation when `--force` flag is used

## Example Workflow
Image

## Alternatives Considered
Users can manually double-check commands before execution, but this is error-prone and not reliable for destructive operations.

## Additional Context
Many CLI tools (e.g., kubectl, docker) include confirmation or safeguards for destructive actions.
This feature improves user safety and aligns Harbor CLI with common CLI UX practices.

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.