cmds

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package cmds provides CLI commands for llmcli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthCmd

func NewAuthCmd() *cobra.Command

NewAuthCmd returns the auth command group.

func NewInferCmd

func NewInferCmd(root *RootFlags) *cobra.Command

NewInferCmd returns the infer command.

func NewModelsCmd

func NewModelsCmd(root *RootFlags) *cobra.Command

NewModelsCmd returns the models command.

Types

type RootFlags added in v0.23.0

type RootFlags struct {
	// LogHTTP enables HTTP request/response logging at Debug level.
	LogHTTP bool
	// LogHTTPDebug additionally logs request/response headers and bodies.
	// Has no effect unless LogHTTP is also true.
	LogHTTPDebug bool
	// LogHTTPAllHeaders disables the response header allowlist and prints all headers.
	// Has no effect unless LogHTTPDebug is also true.
	LogHTTPAllHeaders bool
	// LogEvents prints each StreamEvent as JSON to stderr as it is consumed
	// from the channel, before any other handling. Useful for debugging the
	// provider event stream at the application layer.
	LogEvents bool
}

RootFlags holds flags defined on the root command that are shared across all subcommands.

func (*RootFlags) BuildHTTPClient added in v0.23.0

func (f *RootFlags) BuildHTTPClient() (*http.Client, *httpLogHandler)

BuildHTTPClient constructs an *http.Client from the root flags. Returns nil when no HTTP logging is requested, causing providers to fall back to llm.DefaultHttpClient(). The returned handler may be non-nil even when the client is nil — callers should check the client first.

func (*RootFlags) BuildLLMOptions added in v0.23.0

func (f *RootFlags) BuildLLMOptions(handler *httpLogHandler) []llm.Option

BuildLLMOptions returns llm.Option values for the root flags to be passed to providers that don't use the HTTP transport for logging (e.g. Bedrock).

Jump to

Keyboard shortcuts

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