Documentation
¶
Index ¶
- Constants
- Variables
- func Action[R any](name string, fn func(id string, flags map[string]string) (R, error)) *entity.ActionSpec[R]
- func ActionWithContext[R any](name string, ...) *entity.ActionSpec[R]
- func ActionWithFlags[R any](name string, flags entity.ActionFlags, ...) *entity.ActionSpec[R]
- func ActionWithFlagsAndContext[R any](name string, flags entity.ActionFlags, ...) *entity.ActionSpec[R]
- func AddCommand[T any, R any](parent *cobra.Command, opts T, fn func(opts T) (R, error)) *cobra.Command
- func AddCommandWithContext[T any, R any](parent *cobra.Command, opts T, fn func(ctx context.Context, opts T) (R, error)) *cobra.Command
- func AddFormatCallback(callback FormatCallback)
- func AddNamedCommand[T any, R any](name string, parent *cobra.Command, opts T, fn func(opts T) (R, error)) *cobra.Command
- func AddNamedCommandWithContext[T any, R any](name string, parent *cobra.Command, opts T, ...) *cobra.Command
- func Admonition(severity api.Severity, title, body api.Textable) api.Admonition
- func Blockquote(content api.Textable) api.Blockquote
- func BulkAction[R any](name string, fn func(ids []string, flags map[string]string) (R, error)) *entity.BulkActionSpec[R]
- func BulkActionWithFilter[ListOpts any, R any](name string, run func(ids []string, flags map[string]string) (R, error), ...) *entity.BulkActionSpec[R]
- func BulkFilterAction[ListOpts any, R any](name string, fn func(opts ListOpts, flags map[string]string) (R, error)) *entity.BulkActionSpec[R]
- func Button(label, href string, options ...func(*api.Button)) api.Button
- func ButtonGroup(buttons ...api.Button) api.ButtonGroup
- func ButtonID(id string) func(*api.Button)
- func ButtonPayload(payload string) func(*api.Button)
- func ButtonVariant(variant string) func(*api.Button)
- func CancelAllGlobalTasks()
- func ClearFormatCallbacks()
- func ClearGlobalTasks()
- func ClickyText(text api.Textable) formatters.ClickyText
- func Collapsed(label string, content api.Textable, styles ...string) api.Collapsed
- func Comment(text string) api.Comment
- func CompactList[T any](items []T) api.Textable
- func CompleteGlobalPhase()
- func Debugf(format string, args ...any)
- func Diff(before, after, fromLabel, toLabel string) api.Diff
- func Errorf(format string, args ...any)
- func ExitWithGlobalTaskSummary()
- func Footnote(id string, content api.Textable) api.Footnote
- func FootnoteRef(id string) api.FootnoteRef
- func Footnotes(notes ...api.Footnote) api.Footnotes
- func Format(o any, opts ...FormatOptions) (string, error)
- func FormatToContentType(format string) string
- func FormatToFile(o any, opts FormatOptions, file string) error
- func FormatToFileWithContext(ctx any, o any, opts FormatOptions, file string) error
- func FormatWithContext(ctx any, o any, opts ...FormatOptions) (string, error)
- func Fprintln(w io.Writer, args ...any)
- func GetGlobalTaskManagerStats() (total, running, completed, failed int)
- func GetResultTyped[T any](t *Task) (T, error)
- func HTMLElement(tag, content string, attrs ...map[string]string) api.HtmlElement
- func Header(level int, content api.Textable) api.Heading
- func Heading(level int, content api.Textable) api.Heading
- func Infof(format string, args ...any)
- func LabelBadge(label, value string, options ...func(*api.LabelBadge)) api.LabelBadge
- func LabelBadgeColor(color string) func(*api.LabelBadge)
- func LabelBadgeIcon(icon string) func(*api.LabelBadge)
- func LabelBadgeShape(shape string) func(*api.LabelBadge)
- func LabelBadgeTextColor(color string) func(*api.LabelBadge)
- func LiftFilters[Outer any, Inner any](filters []entity.Filter[Inner], project func(*Outer) *Inner) []entity.Filter[Outer]
- func Link(href string) api.Link
- func LinkCommand(command string) api.LinkCommand
- func List(items ...api.Textable) api.List
- func ListCustomFormatters() []string
- func Map[T any](m map[string]T, styles ...string) api.DescriptionList
- func MustFormat(o any, opts ...FormatOptions) string
- func MustFormatWithContext(ctx any, o any, opts ...FormatOptions) string
- func MustParseArgumentsAsMap(args []string) map[string]any
- func MustParseMarkdown(source string, opts ...md.Option) *md.Document
- func MustPrint(o any, opts ...FormatOptions)
- func MustPrintWithContext(ctx any, o any, opts ...FormatOptions)
- func NewEntity[T entity.EntityItem, ListOpts any, R any](name string) *entity.EntityBuilder[T, ListOpts, R]
- func NewPagedResult[T any](rows []T, limit, offset int, total int64) entity.PagedResult[T]
- func ParseArgumentsAsMap(args []string) (map[string]any, error)
- func ParseArgumentsComplete(args []string) (map[string]any, map[string]string, map[string]string, error)
- func ParseArgumentsWithHeaders(args []string) (map[string]any, map[string]string, error)
- func ParseArgumentsWithQuery(args []string) (data map[string]any, query map[string]string, err error)
- func ParseJSON(data []byte) (interface{}, error)
- func ParseMarkdown(source string, opts ...md.Option) (*md.Document, error)
- func PrintAndWriteSinks(o any, opts FormatOptions)
- func Printf(format string, args ...any)
- func Println(args ...any)
- func Prompt[T any](items []T, opts PromptSelectOptions[T]) (T, bool)
- func PromptChoose[T any](items []T) (T, bool)
- func PromptMultiSelect[T any](items []T, opts PromptMultiSelectOptions[T]) ([]T, bool)
- func PromptMultiSelectCtx[T any](ctx context.Context, items []T, opts PromptMultiSelectOptions[T]) ([]T, bool)
- func PromptSelect[T any](items []T, opts PromptSelectOptions[T]) (T, bool)
- func PromptSelectCtx[T any](ctx context.Context, items []T, opts PromptSelectOptions[T]) (T, bool)
- func PromptText(opts PromptTextOptions) (string, bool)
- func PromptTextCtx(ctx context.Context, opts PromptTextOptions) (string, bool)
- func RedactSecretValues(val ...string)
- func RegisterEntity[T entity.EntityItem, ListOpts any, R any](e entity.Entity[T, ListOpts, R])
- func RegisterFormatter(name string, fn func(data interface{}, options FormatOptions) (string, error))
- func RegisterGlobalExit()
- func SQL(format string, args ...any)
- func SetGlobalInterruptHandler(fn func())
- func SetGlobalMaxConcurrency(max int)
- func SetGlobalSignalTimeout(timeout time.Duration)
- func SetGlobalVerbose(verbose bool)
- func SetGroupedUsage(cmd *cobra.Command)
- func StackTrace(input string, opts ...api.StackTraceOption) api.StackTrace
- func StartCapturingOutput()
- func StartGroup[T any](name string, opts ...task.TaskGroupOption) task.TypedGroup[T]
- func StartTask[T any](name string, taskFunc task.TaskFunc[T], opts ...TaskOption) task.TypedTask[T]
- func StartWithResultTyped[T any](tm *TaskManager, name string, taskFunc task.TaskFunc[T], opts ...TaskOption) *task.Task
- func StopCapturingOutput()
- func StopTask(id string) bool
- func Table(headers ...string) api.TextTable
- func Text(content string, tailwindClasses ...string) api.Text
- func TextList(items ...api.Textable) api.TextList
- func Textf(content string, args ...any) api.Text
- func Tracef(format string, args ...any)
- func Tree(node api.Textable, children ...api.TextTree) api.TextTree
- func UpdateGlobalPhaseProgress(message string)
- func UseFormatter(opts FormatOptions)
- func WaitForGlobalCompletion() int
- func WaitForGlobalCompletionSilent() int
- func Warnf(format string, args ...any)
- func WithHttpRequest(r *http.Request) formatters.FormatOptions
- func WithKey(key string, value api.Textable) api.Keyed
- type ActionFlags
- type ActionInfo
- type ActionSpec
- type AfterFormatFunc
- type AllFlags
- type Args
- type BeforeFormatFunc
- type BulkActionInfo
- type BulkActionSpec
- type CommandOpenAPIMeta
- type Context
- type ContextDataFunc
- type ContextFilter
- type ContextLookupFunc
- type ContextSearchableFilter
- type DynamicEntitySpec
- type DynamicFilter
- type Entity
- type EntityAction
- type EntityBuilder
- type EntityBulkAction
- type EntityInfo
- type EntityItem
- type EntityOperation
- type FileSystemOption
- type FileTreeNode
- type FileTreeOptions
- type Filter
- type Filterable
- type FormatCallback
- type FormatManager
- type FormatOptions
- type Help
- type JSONParser
- type MultiFilter
- type Name
- type PageInfo
- type Paged
- type PagedResult
- type PrettyParser
- type PromptMultiSelectOptions
- type PromptSelectOptions
- type PromptTextOptions
- type ResponseOpenAPIMeta
- type RetryConfig
- type SearchableFilter
- type SourceResolver
- type SourceResolverFunc
- type Task
- type TaskFunc
- type TaskGroup
- type TaskManager
- type TaskManagerOptions
- type TaskOption
- type TaskResult
- type TaskStatus
- type TypedFilter
- type TypedTask
- type WaitResult
- type Waitable
Constants ¶
const ( StatusPending = task.StatusPending StatusRunning = task.StatusRunning StatusSuccess = task.StatusSuccess StatusFailed = task.StatusFailed StatusWarning = task.StatusWarning StatusCancelled = task.StatusCancelled )
Status constants
const ( CategoryLogging = "Logging" CategoryTasks = "Tasks" CategoryFormat = "Format" )
Flag category labels rendered as section headers in --help output.
const FlagCategoryAnnotation = "clicky_category"
FlagCategoryAnnotation is the pflag annotation key used to tag flags with a display category, so the usage template can render them in grouped sections.
Variables ¶
var ( DefaultRetryConfig = task.DefaultRetryConfig DefaultTaskManagerOptions = task.DefaultManagerOptions WithTimeout = task.WithTimeout WithTaskTimeout = task.WithTaskTimeout WithDependencies = task.WithDependencies WithFunc = task.WithFunc WithModel = task.WithModel WithPrompt = task.WithPrompt WithRetryConfig = task.WithRetryConfig WithPriority = task.WithPriority BindTaskManagerFlags = task.BindManagerFlags BindTaskManagerPFlags = task.BindManagerPFlags )
Function aliases for backward compatibility
var ( GetEntities = entity.GetEntities GetEntity = entity.GetEntity GenerateCLI = entity.GenerateCLI RegisterDynamicEntity = entity.RegisterDynamicEntity RegisterSubCommand = entity.RegisterSubCommand RegisterSubCommandFn = entity.RegisterSubCommandFn GetDataFunc = entity.GetDataFunc GetContextDataFunc = entity.GetContextDataFunc GetLookupFunc = entity.GetLookupFunc GetContextLookupFunc = entity.GetContextLookupFunc GetCommandOpenAPIMeta = entity.GetCommandOpenAPIMeta GetCommandResponseMeta = entity.GetCommandResponseMeta SetCommandResponseMeta = entity.SetCommandResponseMeta )
--- non-generic function/var aliases ---
var ( WithSourceResolver = api.WithSourceResolver WithSourceResolverContext = api.WithSourceResolverContext WithStackInclude = api.WithStackInclude WithStackExclude = api.WithStackExclude WithStackContext = api.WithStackContext WithMaxStackFrames = api.WithMaxFrames )
var Badge = api.Badge
var Class = api.Clz
var CodeBlock = api.CodeBlock
var Column = api.Column
var Exec = exec.NewExec
var Execf = exec.NewExecf
var (
Formatter = formatters.NewFormatManager()
)
var Human = api.Human
var KeyValue = api.KeyValue
var LinkTargetClicky = api.LinkTargetClicky
var LinkTargetDialog = api.LinkTargetDialog
var LinkTargetExpand = api.LinkTargetExpand
var LinkTargetHover = api.LinkTargetHover
var LinkTargetSelf = api.LinkTargetSelf
var LinkTargetTab = api.LinkTargetTab
var LinkTargetWindow = api.LinkTargetWindow
var StackTraceJava = api.ParseJavaStackTrace
StackTraceJava is the explicit Java parser. Equivalent to StackTrace today; kept distinct so future non-Java parsers (Python, .NET) can plug in without breaking callers that have explicitly opted into Java semantics.
Functions ¶
func ActionWithContext ¶
func ActionWithFlags ¶
func ActionWithFlags[R any](name string, flags entity.ActionFlags, fn func(id string, flags map[string]string) (R, error)) *entity.ActionSpec[R]
func AddCommand ¶
func AddCommandWithContext ¶
func AddFormatCallback ¶
func AddFormatCallback(callback FormatCallback)
AddFormatCallback registers a global formatting callback. The callback is applied to top-level clicky formatting as well as HTTP/RPC response formatting paths.
func AddNamedCommand ¶
func Admonition ¶
func Blockquote ¶ added in v1.21.29
func Blockquote(content api.Textable) api.Blockquote
func BulkAction ¶
func BulkActionWithFilter ¶
func BulkFilterAction ¶
func ButtonGroup ¶
func ButtonGroup(buttons ...api.Button) api.ButtonGroup
func ButtonPayload ¶
func ButtonVariant ¶
func CancelAllGlobalTasks ¶
func CancelAllGlobalTasks()
CancelAllGlobalTasks cancels all running global tasks
func ClearFormatCallbacks ¶
func ClearFormatCallbacks()
ClearFormatCallbacks removes all registered format callbacks. This is primarily useful in tests.
func ClearGlobalTasks ¶
func ClearGlobalTasks()
ClearGlobalTasks removes completed tasks from the global TaskManager
func ClickyText ¶
func ClickyText(text api.Textable) formatters.ClickyText
func CompactList ¶
func CompleteGlobalPhase ¶
func CompleteGlobalPhase()
CompleteGlobalPhase marks the current phase as completed
func ExitWithGlobalTaskSummary ¶
func ExitWithGlobalTaskSummary()
ExitWithGlobalTaskSummary displays task summary and exits with appropriate code
func FootnoteRef ¶ added in v1.21.29
func FootnoteRef(id string) api.FootnoteRef
func FormatToContentType ¶
FormatToContentType converts a format string to HTTP Content-Type
func FormatToFile ¶
func FormatToFile(o any, opts FormatOptions, file string) error
func FormatToFileWithContext ¶
func FormatToFileWithContext(ctx any, o any, opts FormatOptions, file string) error
FormatToFileWithContext formats using the shared clicky formatter, writes the output to file, and forwards ctx to registered format callbacks.
func FormatWithContext ¶
func FormatWithContext(ctx any, o any, opts ...FormatOptions) (string, error)
FormatWithContext formats using the shared clicky formatter while forwarding ctx to registered format callbacks.
func Fprintln ¶
Fprintln writes args separated by spaces and terminated by a newline to the supplied writer. Use this when you need to target a specific writer (e.g. a tab writer, a string builder, a capture buffer) — for the common case of "print a line to the terminal", prefer Println.
func GetGlobalTaskManagerStats ¶
func GetGlobalTaskManagerStats() (total, running, completed, failed int)
GetGlobalTaskManagerStats returns stats about the global TaskManager
func GetResultTyped ¶
GetResultTyped returns the stored result with type assertion
func HTMLElement ¶
func HTMLElement(tag, content string, attrs ...map[string]string) api.HtmlElement
func LabelBadge ¶
func LabelBadge(label, value string, options ...func(*api.LabelBadge)) api.LabelBadge
func LabelBadgeColor ¶
func LabelBadgeColor(color string) func(*api.LabelBadge)
func LabelBadgeIcon ¶
func LabelBadgeIcon(icon string) func(*api.LabelBadge)
func LabelBadgeShape ¶
func LabelBadgeShape(shape string) func(*api.LabelBadge)
func LabelBadgeTextColor ¶
func LabelBadgeTextColor(color string) func(*api.LabelBadge)
func LiftFilters ¶
func LinkCommand ¶
func LinkCommand(command string) api.LinkCommand
func ListCustomFormatters ¶
func ListCustomFormatters() []string
ListCustomFormatters returns a sorted list of all registered custom formatter names.
func MustFormat ¶
func MustFormat(o any, opts ...FormatOptions) string
func MustFormatWithContext ¶
func MustFormatWithContext(ctx any, o any, opts ...FormatOptions) string
MustFormatWithContext formats using the shared clicky formatter and panics on error.
func MustParseArgumentsAsMap ¶
MustParseArgumentsAsMap is like ParseArgumentsAsMap but panics on error
func MustParseMarkdown ¶ added in v1.21.29
MustParseMarkdown parses markdown source and panics on failure.
func MustPrint ¶
func MustPrint(o any, opts ...FormatOptions)
func MustPrintWithContext ¶
func MustPrintWithContext(ctx any, o any, opts ...FormatOptions)
MustPrintWithContext formats using the shared clicky formatter, writes the output to stdout, and forwards ctx to registered format callbacks.
func NewEntity ¶
func NewEntity[T entity.EntityItem, ListOpts any, R any](name string) *entity.EntityBuilder[T, ListOpts, R]
func NewPagedResult ¶
func NewPagedResult[T any](rows []T, limit, offset int, total int64) entity.PagedResult[T]
func ParseArgumentsAsMap ¶
ParseArgumentsAsMap parses HTTPie-style command line arguments into a map Supports:
key=value - String values key:=value - JSON values (numbers, booleans, arrays, objects) key==value - Query parameters (returned in separate map) key@file - Read value from file key:=@file - Read JSON from file Header:value - HTTP headers (ignored in this function) key[sub]=val - Nested JSON structures
func ParseArgumentsComplete ¶
func ParseArgumentsComplete(args []string) (map[string]any, map[string]string, map[string]string, error)
ParseArgumentsComplete parses all argument types and returns separated results
func ParseArgumentsWithHeaders ¶
ParseArgumentsWithHeaders parses arguments and separates headers
func ParseArgumentsWithQuery ¶
func ParseArgumentsWithQuery(args []string) (data map[string]any, query map[string]string, err error)
ParseArgumentsWithQuery parses arguments and separates query parameters (backward compatibility)
func ParseMarkdown ¶ added in v1.21.29
ParseMarkdown parses markdown source into a structured Clicky document.
func PrintAndWriteSinks ¶
func PrintAndWriteSinks(o any, opts FormatOptions)
PrintAndWriteSinks renders o for each sink in opts.Sinks.
Stdout sinks (File == "") go through MustPrint, preserving existing pretty/stdout behaviour. File sinks call Formatter.FormatToFile, which renders in the sink's format and writes to the given path.
Per-sink errors are logged via Errorf but do NOT abort other sinks, so a broken HTML template cannot eat the JSON artifact that CI depends on. If opts.Sinks is empty the function falls back to MustPrint(o, opts) for back-compat with call sites that haven't run ParseFormatSpec.
func Printf ¶
Printf formats and writes to the currently-active logger output. See Println for the serialization guarantees.
func Println ¶
func Println(args ...any)
Println writes args separated by spaces and terminated by a newline to the currently-active logger output. While a task renderer is active that destination is the renderer's serializer, so the line is interleaved cleanly with progress frames. Off-renderer it falls through to os.Stderr.
Prefer this (or Printf / Fprintln) over bare fmt.Println / fmt.Fprintln on os.Stdout or os.Stderr in library code: direct writes bypass the renderer's tracking and leave stale frame lines stacked in the output. The clickylint rule `direct-stdout-stderr` flags the bypasses.
func Prompt ¶
func Prompt[T any](items []T, opts PromptSelectOptions[T]) (T, bool)
Prompt is the shared ANSI list prompt runner used by PromptChoose and PromptSelect.
func PromptChoose ¶
PromptChoose renders a minimal arrow-key choice prompt.
func PromptMultiSelect ¶
func PromptMultiSelect[T any](items []T, opts PromptMultiSelectOptions[T]) ([]T, bool)
PromptMultiSelect renders a configurable ANSI multi-select prompt.
func PromptMultiSelectCtx ¶ added in v1.21.33
func PromptMultiSelectCtx[T any](ctx context.Context, items []T, opts PromptMultiSelectOptions[T]) ([]T, bool)
PromptMultiSelectCtx is PromptMultiSelect with a context (see PromptSelectCtx).
func PromptSelect ¶
func PromptSelect[T any](items []T, opts PromptSelectOptions[T]) (T, bool)
PromptSelect renders a configurable arrow-key choice prompt.
func PromptSelectCtx ¶ added in v1.21.33
func PromptSelectCtx[T any](ctx context.Context, items []T, opts PromptSelectOptions[T]) (T, bool)
PromptSelectCtx is PromptSelect with a context: when no TTY is attached and an interactive prompt sink is installed (prompt.SetDefault), the choice is routed to the sink — inheriting any prompt.Scope on ctx — instead of failing. CLIs keep the terminal prompt; servers (the dashboard) get a JSON-schema form.
func PromptText ¶
func PromptText(opts PromptTextOptions) (string, bool)
PromptText renders an ANSI text entry prompt.
func PromptTextCtx ¶ added in v1.21.33
func PromptTextCtx(ctx context.Context, opts PromptTextOptions) (string, bool)
PromptTextCtx is PromptText with a context (see PromptSelectCtx).
func RedactSecretValues ¶
func RedactSecretValues(val ...string)
func RegisterEntity ¶
func RegisterFormatter ¶
func RegisterFormatter(name string, fn func(data interface{}, options FormatOptions) (string, error))
RegisterFormatter registers a custom formatter function that can be used with Format() by specifying the format name in FormatOptions. Custom formatters take precedence over built-in formatters with the same name.
Example:
clicky.RegisterFormatter("upper", func(data interface{}, opts clicky.FormatOptions) (string, error) {
s := fmt.Sprintf("%v", data)
return strings.ToUpper(s), nil
})
result, _ := clicky.Format(myData, clicky.FormatOptions{Format: "upper"})
func RegisterGlobalExit ¶
func RegisterGlobalExit()
RegisterGlobalExit ensures tasks are displayed when the program exits
func SetGlobalInterruptHandler ¶
func SetGlobalInterruptHandler(fn func())
SetGlobalInterruptHandler sets the interrupt handler for the global TaskManager
func SetGlobalMaxConcurrency ¶
func SetGlobalMaxConcurrency(max int)
SetGlobalMaxConcurrency sets the maximum concurrency for the global TaskManager
func SetGlobalSignalTimeout ¶
SetGlobalSignalTimeout configures the graceful shutdown timeout
func SetGlobalVerbose ¶
func SetGlobalVerbose(verbose bool)
SetGlobalVerbose enables/disables verbose output for the global TaskManager
func SetGroupedUsage ¶
SetGroupedUsage installs a usage function on cmd that renders flags in sections grouped by their FlagCategoryAnnotation. Flags without a category fall under a generic "Flags" heading. The function is also propagated as the usage template inheritance chain expects, so subcommands display the same grouping for inherited flags.
func StackTrace ¶
func StackTrace(input string, opts ...api.StackTraceOption) api.StackTrace
StackTrace parses a free-form runtime stack-trace string and returns a styled, render-ready trace. The default parser is language-agnostic and auto-detects Java traces; pass clicky.StackTraceJava (or another language-specific parser) when the language is known up front.
Pass options like clicky.WithSourceResolver(r), clicky.WithStackContext(5), or clicky.WithStackInclude("com.example.admin.") to attach inline source context and filter frames.
func StartCapturingOutput ¶
func StartCapturingOutput()
StartCapturingOutput replaces os.Stdout / os.Stderr with internal pipes so that bare fmt.Print / os.Stderr writes are buffered instead of interleaving with the live task renderer. The live renderer keeps drawing on the real terminal because it captured the original file descriptors at manager init. Loggers that captured os.Stderr before this call keep writing live, too.
Pair with StopCapturingOutput at end-of-run; the buffered content is flushed in stream order onto the restored streams.
func StartGroup ¶
func StartGroup[T any](name string, opts ...task.TaskGroupOption) task.TypedGroup[T]
func StartWithResultTyped ¶
func StartWithResultTyped[T any](tm *TaskManager, name string, taskFunc task.TaskFunc[T], opts ...TaskOption) *task.Task
StartWithResultTyped creates and starts tracking a new task with generic typed result handling
func StopCapturingOutput ¶
func StopCapturingOutput()
StopCapturingOutput restores os.Stdout / os.Stderr and flushes every buffered line to the real terminal in write order, tagged by stream. Safe to call when capture wasn't started.
func UpdateGlobalPhaseProgress ¶
func UpdateGlobalPhaseProgress(message string)
UpdateGlobalPhaseProgress updates the progress of the current phase
func UseFormatter ¶
func UseFormatter(opts FormatOptions)
func WaitForGlobalCompletion ¶
func WaitForGlobalCompletion() int
WaitForGlobalCompletion waits for all global tasks to complete and returns exit code
func WaitForGlobalCompletionSilent ¶
func WaitForGlobalCompletionSilent() int
WaitForGlobalCompletionSilent waits for global tasks without displaying results
func WithHttpRequest ¶
func WithHttpRequest(r *http.Request) formatters.FormatOptions
WithHttpRequest extracts format options from an HTTP request Priority: query param > path extension > Accept header > default
Types ¶
type ActionSpec ¶ added in v1.21.29
type ActionSpec[R any] = entity.ActionSpec[R]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type AfterFormatFunc ¶
type AfterFormatFunc = formatters.AfterFormatFunc
type AllFlags ¶
type AllFlags struct {
TaskManagerOptions
FormatOptions
logger.Flags
}
var Flags *AllFlags = &AllFlags{ FormatOptions: FormatOptions{}, TaskManagerOptions: *DefaultTaskManagerOptions(), Flags: logger.Flags{ Level: "info", LevelCount: 0, JsonLogs: false, ReportCaller: false, LogToStderr: true, }, }
func BindAllFlags ¶
BindAllFlags adds clicky's logging, task and format flags to the given pflag set. Each flag is annotated with a category so SetGroupedUsage can render them in titled sections.
func BindAllFlagsToCommand ¶
BindAllFlagsToCommand binds clicky's flags to cmd's persistent flag set and installs a grouped usage template so --help renders flags in titled sections (Logging, Tasks, Format, then any uncategorized flags under "Flags").
type Args ¶
Args is a custom map type for parsed arguments with helper methods
func MustParseArguments ¶
MustParseArguments is like ParseArguments but panics on error
func ParseArguments ¶
ParseArguments parses HTTPie-style arguments and returns an Args type
func (Args) GetString ¶
GetString returns the string value for a key, or empty string if not found or wrong type
func (Args) GetStringSlice ¶
GetStringSlice returns the string slice value for a key, or empty slice if not found
func (Args) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*Args) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type BeforeFormatFunc ¶
type BeforeFormatFunc = formatters.BeforeFormatFunc
type BulkActionSpec ¶ added in v1.21.29
type BulkActionSpec[R any] = entity.BulkActionSpec[R]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type CommandOpenAPIMeta ¶
type CommandOpenAPIMeta = entity.CommandOpenAPIMeta
--- non-generic type aliases ---
type Context ¶
type Context = flanksourceContext.Context
type ContextDataFunc ¶
type ContextDataFunc = entity.ContextDataFunc
--- non-generic type aliases ---
type ContextFilter ¶
type ContextFilter[ListOpts any] = entity.ContextFilter[ListOpts]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type ContextLookupFunc ¶
type ContextLookupFunc = entity.ContextLookupFunc
--- non-generic type aliases ---
type ContextSearchableFilter ¶
type ContextSearchableFilter[ListOpts any] = entity.ContextSearchableFilter[ListOpts]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type DynamicEntitySpec ¶ added in v1.21.29
type DynamicEntitySpec = entity.DynamicEntitySpec
--- non-generic type aliases ---
type DynamicFilter ¶ added in v1.21.29
type DynamicFilter = entity.DynamicFilter
--- non-generic type aliases ---
type EntityBuilder ¶
type EntityBuilder[T entity.EntityItem, ListOpts any, R any] = entity.EntityBuilder[T, ListOpts, R]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type EntityBulkAction ¶
type EntityBulkAction = entity.EntityBulkAction
--- non-generic type aliases ---
type EntityOperation ¶
type EntityOperation = entity.EntityOperation
--- non-generic type aliases ---
type FileSystemOption ¶
type FileSystemOption func(*FileTreeOptions)
FileSystemOption configures NewFileSystem behavior
func WithHiddenFiles ¶
func WithHiddenFiles(show bool) FileSystemOption
WithHiddenFiles controls whether to show hidden files (starting with .)
func WithMaxDepth ¶
func WithMaxDepth(depth int) FileSystemOption
WithMaxDepth sets the maximum directory depth to traverse
type FileTreeNode ¶
type FileTreeNode struct {
Name string `json:"name" pretty:"label"`
Path string `json:"path"`
Size int64 `json:"size"`
Modified time.Time `json:"modified"`
IsDir bool `json:"is_dir"`
Children []*FileTreeNode `json:"children,omitempty" pretty:"format=tree"`
// contains filtered or unexported fields
}
FileTreeNode represents a file or directory with metadata
func NewFileSystem ¶
func NewFileSystem(path string, opts ...FileSystemOption) *FileTreeNode
NewFileSystem creates a FileTreeNode from a directory path
func (FileTreeNode) GetChildren ¶
func (f FileTreeNode) GetChildren() []api.TreeNode
GetChildren implements TreeNode interface
func (FileTreeNode) Pretty ¶
func (f FileTreeNode) Pretty() api.Text
Pretty returns a formatted Text with file info
type FileTreeOptions ¶
type FileTreeOptions struct {
MaxDepth int `flag:"depth" json:"depth,omitempty"`
ShowHidden bool `flag:"hidden" json:"hidden,omitempty"`
ShowSize bool `flag:"size" json:"size,omitempty"`
ShowModified bool `flag:"modified" json:"modified,omitempty"`
ShowAge bool `flag:"age" json:"age,omitempty"`
}
func (FileTreeOptions) Pretty ¶
func (f FileTreeOptions) Pretty() api.Text
type Filterable ¶
type Filterable[T any] = entity.Filterable[T]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type FormatCallback ¶
type FormatCallback = formatters.FormatCallback
type FormatManager ¶
type FormatManager = formatters.FormatManager
type FormatOptions ¶
type FormatOptions = formatters.FormatOptions
type JSONParser ¶
type JSONParser struct{}
JSONParser handles lenient JSON parsing
func (*JSONParser) Parse ¶
func (p *JSONParser) Parse(data []byte) (interface{}, error)
Parse is an alias for ParseJSON for consistency with other parsers
type PagedResult ¶
type PagedResult[T any] = entity.PagedResult[T]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type PrettyParser ¶
type PrettyParser struct {
*formatters.PrettyFormatter
}
PrettyParser is a wrapper around formatters.PrettyFormatter for backwards compatibility
func NewPrettyParser ¶
func NewPrettyParser() *PrettyParser
NewPrettyParser creates a new parser with adaptive theme
func NewPrettyParserWithTheme ¶
func NewPrettyParserWithTheme(theme api.Theme) *PrettyParser
NewPrettyParserWithTheme creates a new parser with a specific theme
type PromptMultiSelectOptions ¶
type PromptMultiSelectOptions[T any] struct { Title string PageSize int Limit int Ordered bool Render func(T) api.Textable }
PromptMultiSelectOptions configures an ANSI multi-select prompt.
type PromptSelectOptions ¶
type PromptSelectOptions[T any] struct { Title string InitialIndex int PageSize int Render func(T) api.Textable }
PromptSelectOptions configures an ANSI list prompt.
type PromptTextOptions ¶
type PromptTextOptions struct {
Title string
Default string
Placeholder string
Secret bool
Validate func(string) error
}
PromptTextOptions configures an ANSI text prompt.
type ResponseOpenAPIMeta ¶
type ResponseOpenAPIMeta = entity.ResponseOpenAPIMeta
--- non-generic type aliases ---
type SearchableFilter ¶
type SearchableFilter[ListOpts any] = entity.SearchableFilter[ListOpts]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
type SourceResolver ¶
type SourceResolver = api.SourceResolver
SourceResolver is the extension point a StackTrace consults to populate each frame with surrounding source lines. See api.SourceResolver for the interface contract.
type SourceResolverFunc ¶
type SourceResolverFunc = api.SourceResolverFunc
SourceResolverFunc adapts a plain function to SourceResolver.
type Task ¶
Type aliases for backward compatibility
func StartGlobalPhase ¶
StartGlobalPhase starts a new phase tracking task
type TaskManagerOptions ¶
type TaskManagerOptions = task.ManagerOptions
Type aliases for backward compatibility
type TypedFilter ¶
type TypedFilter[ListOpts any] = entity.TypedFilter[ListOpts]
--- generic type aliases (Go 1.24+; go.mod is 1.26.1) ---
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
aichat
module
|
|
|
Package api provides fluent builders for creating styled Text objects.
|
Package api provides fluent builders for creating styled Text objects. |
|
Package cache defines clicky's cache contracts and a dependency-free in-process backend for them:
|
Package cache defines clicky's cache contracts and a dependency-free in-process backend for them: |
|
cmd
|
|
|
clicky
command
|
|
|
clickylint
command
|
|
|
Package docs provides a reusable cobra command group that generates a markdown CLI reference and a clicky-ui surface catalog from a CLI's command tree, as one markdown file per high-level command controller.
|
Package docs provides a reusable cobra command group that generates a markdown CLI reference and a clicky-ui surface catalog from a CLI's command tree, as one markdown file per high-level command controller. |
|
Package entity is the canonical home for clicky's entity + operation model: the entity registry and CLI generation (Entity, EntityBuilder, RegisterEntity, GenerateCLI), the command-function registries (AddCommand, the cobra annotation metadata), the RPC operation model (RPCOperation, Schema, …), and named, reusable filter/lookup definitions that work across both static (Go-struct) and dynamic (JSON-Schema) entities.
|
Package entity is the canonical home for clicky's entity + operation model: the entity registry and CLI generation (Entity, EntityBuilder, RegisterEntity, GenerateCLI), the command-function registries (AddCommand, the cobra annotation metadata), the RPC operation model (RPCOperation, Schema, …), and named, reusable filter/lookup definitions that work across both static (Go-struct) and dynamic (JSON-Schema) entities. |
|
Package formatters provides a comprehensive data formatting system with support for multiple output formats, Tailwind CSS styling, and fluent text composition.
|
Package formatters provides a comprehensive data formatting system with support for multiple output formats, Tailwind CSS styling, and fluent text composition. |
|
internal
|
|
|
gumchoose
Package gumchoose vendors the choose implementation from charmbracelet/gum.
|
Package gumchoose vendors the choose implementation from charmbracelet/gum. |
|
Package metrics provides a generic timeseries store for recording and querying (timestamp, value) points behind a thin Timeseries interface.
|
Package metrics provides a generic timeseries store for recording and querying (timestamp, value) points behind a thin Timeseries interface. |
|
Package middleware provides a comprehensive, configurable middleware system for Echo v4.
|
Package middleware provides a comprehensive, configurable middleware system for Echo v4. |
|
Package prompt is a generic, reusable question/prompt manager that mirrors the task manager: a Go API whose pending-prompt state streams to ready-made UI components.
|
Package prompt is a generic, reusable question/prompt manager that mirrors the task manager: a Go API whose pending-prompt state streams to ready-made UI components. |
|
Package task provides a comprehensive concurrent task execution system with progress tracking, status management, and visual rendering capabilities.
|
Package task provides a comprehensive concurrent task execution system with progress tracking, status management, and visual rendering capabilities. |
|
valkey
module
|