internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// read from clipboard
	ClipinRedirect = "{"

	// read from clipboard and wait, allowing multiple copy
	// until Ctrl-D is entered
	ClipinRedirect2 = "{{"

	// write to clipboard, overwriting its content
	ClipoutRedirect = "}"

	// append to clipboard
	ClipoutRedirect2 = "}}"
)

clipboard redirection

View Source
const DefaultEditor = "ai -i edit"
View Source
const StdinRedirect = "-"

Variables

View Source
var Version = "0.0.1" // version of the ai binary

Functions

func Exit

func Exit(ctx context.Context, err error)

Exit checks error and exit with the following code: 0 -- no error 1 -- general failure 2 -- user error

func GetConfigData

func GetConfigData() embed.FS

func InitConfig

func InitConfig(viper *fangs.Viper) error

init viper

func NewUserInputError

func NewUserInputError(text string) error

func NewUserInputErrorf

func NewUserInputErrorf(format string, a ...interface{}) error

func ParseAgentArgs

func ParseAgentArgs(app *api.AppConfig, args []string, defaultAgent string) []string

return the agent/command and the rest of the args

func ParseArgs

func ParseArgs(viper *fangs.Viper, app *api.AppConfig, args []string, defaultAgent string)

func ParseConfig

func ParseConfig(viper *fangs.Viper, app *api.AppConfig, args []string) error

func ParseLLM

func ParseLLM(viper *fangs.Viper, app *api.AppConfig) error

func ParseSpecialChars

func ParseSpecialChars(viper *fangs.Viper, app *api.AppConfig, args []string) []string

parse special char sequence for stdin/clipboard they can: + be at the end of the args or as a suffix to the last one + be in any order + be multiple instances

func Validate

func Validate(app *api.AppConfig) error

Types

type UserInputError

type UserInputError struct {
	// contains filtered or unexported fields
}

UserInputError represents user input error.

func (*UserInputError) Error

func (r *UserInputError) Error() string

Directories

Path Synopsis
choose
Package choose provides an interface to choose one option from a given list of options.
Package choose provides an interface to choose one option from a given list of options.
confirm
Package confirm provides an interface to ask a user to confirm an action.
Package confirm provides an interface to ask a user to confirm an action.
file
Package file provides an interface to pick a file from a folder (tree).
Package file provides an interface to pick a file from a folder (tree).
util/tty
Package tty provides tty-aware printing.
Package tty provides tty-aware printing.
write
Package write provides a shell script interface for the text area bubble.
Package write provides a shell script interface for the text area bubble.
data
oh

Jump to

Keyboard shortcuts

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