noora-single-choice-prompt

Installation
SKILL.md

Noora Single Choice Prompt

Use this skill when a Swift CLI needs one selection from a known list.

Enum-Backed Pattern

import Noora

enum OutputMode: String, CaseIterable, CustomStringConvertible {
    case plain
    case rich
    case json

    var description: String {
        switch self {
        case .plain: return "Plain text"
        case .rich: return "Rich terminal UI"
        case .json: return "JSON output"
        }
    }
}

let selection: OutputMode = Noora().singleChoicePrompt(
    title: "Output mode",
    question: "Which output style should the CLI prefer?",
    description: "Choose the default rendering mode for command output.",
    filterMode: .toggleable
)

Filter Modes

  • .disabled: short lists.
  • .toggleable: medium lists where filtering is sometimes useful.
  • .enabled: long lists where searching should start immediately.

Guidance

  • Use CaseIterable enums whenever the choices are stable and meaningful in code.
  • Make description values user-facing, not raw case names.
  • Leave autoselectSingleChoice enabled when a filtered or dynamic list can shrink to one valid option.

Avoid

  • Using raw strings throughout the codebase when an enum would model the choice better.
  • Dumping verbose paragraphs into each option description.
Related skills
Installs
1
First Seen
Mar 31, 2026