root

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: 0BSD Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// crashCmd is the cobra command to manage crash logs
	CrashCmd = &cobra.Command{
		Use:   "crash-log",
		Short: "manage iris crash logs",
		Run: func(cmd *cobra.Command, args []string) {
			if ClearLog {
				dir, errDir := config.CrashDir()
				if errDir == nil {
					_ = os.RemoveAll(dir)
				}
				home, errHome := os.UserHomeDir()
				if errHome == nil {
					_ = os.RemoveAll(filepath.Join(home, ".iris", "crashes"))
					_ = os.Remove(filepath.Join(home, ".iris", "crash.log"))
				}
				cmd.Println("crash log cleared")
				return
			}

			logFile := getLatestCrashLog()
			if logFile == "" {
				cmd.Println("no crash log found")
				return
			}
			cmd.Println(logFile)
		},
	}
	// clearLog is the flag to clear the crash log
	ClearLog bool
)
View Source
var Version = "dev"

Version is the current build version, injected at release time via ldflags e.g. go build -ldflags="-X github.com/versenilvis/iris/root.Version=v1.2.0"

Functions

func Execute

func Execute()

func GetAIEngine added in v0.3.0

func GetAIEngine() *ai.AIEngine

func GetCurrentAISuggestion added in v0.3.0

func GetCurrentAISuggestion() *spec.Suggestion

func MergeResults

func MergeResults(query string, mode string) []spec.Suggestion

MergeResults collects and dedupes suggestions for a query and mode

func SetCurrentAISuggestion added in v0.3.0

func SetCurrentAISuggestion(sugg *spec.Suggestion)

func TermWrite

func TermWrite(data []byte)

func WriteCrashLog

func WriteCrashLog(err any)

writeCrashLog writes the crash info and stack trace to a new log file

Types

This section is empty.

Jump to

Keyboard shortcuts

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