cmd

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the current release version, injected via ldflags at build time. Defaults to "dev" for local builds.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags.

func SetChatOutputForTest

func SetChatOutputForTest(stdout, stderr io.Writer) func()

func SetSharedForTest

func SetSharedForTest(sc *SharedConfig) func()

SetSharedForTest sets the global shared config to a test-specific value and returns a cleanup function that restores the previous state. Tests should defer the cleanup:

defer SetSharedForTest(&SharedConfig{APIKey: "test", ...})()

Types

type SharedConfig

type SharedConfig struct {
	CfgFile     string
	APIKey      string
	APIBase     string
	HTTPProxy   string
	Model       string
	JSONInput   string
	OutputDir   string
	Verbose     bool
	SavePrompt  bool
	Mode        string
	PrintConfig bool
	TimeoutFlag int
	Cfg         *types.Config // full parsed config (may be nil)
}

SharedConfig holds all shared configuration values that were previously individual global variables. Initialized in PersistentPreRunE.

Jump to

Keyboard shortcuts

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