prompts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package prompts provides interactive terminal prompts for CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintResult added in v0.2.0

func PrintResult(fields []ResultField, successMsg string)

PrintResult prints a styled summary with green checkmarks and gray labels.

func RunConnectionsAddForm added in v0.2.0

func RunConnectionsAddForm(
	name, connType, host, description *string,
	existingConns map[string]opendpi.Connection,
) error

RunConnectionsAddForm runs the interactive form for creating a new connection.

func RunConnectionsDescribeForm added in v0.2.0

func RunConnectionsDescribeForm(value *string, connections map[string]opendpi.Connection) error

RunConnectionsDescribeForm prompts the user to select a connection to describe.

func RunInitForm

func RunInitForm(name, version, description *string) error

RunInitForm runs the interactive form for the init command.

func RunPortsAddForm added in v0.2.0

func RunPortsAddForm(
	name, description, connection, location *string,
	existingPorts map[string]opendpi.Port,
	existingConns map[string]opendpi.Connection,
) error

RunPortsAddForm runs the interactive form for adding a port. It fills the provided pointers with user input.

func RunPortsDescribeForm added in v0.2.0

func RunPortsDescribeForm(value *string, ports map[string]opendpi.Port) error

RunPortsDescribeForm prompts the user to select a port to describe.

func RunTranslateForm added in v0.2.0

func RunTranslateForm(
	selectedPorts *[]string,
	format *string,
	outputDir *string,
	promptOutputDir bool,
	ports map[string]opendpi.Port,
	formats []string,
) error

RunTranslateForm runs the interactive form for translating ports. It only prompts for fields that are not already set:

  • selectedPorts: if empty, prompts with a multi-select of available ports
  • format: if empty, prompts with a select of available formats
  • outputDir: if promptOutputDir is true, prompts with a text input

func Theme added in v0.2.0

func Theme() *huh.Theme

Theme returns the shared huh theme used across all CLI forms.

Types

type ResultField added in v0.2.0

type ResultField struct {
	Label string
	Value string
}

ResultField is a label-value pair for PrintResult.

Jump to

Keyboard shortcuts

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