list

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package list provides the `codexsm list` command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorizeRenderedTable

func ColorizeRenderedTable(text string, sessions []session.Session, noHeader, hasHealth bool) string

func ColumnValue

func ColumnValue(key string, s session.Session, home string, headWidth int, truncateHead bool) string

func HasHealthColumn

func HasHealthColumn(cols []Column) bool

func NewCommand

func NewCommand(resolveSessionsRoot func() (string, error)) *cobra.Command

NewCommand builds the list command.

func RenderTable

func RenderTable(sessions []session.Session, total int, opts RenderOptions) (string, error)

func TruncateDisplayText

func TruncateDisplayText(v string, maxRunes int) string

func WriteDelimited

func WriteDelimited(out io.Writer, sessions []session.Session, sep rune, noHeader bool, columns []Column) error

func WriteWithPager

func WriteWithPager(out io.Writer, text string, pager bool, pageSize int, hasHeader bool) error

Types

type Column

type Column struct {
	Key    string
	Header string
}

func ParseColumns

func ParseColumns(input string, detailed bool, format string) ([]Column, error)

type PagerAction

type PagerAction int
const (
	PagerActionContinue PagerAction = iota
	PagerActionQuit
	PagerActionAll
)

func ApplyPagerChoice

func ApplyPagerChoice(page, pages int, rawChoice string) (int, PagerAction)

type RenderOptions

type RenderOptions struct {
	NoHeader  bool
	ColorMode string
	Out       io.Writer
	Columns   []Column
	HeadWidth int
}

Jump to

Keyboard shortcuts

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