kamiazya/scopes

Implement proper interactive confirmation for CLI commands

开放

#135 创建于 2025年8月31日

 (0 条评论) (0 个反应) (0 位负责人)Kotlin (3 个派生)auto 404
good first issuehacktoberfest

仓库指标

星标
 (2 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南