prompts

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package prompts provides interactive terminal prompting via huh/v2. It is an optional module — import it only when you need interactive prompts, to avoid pulling in bubbles, bubbletea, and the full TUI framework.

Usage:

import (
    "github.com/larsartmann/cmdguard/prompts"
    v3 "github.com/larsartmann/cmdguard/v3/pkg/cmdguard/v3"
)

func main() {
    prompts.Register() // wire huh-based prompting into cmdguard
    // ... build CLI as normal
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

Register wires huh-based prompting into cmdguard. Call this once at startup to enable interactive prompts for missing flags with the `prompt:"..."` tag.

Types

type HuhRunner

type HuhRunner struct{}

HuhRunner implements v3.PromptRunner using the huh/v2 TUI library.

func (*HuhRunner) PromptConfirm

func (h *HuhRunner) PromptConfirm(title string) (bool, error)

func (*HuhRunner) PromptSelect

func (h *HuhRunner) PromptSelect(title string, options []string) (string, error)

func (*HuhRunner) PromptString

func (h *HuhRunner) PromptString(title, defaultValue string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL