settings

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package settings provides configuration loading for Entire. This package is separate from cli to allow strategy package to import it without creating an import cycle (cli imports strategy).

Index

Constants

View Source
const (
	// EntireSettingsFile is the path to the Entire settings file
	EntireSettingsFile = ".entire/settings.json"
	// EntireSettingsLocalFile is the path to the local settings override file (not committed)
	EntireSettingsLocalFile = ".entire/settings.local.json"
)
View Source
const DefaultStrategyName = "manual-commit"

DefaultStrategyName is the default strategy when none is configured. This is duplicated here to avoid importing the strategy package (which would create a cycle).

Variables

This section is empty.

Functions

func IsSummarizeEnabled

func IsSummarizeEnabled() bool

IsSummarizeEnabled checks if auto-summarize is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.

func Save added in v0.3.12

func Save(settings *EntireSettings) error

Save saves the settings to .entire/settings.json.

func SaveLocal added in v0.3.12

func SaveLocal(settings *EntireSettings) error

SaveLocal saves the settings to .entire/settings.local.json.

Types

type EntireSettings

type EntireSettings struct {
	// Strategy is the name of the git strategy to use
	Strategy string `json:"strategy"`

	// Enabled indicates whether Entire is active. When false, CLI commands
	// show a disabled message and hooks exit silently. Defaults to true.
	Enabled bool `json:"enabled"`

	// LocalDev indicates whether to use "go run" instead of the "entire" binary
	// This is used for development when the binary is not installed
	LocalDev bool `json:"local_dev,omitempty"`

	// LogLevel sets the logging verbosity (debug, info, warn, error).
	// Can be overridden by ENTIRE_LOG_LEVEL environment variable.
	// Defaults to "info".
	LogLevel string `json:"log_level,omitempty"`

	// StrategyOptions contains strategy-specific configuration
	StrategyOptions map[string]any `json:"strategy_options,omitempty"`

	// Telemetry controls anonymous usage analytics.
	// nil = not asked yet (show prompt), true = opted in, false = opted out
	Telemetry *bool `json:"telemetry,omitempty"`
}

EntireSettings represents the .entire/settings.json configuration

func Load

func Load() (*EntireSettings, error)

Load loads the Entire settings from .entire/settings.json, then applies any overrides from .entire/settings.local.json if it exists. Returns default settings if neither file exists. Works correctly from any subdirectory within the repository.

func LoadFromFile added in v0.3.12

func LoadFromFile(filePath string) (*EntireSettings, error)

LoadFromFile loads settings from a specific file path without merging local overrides. Returns default settings if the file doesn't exist. Use this when you need to display individual settings files separately.

func (*EntireSettings) IsPushSessionsDisabled added in v0.3.12

func (s *EntireSettings) IsPushSessionsDisabled() bool

IsPushSessionsDisabled checks if push_sessions is disabled in settings. Returns true if push_sessions is explicitly set to false.

func (*EntireSettings) IsSummarizeEnabled

func (s *EntireSettings) IsSummarizeEnabled() bool

IsSummarizeEnabled checks if auto-summarize is enabled in this settings instance.

Jump to

Keyboard shortcuts

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