cmd

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Command       *cli.Command
	OutputFormats = []string{"auto", "explore", "json", "jsonl", "pretty", "raw", "yaml"}
)
View Source
var Version = resolveVersion()

Version is the CLI version string, resolved at init time.

Functions

func FormatTimeAgo

func FormatTimeAgo(t time.Time) string

FormatTimeAgo formats a time as "X ago" string

func GenerateInstanceName

func GenerateInstanceName(image string) string

GenerateInstanceName generates a name from image reference

func ResolveInstance

func ResolveInstance(ctx context.Context, client *hypeman.Client, identifier string) (string, error)

ResolveInstance resolves an instance identifier to a full instance ID. It supports: - Full instance ID (exact match) - Partial instance ID (prefix match) - Instance name (exact match) Returns an error if the identifier is ambiguous or not found.

func ShowJSON

func ShowJSON(out *os.File, title string, res gjson.Result, format string, transform string) error

func TruncateID

func TruncateID(id string) string

TruncateID truncates an ID to 12 characters (like Docker)

func TruncateString

func TruncateString(s string, max int) string

TruncateString truncates a string to max length with ellipsis

Types

type ExecExitError

type ExecExitError struct {
	Code int
}

ExecExitError is returned when exec completes with a non-zero exit code

func (*ExecExitError) Error

func (e *ExecExitError) Error() string

type TableWriter

type TableWriter struct {

	// TruncOrder specifies column indices in truncation priority order.
	// The first index in the slice is truncated first when the table is
	// too wide for the terminal. Columns not listed are never truncated.
	TruncOrder []int
	// contains filtered or unexported fields
}

TableWriter provides simple table formatting for CLI output with terminal-width-aware column sizing.

func NewTableWriter

func NewTableWriter(w io.Writer, headers ...string) *TableWriter

NewTableWriter creates a new table writer

func (*TableWriter) AddRow

func (t *TableWriter) AddRow(cells ...string)

AddRow adds a row to the table

func (*TableWriter) Render

func (t *TableWriter) Render()

Render outputs the table, dynamically fitting columns to the terminal width.

Jump to

Keyboard shortcuts

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