ui

package
v5.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package ui provides user interface components for KSail CLI.

This package contains subpackages for terminal-based user interaction:

  • asciiart: ASCII art rendering with color formatting for logos and graphics
  • error-handler: Cobra command execution with error formatting and normalization
  • notify: Formatted message display with symbols, colors, and timing information
  • timer: Execution time tracking for single-stage and multi-stage operations

The ui package components work together to provide a consistent, user-friendly command-line interface experience with colorized output, timing information, and proper error handling.

Example usage:

// Display ASCII logo
asciiart.PrintKSailLogo(os.Stdout)

// Track command execution time
timer := timer.New()
timer.Start()
// ... perform operation ...
notify.WriteMessage(notify.Message{
    Type:    notify.SuccessType,
    Content: "Operation complete",
    Timer:   timer,
})

// Execute Cobra command with error handling
executor := errorhandler.NewExecutor()
err := executor.Execute(rootCmd)

Directories

Path Synopsis
Package asciiart provides ASCII art printing functionality for KSail.
Package asciiart provides ASCII art printing functionality for KSail.
Package errorhandler centralizes Cobra command execution with KSail's error formatting rules.
Package errorhandler centralizes Cobra command execution with KSail's error formatting rules.
Package notify provides utilities for sending notifications to the user.
Package notify provides utilities for sending notifications to the user.
Package timer provides timing functionality for tracking command execution duration.
Package timer provides timing functionality for tracking command execution duration.

Jump to

Keyboard shortcuts

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