cmd

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const FileSystemKey = "fileSystem"
View Source
const GlobalConfigKey = "globalConfig"

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetFs

func GetFs(ctx context.Context) afero.Fs

func GetGlobalConfig

func GetGlobalConfig(ctx context.Context) *viper.Viper

func SetFs

func SetFs(ctx context.Context, fs afero.Fs) context.Context

func SetGlobalConfig

func SetGlobalConfig(ctx context.Context, conf *viper.Viper) context.Context

Types

type ConfigSetCmdConfig

type ConfigSetCmdConfig struct {
	File flags.Flag[string]
}

type Explainer added in v0.1.5

type Explainer interface {
	// Explain returns an explanation for a given command.
	Explain(command string) (string, error)
}

type GlobalConfig

type GlobalConfig struct {
	Provider config.Value[string]
	LogLevel config.Value[string]

	OpenAiConfig
}

type OpenAiConfig

type OpenAiConfig struct {
	// ApiKey for OpenAI API
	ApiKey config.Value[string]

	Model            config.Value[string] // Model
	Temperature      config.Value[float64]
	MaxTokens        config.Value[int]
	TopP             config.Value[float64]
	FrequencyPenalty config.Value[float64]
	PresencePenalty  config.Value[float64]
}

type Suggester

type Suggester interface {
	// Suggest returns a suggestion for a given query.
	Suggest(query string) (string, error)
}

Jump to

Keyboard shortcuts

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