config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads the optional TOML configuration. Problems never stop the program: they become warnings (statusbar in the TUI, stderr in the CLI) and the affected values keep their defaults.

Index

Constants

View Source
const (
	MaxDebounceMS   = 2000
	MinLiveMaxBytes = 1 << 10
	MaxLiveMaxBytes = 1 << 20
)

Limits for numeric settings.

View Source
const EnvVar = "DEVTOOLTUI_CONFIG"

EnvVar overrides the config path (the --config flag wins over it).

Variables

This section is empty.

Functions

func OptionValue

func OptionValue(o tool.Option, v any) (any, string)

OptionValue checks v (decoded from TOML or JSON) against the option kind, as registry.New does for Spec defaults, and returns it with the Go type of that kind. On failure it returns a message.

func Path

func Path(flag string, getenv func(string) string, userConfigDir func() (string, error)) (path string, explicit bool, err error)

Path returns the config file to read: flag, then $DEVTOOLTUI_CONFIG, then <user config dir>/devtooltui/config.toml. explicit tells whether the user chose it, so a missing file deserves a warning.

Types

type Config

type Config struct {
	Theme         string // auto | dark | light
	DetectOnStart bool
	DebounceMS    int
	LiveMaxBytes  int // above it, the input is read-only and runs with F5 (ADR 0002)
	History       History
	Tools         map[string]tool.Values // validated defaults per tool ID
	Keys          map[string]string      // keymap overrides, validated by the TUI
}

Config is the content of config.toml.

func Default

func Default() Config

Default is the configuration without a file.

func Load

func Load(path string, explicit bool, reg *registry.Registry) (Config, []string)

Load reads path. A missing file gives the defaults (with a warning when explicit). Tool defaults are checked against the registry's Specs.

func Parse

func Parse(data []byte, name string, reg *registry.Registry) (Config, []string)

Parse decodes TOML; name prefixes the warnings.

type History

type History struct {
	Enabled         bool
	RememberOptions bool
	StoreInputs     bool // inputs may hold secrets (JWT, HMAC): off by default
}

History is the [history] table.

Jump to

Keyboard shortcuts

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