config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config loads firstrun's optional TOML configuration. The tool runs fine with no config at all; the file only lets you persist preferences such as the default narration model or whether to use the live syscall tracer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (string, error)

Init writes a documented starter config if one does not already exist and returns the path. It never overwrites an existing file.

func Path

func Path() (string, error)

Path returns the path to the config file, honoring XDG_CONFIG_HOME.

Types

type AISection

type AISection struct {
	Provider       string `toml:"provider"`         // anthropic | openai | ollama
	Model          string `toml:"model"`            // empty = provider default
	Enabled        bool   `toml:"enabled"`          // false = never call a model
	MaxSourceBytes int    `toml:"max_source_bytes"` // caps text sent to the model
}

AISection configures the plain-English narration model.

type Config

type Config struct {
	AI      AISection      `toml:"ai"`
	Preview PreviewSection `toml:"preview"`
}

Config is the on-disk configuration.

func Default

func Default() Config

Default returns the configuration used when no file is present.

func Load

func Load() (Config, error)

Load reads the config file, returning defaults if it does not exist. Unknown keys are tolerated so a newer file does not break an older binary.

type PreviewSection

type PreviewSection struct {
	Trace          bool `toml:"trace"`           // use the live syscall tracer when available
	TimeoutSeconds int  `toml:"timeout_seconds"` // tracer/run timeout
	RequireConfirm bool `toml:"require_confirm"` // always confirm before running for real
}

PreviewSection configures how previews behave.

Jump to

Keyboard shortcuts

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