kamiazya/scopes

Implement proper interactive confirmation for CLI commands

Aperta

#135 aperta il 31 ago 2025

 (0 commenti) (0 reazioni) (0 assegnatari)Kotlin (3 fork)auto 404
good first issuehacktoberfest

Metriche repository

Star
 (2 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Background

As identified in PR #110 review, the current implementation for confirmation in CLI commands (e.g., RmCommand) is not interactive. It simply prints a message and exits, forcing the user to re-run the command with --force.

Problem

  • Poor user experience requiring command re-execution
  • Not truly interactive confirmation
  • Inconsistent with typical CLI behavior

Proposed Solution

Use Clikt's built-in confirm() function for interactive prompts. This will:

  • Ask the user for confirmation
  • Proceed based on their input
  • Provide a better user experience

Example Implementation

if (\!force) {
    confirm("Are you sure you want to remove aspect '$key'? This action cannot be undone.", abort = true)
}

Files Affected

  • interfaces/cli/src/main/kotlin/io/github/kamiazya/scopes/interfaces/cli/commands/aspect/RmCommand.kt
  • Other CLI commands that require confirmation

Priority

Low - This is a UX improvement that doesn't affect functionality

Guida contributor