config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxTerminalsPerWorkspace = 10
	DefaultMaxWorkspaces            = 5
	DefaultMaxTerminalsTotal        = 20
)
View Source
const (
	DefaultBuiltinLayout = "grid"
)
View Source
const ProjectWorkspaceSchemaVersion = 1

Variables

This section is empty.

Functions

func BuiltinLayouts

func BuiltinLayouts() map[string]Layout

BuiltinLayouts returns the built-in layout library.

These are always available to users without needing to define them in YAML. Users can define additional custom layouts in their config file.

func DefaultConfigPath

func DefaultConfigPath() (string, error)

Types

type AgentConfig

type AgentConfig struct {
	Command       string            `yaml:"command"`
	Args          []string          `yaml:"args,omitempty"`
	ReadyPattern  string            `yaml:"ready_pattern,omitempty"`
	IdlePattern   string            `yaml:"idle_pattern,omitempty"`
	OutputMode    string            `yaml:"output_mode,omitempty"` // "hooks" (default), "tags", or "terminal"
	Hooks         AgentHooks        `yaml:"hooks,omitempty"`
	Description   string            `yaml:"description,omitempty"`
	Env           map[string]string `yaml:"env,omitempty"`
	PromptAsArg   bool              `yaml:"prompt_as_arg,omitempty"`
	PromptFlag    string            `yaml:"prompt_flag,omitempty"`    // flag to pass task (e.g. "-i" for gemini); empty = positional arg
	SpawnMode     string            `yaml:"spawn_mode,omitempty"`     // "pane" (default) or "window"
	ResponseFence bool              `yaml:"response_fence,omitempty"` // prepend task with fence instructions for structured output parsing
	PipeTask      bool              `yaml:"pipe_task,omitempty"`      // pipe task via stdin instead of appending as arg or sending via send-keys
	Models        []string          `yaml:"models,omitempty"`
	DefaultModel  string            `yaml:"default_model,omitempty"`
	ModelFlag     string            `yaml:"model_flag,omitempty"`

	// Hook delivery configuration (data-driven, replaces hardcoded per-agent logic).
	HookDelivery      string                 `yaml:"hook_delivery,omitempty"`       // "cli_flag", "project_file", "none"
	HookSettingsFlag  string                 `yaml:"hook_settings_flag,omitempty"`  // e.g. "--settings"
	HookSettingsDir   string                 `yaml:"hook_settings_dir,omitempty"`   // e.g. ".gemini"
	HookSettingsFile  string                 `yaml:"hook_settings_file,omitempty"`  // e.g. "settings.json"
	HookFormat        string                 `yaml:"hook_format,omitempty"`         // "json" (default)
	HookEvents        map[string]string      `yaml:"hook_events,omitempty"`         // abstract → native event mapping
	HookEntry         map[string]interface{} `yaml:"hook_entry,omitempty"`          // template for one event entry
	HookWrapper       map[string]interface{} `yaml:"hook_wrapper,omitempty"`        // top-level wrapper; "{{events}}" sentinel
	HookOutput        map[string]interface{} `yaml:"hook_output,omitempty"`         // stdout response template; "{{context}}" placeholder
	HookResponseField string                 `yaml:"hook_response_field,omitempty"` // stdin JSON field with agent response (e.g. "prompt_response"); empty = transcript
}

AgentConfig describes a CLI agent that can be spawned via MCP.

type AgentHooks added in v1.1.0

type AgentHooks struct {
	OnStart string `yaml:"on_start,omitempty"` // Fires on session start — inject context
	OnCheck string `yaml:"on_check,omitempty"` // Fires mid-conversation — steering/validation
	OnEnd   string `yaml:"on_end,omitempty"`   // Fires on stop — capture output
}

AgentHooks configures termtile's 3 abstract hook points for an agent. Each field is a shell command that termtile injects into the agent's native hook system (e.g., Claude Code --settings, Gemini env vars).

type AgentMode

type AgentMode struct {
	// Multiplexer specifies which terminal multiplexer to use
	// Values: "auto" (default), "tmux", "screen"
	// "auto" will detect and prefer tmux > screen
	Multiplexer string `yaml:"multiplexer"`

	// ManageMultiplexerConfig controls whether termtile generates
	// an optimized multiplexer config file (e.g., ~/.config/termtile/tmux.conf)
	// Default: true
	// Set to false if you want to use your own tmux/screen config entirely
	ManageMultiplexerConfig *bool `yaml:"manage_multiplexer_config"`

	// ProtectSlotZero prevents slot 0 from being killed in agent-mode
	// workspaces, since slot 0 is typically the orchestrating agent.
	// Default: true
	ProtectSlotZero *bool `yaml:"protect_slot_zero"`
}

AgentMode configures the agent/multiplexer integration

func (*AgentMode) GetManageMultiplexerConfig

func (a *AgentMode) GetManageMultiplexerConfig() bool

GetManageMultiplexerConfig returns the effective value, defaulting to true

func (*AgentMode) GetProtectSlotZero

func (a *AgentMode) GetProtectSlotZero() bool

GetProtectSlotZero returns the effective value, defaulting to true. When true, slot 0 cannot be killed in agent-mode workspaces (it is typically the orchestrating agent).

type Config

type Config struct {
	Hotkey                   string                  `yaml:"hotkey"`
	CycleLayoutHotkey        string                  `yaml:"cycle_layout_hotkey"`
	CycleLayoutReverseHotkey string                  `yaml:"cycle_layout_reverse_hotkey"`
	UndoHotkey               string                  `yaml:"undo_hotkey"`
	MoveModeHotkey           string                  `yaml:"move_mode_hotkey"`
	TerminalAddHotkey        string                  `yaml:"terminal_add_hotkey"`
	MoveModeTimeout          int                     `yaml:"move_mode_timeout"`
	PaletteHotkey            string                  `yaml:"palette_hotkey"`
	PaletteBackend           string                  `yaml:"palette_backend"`
	PaletteFuzzyMatching     bool                    `yaml:"palette_fuzzy_matching"`
	Display                  string                  `yaml:"display,omitempty"`
	XAuthority               string                  `yaml:"xauthority,omitempty"`
	PreferredTerminal        string                  `yaml:"preferred_terminal,omitempty"`
	TerminalSpawnCommands    map[string]string       `yaml:"terminal_spawn_commands"`
	GapSize                  int                     `yaml:"gap_size"`
	ScreenPadding            Margins                 `yaml:"screen_padding"`
	DefaultLayout            string                  `yaml:"default_layout"`
	Layouts                  map[string]Layout       `yaml:"layouts"`
	TerminalClasses          TerminalClassList       `yaml:"terminal_classes"`
	TerminalSort             string                  `yaml:"terminal_sort"`
	LogLevel                 string                  `yaml:"log_level"`
	TerminalMargins          map[string]Margins      `yaml:"terminal_margins"`
	AgentMode                AgentMode               `yaml:"agent_mode"`
	Limits                   Limits                  `yaml:"limits,omitempty"`
	Logging                  LoggingConfig           `yaml:"logging,omitempty"`
	Agents                   map[string]AgentConfig  `yaml:"agents,omitempty"`
	ProjectWorkspace         *ProjectWorkspaceConfig `yaml:"-"`
}

Config holds the application configuration.

func BuildEffectiveConfig

func BuildEffectiveConfig(raw RawConfig) (*Config, map[string]string, error)

func DefaultConfig

func DefaultConfig() *Config

func Load

func Load() (*Config, error)

Load reads the merged configuration from the standard location and returns an effective config ready for use by the daemon.

func (*Config) GetDefaultLayout

func (c *Config) GetDefaultLayout() (*Layout, error)

GetDefaultLayout retrieves the default layout.

func (*Config) GetLayout

func (c *Config) GetLayout(name string) (*Layout, error)

GetLayout retrieves a layout by name with validation.

func (*Config) GetLoggingConfig

func (c *Config) GetLoggingConfig() LoggingConfig

GetLoggingConfig returns the logging configuration with defaults applied.

func (*Config) GetMargins

func (c *Config) GetMargins(terminalClass string) Margins

GetMargins returns the margin configuration for a given terminal class.

func (*Config) GetMaxTerminalsForWorkspace

func (c *Config) GetMaxTerminalsForWorkspace(name string) int

GetMaxTerminalsForWorkspace returns the max terminals allowed for a workspace name.

func (*Config) GetMaxTerminalsTotal

func (c *Config) GetMaxTerminalsTotal() int

func (*Config) GetMaxWorkspaces

func (c *Config) GetMaxWorkspaces() int

func (*Config) ResolveTerminal

func (c *Config) ResolveTerminal() string

func (*Config) Save

func (c *Config) Save() error

Save writes the configuration to the standard location.

Note: this marshals the effective config and will not preserve comments or include/inherits structure from the original YAML.

func (*Config) TerminalClassNames

func (c *Config) TerminalClassNames() []string

func (*Config) Validate

func (c *Config) Validate() error

Validate performs strict validation of the effective configuration.

type DetectedAgent

type DetectedAgent struct {
	Name           string
	Path           string
	Configured     bool
	ProposedConfig AgentConfig
}

DetectedAgent represents a known agent CLI found on PATH.

func DetectAgents

func DetectAgents(existing map[string]AgentConfig) []DetectedAgent

DetectAgents scans PATH for known agent CLIs and returns detected entries. If an agent already exists in existing, it is marked configured and no proposed defaults are returned for that entry.

type FixedGrid

type FixedGrid struct {
	Rows int `yaml:"rows"`
	Cols int `yaml:"cols"`
}

FixedGrid defines specific grid dimensions.

type IncludeList

type IncludeList []string

IncludeList supports either:

include: "/path/to/file.yaml"

or:

include:
  - "/path/to/file.yaml"
  - "/path/to/dir"

func (*IncludeList) UnmarshalYAML

func (l *IncludeList) UnmarshalYAML(value *yaml.Node) error

type Layout

type Layout struct {
	Mode              LayoutMode  `yaml:"mode"`
	TileRegion        TileRegion  `yaml:"tile_region"`
	FixedGrid         FixedGrid   `yaml:"fixed_grid,omitempty"`
	MasterStack       MasterStack `yaml:"master_stack,omitempty"`
	MaxTerminalWidth  int         `yaml:"max_terminal_width"`  // 0 = unlimited
	MaxTerminalHeight int         `yaml:"max_terminal_height"` // 0 = unlimited
	FlexibleLastRow   bool        `yaml:"flexible_last_row"`   // Last row windows expand to fill width (auto mode only)
}

Layout defines a tiling configuration.

type LayoutMode

type LayoutMode string

LayoutMode defines how terminals are arranged.

const (
	LayoutModeAuto        LayoutMode = "auto"         // Dynamic grid based on count.
	LayoutModeFixed       LayoutMode = "fixed"        // Specific rows × cols.
	LayoutModeVertical    LayoutMode = "vertical"     // Single column stack.
	LayoutModeHorizontal  LayoutMode = "horizontal"   // Single row side-by-side.
	LayoutModeMasterStack LayoutMode = "master-stack" // Master pane left, stack grid right.
)

type Limits

type Limits struct {
	MaxTerminalsPerWorkspace int                       `yaml:"max_terminals_per_workspace,omitempty"`
	MaxWorkspaces            int                       `yaml:"max_workspaces,omitempty"`
	MaxTerminalsTotal        int                       `yaml:"max_terminals_total,omitempty"`
	WorkspaceOverrides       map[string]WorkspaceLimit `yaml:"workspace_overrides,omitempty"`
}

type LoadResult

type LoadResult struct {
	Config      *Config
	Sources     map[string]Source // YAML-path -> last writer source (file only)
	LayoutBases map[string]string // layout name -> builtin base name
	Files       []string          // all loaded files, in load order
}

func LoadFromPath

func LoadFromPath(path string) (*LoadResult, error)

func LoadFromPathWithProject

func LoadFromPathWithProject(path string, projectRoot string) (*LoadResult, error)

LoadFromPathWithProject loads config from path and merges project-scoped overrides from projectRoot/.termtile/workspace.yaml and local.yaml.

func LoadWithProjectSources

func LoadWithProjectSources(projectRoot string) (*LoadResult, error)

LoadWithProjectSources loads global config plus project-scoped overrides from .termtile/workspace.yaml and .termtile/local.yaml under projectRoot.

func LoadWithSources

func LoadWithSources() (*LoadResult, error)

LoadWithSources loads config and returns file-level sources for introspection.

type LoggingConfig

type LoggingConfig struct {
	// Enabled turns agent action logging on/off
	Enabled bool `yaml:"enabled,omitempty"`
	// Level controls logging verbosity: debug, info, warn, error
	Level string `yaml:"level,omitempty"`
	// File is the log file path (default: ~/.local/share/termtile/agent-actions.log)
	File string `yaml:"file,omitempty"`
	// MaxSizeMB is the maximum log file size before rotation (default: 10)
	MaxSizeMB int `yaml:"max_size_mb,omitempty"`
	// MaxFiles is the number of rotated files to keep (default: 3)
	MaxFiles int `yaml:"max_files,omitempty"`
	// IncludeContent logs full send content (security risk, default: false)
	IncludeContent bool `yaml:"include_content,omitempty"`
	// PreviewLength is the number of characters to preview in log (default: 50)
	PreviewLength int `yaml:"preview_length,omitempty"`
}

LoggingConfig configures agent action logging.

type Margins

type Margins struct {
	Top    int `yaml:"top"`
	Bottom int `yaml:"bottom"`
	Left   int `yaml:"left"`
	Right  int `yaml:"right"`
}

Margins represents margin adjustments for a terminal.

type MasterStack

type MasterStack struct {
	MasterWidthPercent int `yaml:"master_width_percent"` // Width of master pane as percentage (10-90)
	MaxStackRows       int `yaml:"max_stack_rows"`       // Maximum rows in the stack grid (>= 1)
	MaxStackCols       int `yaml:"max_stack_cols"`       // Maximum columns in the stack grid (>= 1)
}

MasterStack defines the master-stack layout parameters.

type ProjectCWDMode

type ProjectCWDMode string
const (
	ProjectCWDModeProjectRoot   ProjectCWDMode = "project_root"
	ProjectCWDModeWorkspaceSave ProjectCWDMode = "workspace_saved"
	ProjectCWDModeExplicit      ProjectCWDMode = "explicit"
)

type ProjectSyncMode

type ProjectSyncMode string
const (
	ProjectSyncModeLinked   ProjectSyncMode = "linked"
	ProjectSyncModeDetached ProjectSyncMode = "detached"
)

type ProjectWorkspaceAgentDefaults

type ProjectWorkspaceAgentDefaults struct {
	SpawnMode string            `yaml:"spawn_mode,omitempty"`
	Model     string            `yaml:"model,omitempty"`
	Env       map[string]string `yaml:"env,omitempty"`
}

type ProjectWorkspaceAgentOverride

type ProjectWorkspaceAgentOverride struct {
	SpawnMode string            `yaml:"spawn_mode,omitempty"`
	Model     string            `yaml:"model,omitempty"`
	Env       map[string]string `yaml:"env,omitempty"`
}

type ProjectWorkspaceAgents

type ProjectWorkspaceAgents struct {
	Defaults  ProjectWorkspaceAgentDefaults            `yaml:"defaults"`
	Overrides map[string]ProjectWorkspaceAgentOverride `yaml:"overrides,omitempty"`
}

type ProjectWorkspaceConfig

type ProjectWorkspaceConfig struct {
	Version            int                       `yaml:"version"`
	Workspace          string                    `yaml:"workspace,omitempty"`
	Project            ProjectWorkspaceProject   `yaml:"project"`
	MCP                ProjectWorkspaceMCP       `yaml:"mcp"`
	Agents             ProjectWorkspaceAgents    `yaml:"agents"`
	WorkspaceOverrides ProjectWorkspaceOverrides `yaml:"workspace_overrides"`
	Sync               ProjectWorkspaceSync      `yaml:"sync"`
}

ProjectWorkspaceConfig stores effective merged project workspace settings from .termtile/workspace.yaml and .termtile/local.yaml.

func DefaultProjectWorkspaceConfig

func DefaultProjectWorkspaceConfig() ProjectWorkspaceConfig

type ProjectWorkspaceMCP

type ProjectWorkspaceMCP struct {
	Spawn ProjectWorkspaceMCPSpawn `yaml:"spawn"`
	Read  ProjectWorkspaceMCPRead  `yaml:"read"`
}

type ProjectWorkspaceMCPRead

type ProjectWorkspaceMCPRead struct {
	DefaultLines     int  `yaml:"default_lines"`
	MaxLines         int  `yaml:"max_lines"`
	SinceLastDefault bool `yaml:"since_last_default"`
}

type ProjectWorkspaceMCPSpawn

type ProjectWorkspaceMCPSpawn struct {
	RequireExplicitWorkspace bool     `yaml:"require_explicit_workspace"`
	ResolutionOrder          []string `yaml:"resolution_order"`
}

type ProjectWorkspaceOverrides

type ProjectWorkspaceOverrides struct {
	Layout               string `yaml:"layout,omitempty"`
	Terminal             string `yaml:"terminal,omitempty"`
	TerminalSpawnCommand string `yaml:"terminal_spawn_command,omitempty"`
}

type ProjectWorkspaceProject

type ProjectWorkspaceProject struct {
	RootMarker string         `yaml:"root_marker"`
	CWDMode    ProjectCWDMode `yaml:"cwd_mode"`
	CWD        string         `yaml:"cwd,omitempty"`
}

type ProjectWorkspaceSync

type ProjectWorkspaceSync struct {
	Mode                ProjectSyncMode `yaml:"mode"`
	PullOnWorkspaceLoad bool            `yaml:"pull_on_workspace_load"`
	PushOnWorkspaceSave bool            `yaml:"push_on_workspace_save"`
	Include             []string        `yaml:"include"`
}

type RawAgentConfig added in v1.1.0

type RawAgentConfig struct {
	Command       string            `yaml:"command"`
	Args          []string          `yaml:"args"`
	ReadyPattern  string            `yaml:"ready_pattern"`
	IdlePattern   string            `yaml:"idle_pattern"`
	OutputMode    string            `yaml:"output_mode"`
	Hooks         RawAgentHooks     `yaml:"hooks"`
	Description   string            `yaml:"description"`
	Env           map[string]string `yaml:"env"`
	PromptAsArg   bool              `yaml:"prompt_as_arg"`
	PromptFlag    string            `yaml:"prompt_flag"`
	SpawnMode     string            `yaml:"spawn_mode"`
	ResponseFence bool              `yaml:"response_fence"`
	PipeTask      bool              `yaml:"pipe_task"`
	Models        []string          `yaml:"models"`
	DefaultModel  string            `yaml:"default_model"`
	ModelFlag     string            `yaml:"model_flag"`

	HookDelivery      string                 `yaml:"hook_delivery"`
	HookSettingsFlag  string                 `yaml:"hook_settings_flag"`
	HookSettingsDir   string                 `yaml:"hook_settings_dir"`
	HookSettingsFile  string                 `yaml:"hook_settings_file"`
	HookFormat        string                 `yaml:"hook_format"`
	HookEvents        map[string]string      `yaml:"hook_events"`
	HookEntry         map[string]interface{} `yaml:"hook_entry"`
	HookWrapper       map[string]interface{} `yaml:"hook_wrapper"`
	HookOutput        map[string]interface{} `yaml:"hook_output"`
	HookResponseField string                 `yaml:"hook_response_field"`
}

type RawAgentHooks added in v1.1.0

type RawAgentHooks struct {
	OnStart string `yaml:"on_start"`
	OnCheck string `yaml:"on_check"`
	OnEnd   string `yaml:"on_end"`
}

type RawAgentMode

type RawAgentMode struct {
	ProtectSlotZero *bool `yaml:"protect_slot_zero"`
}

type RawConfig

type RawConfig struct {
	Include                  IncludeList                `yaml:"include"`
	Hotkey                   *string                    `yaml:"hotkey"`
	CycleLayoutHotkey        *string                    `yaml:"cycle_layout_hotkey"`
	CycleLayoutReverseHotkey *string                    `yaml:"cycle_layout_reverse_hotkey"`
	UndoHotkey               *string                    `yaml:"undo_hotkey"`
	TerminalAddHotkey        *string                    `yaml:"terminal_add_hotkey"`
	PaletteHotkey            *string                    `yaml:"palette_hotkey"`
	PaletteBackend           *string                    `yaml:"palette_backend"`
	PaletteFuzzyMatching     *bool                      `yaml:"palette_fuzzy_matching"`
	Display                  *string                    `yaml:"display"`
	XAuthority               *string                    `yaml:"xauthority"`
	PreferredTerminal        *string                    `yaml:"preferred_terminal"`
	TerminalSpawnCommands    map[string]string          `yaml:"terminal_spawn_commands"`
	GapSize                  *int                       `yaml:"gap_size"`
	ScreenPadding            *RawMargins                `yaml:"screen_padding"`
	DefaultLayout            *string                    `yaml:"default_layout"`
	Layouts                  map[string]RawLayout       `yaml:"layouts"`
	TerminalClasses          TerminalClassList          `yaml:"terminal_classes"`
	TerminalSort             *string                    `yaml:"terminal_sort"`
	LogLevel                 *string                    `yaml:"log_level"`
	TerminalMargins          map[string]RawMargins      `yaml:"terminal_margins"`
	AgentMode                *RawAgentMode              `yaml:"agent_mode"`
	Limits                   *RawLimits                 `yaml:"limits"`
	Logging                  *RawLoggingConfig          `yaml:"logging"`
	Agents                   map[string]RawAgentConfig  `yaml:"agents"`
	ProjectWorkspace         *RawProjectWorkspaceConfig `yaml:"-"`
}

type RawFixedGrid

type RawFixedGrid struct {
	Rows *int `yaml:"rows"`
	Cols *int `yaml:"cols"`
}

type RawLayout

type RawLayout struct {
	Inherits          *string         `yaml:"inherits"`
	Mode              *LayoutMode     `yaml:"mode"`
	TileRegion        *RawTileRegion  `yaml:"tile_region"`
	FixedGrid         *RawFixedGrid   `yaml:"fixed_grid"`
	MasterStack       *RawMasterStack `yaml:"master_stack"`
	MaxTerminalWidth  *int            `yaml:"max_terminal_width"`
	MaxTerminalHeight *int            `yaml:"max_terminal_height"`
	FlexibleLastRow   *bool           `yaml:"flexible_last_row"`
}

type RawLimits

type RawLimits struct {
	MaxTerminalsPerWorkspace *int                         `yaml:"max_terminals_per_workspace"`
	MaxWorkspaces            *int                         `yaml:"max_workspaces"`
	MaxTerminalsTotal        *int                         `yaml:"max_terminals_total"`
	WorkspaceOverrides       map[string]RawWorkspaceLimit `yaml:"workspace_overrides"`
}

type RawLoggingConfig

type RawLoggingConfig struct {
	Enabled        *bool   `yaml:"enabled"`
	Level          *string `yaml:"level"`
	File           *string `yaml:"file"`
	MaxSizeMB      *int    `yaml:"max_size_mb"`
	MaxFiles       *int    `yaml:"max_files"`
	IncludeContent *bool   `yaml:"include_content"`
	PreviewLength  *int    `yaml:"preview_length"`
}

type RawMargins

type RawMargins struct {
	Top    *int `yaml:"top"`
	Bottom *int `yaml:"bottom"`
	Left   *int `yaml:"left"`
	Right  *int `yaml:"right"`
}

type RawMasterStack

type RawMasterStack struct {
	MasterWidthPercent *int `yaml:"master_width_percent"`
	MaxStackRows       *int `yaml:"max_stack_rows"`
	MaxStackCols       *int `yaml:"max_stack_cols"`
}

type RawProjectWorkspaceAgentDefaults

type RawProjectWorkspaceAgentDefaults struct {
	SpawnMode *string           `yaml:"spawn_mode"`
	Model     *string           `yaml:"model"`
	Env       map[string]string `yaml:"env"`
}

type RawProjectWorkspaceAgentOverride

type RawProjectWorkspaceAgentOverride struct {
	SpawnMode *string           `yaml:"spawn_mode"`
	Model     *string           `yaml:"model"`
	Env       map[string]string `yaml:"env"`
}

type RawProjectWorkspaceAgents

type RawProjectWorkspaceAgents struct {
	Defaults  *RawProjectWorkspaceAgentDefaults           `yaml:"defaults"`
	Overrides map[string]RawProjectWorkspaceAgentOverride `yaml:"overrides"`
}

type RawProjectWorkspaceConfig

type RawProjectWorkspaceConfig struct {
	Version            *int                          `yaml:"version"`
	Workspace          *string                       `yaml:"workspace"`
	Project            *RawProjectWorkspaceProject   `yaml:"project"`
	MCP                *RawProjectWorkspaceMCP       `yaml:"mcp"`
	Agents             *RawProjectWorkspaceAgents    `yaml:"agents"`
	WorkspaceOverrides *RawProjectWorkspaceOverrides `yaml:"workspace_overrides"`
	Sync               *RawProjectWorkspaceSync      `yaml:"sync"`
}

RawProjectWorkspaceConfig represents .termtile/workspace.yaml and .termtile/local.yaml.

type RawProjectWorkspaceMCP

type RawProjectWorkspaceMCP struct {
	Spawn *RawProjectWorkspaceMCPSpawn `yaml:"spawn"`
	Read  *RawProjectWorkspaceMCPRead  `yaml:"read"`
}

type RawProjectWorkspaceMCPRead

type RawProjectWorkspaceMCPRead struct {
	DefaultLines     *int  `yaml:"default_lines"`
	MaxLines         *int  `yaml:"max_lines"`
	SinceLastDefault *bool `yaml:"since_last_default"`
}

type RawProjectWorkspaceMCPSpawn

type RawProjectWorkspaceMCPSpawn struct {
	RequireExplicitWorkspace *bool    `yaml:"require_explicit_workspace"`
	ResolutionOrder          []string `yaml:"resolution_order"`
}

type RawProjectWorkspaceOverrides

type RawProjectWorkspaceOverrides struct {
	Layout               *string `yaml:"layout"`
	Terminal             *string `yaml:"terminal"`
	TerminalSpawnCommand *string `yaml:"terminal_spawn_command"`
}

type RawProjectWorkspaceProject

type RawProjectWorkspaceProject struct {
	RootMarker *string `yaml:"root_marker"`
	CWDMode    *string `yaml:"cwd_mode"`
	CWD        *string `yaml:"cwd"`
}

type RawProjectWorkspaceSync

type RawProjectWorkspaceSync struct {
	Mode                *string  `yaml:"mode"`
	PullOnWorkspaceLoad *bool    `yaml:"pull_on_workspace_load"`
	PushOnWorkspaceSave *bool    `yaml:"push_on_workspace_save"`
	Include             []string `yaml:"include"`
}

type RawTileRegion

type RawTileRegion struct {
	Type          *RegionType `yaml:"type"`
	XPercent      *int        `yaml:"x_percent"`
	YPercent      *int        `yaml:"y_percent"`
	WidthPercent  *int        `yaml:"width_percent"`
	HeightPercent *int        `yaml:"height_percent"`
}

type RawWorkspaceLimit

type RawWorkspaceLimit struct {
	MaxTerminals *int `yaml:"max_terminals"`
}

type RegionType

type RegionType string

RegionType defines tile region presets.

const (
	RegionFull       RegionType = "full"
	RegionLeftHalf   RegionType = "left-half"
	RegionRightHalf  RegionType = "right-half"
	RegionTopHalf    RegionType = "top-half"
	RegionBottomHalf RegionType = "bottom-half"
	RegionCustom     RegionType = "custom"
)

type Source

type Source struct {
	Kind   SourceKind
	Name   string // for builtin/default
	File   string
	Line   int
	Column int
}

func Explain

func Explain(res *LoadResult, path string) (any, Source, error)

Explain returns the effective value at the given YAML-like path and its source.

Supported paths include:

hotkey
terminal_add_hotkey
palette_hotkey
palette_backend
display
xauthority
preferred_terminal
terminal
limits.max_terminals_per_workspace
limits.max_workspaces
limits.max_terminals_total
terminal_spawn_commands
gap_size
screen_padding.top
default_layout
terminal_classes
terminal_sort
log_level
terminal_margins.<WM_CLASS>.top
layouts.<name>.mode
layouts.<name>.tile_region.type
layouts.<name>.fixed_grid.rows

type SourceKind

type SourceKind string
const (
	SourceDefault SourceKind = "default"
	SourceBuiltin SourceKind = "builtin"
	SourceFile    SourceKind = "file"
)

type TerminalClass

type TerminalClass struct {
	Class   string `yaml:"class"`
	Default bool   `yaml:"default,omitempty"`
}

type TerminalClassList

type TerminalClassList []TerminalClass

TerminalClassList supports either:

terminal_classes:
  - "kitty"
  - "Alacritty"

or:

terminal_classes:
  - class: kitty
    default: true
  - class: Alacritty

func (TerminalClassList) MarshalYAML

func (l TerminalClassList) MarshalYAML() (any, error)

func (*TerminalClassList) UnmarshalYAML

func (l *TerminalClassList) UnmarshalYAML(value *yaml.Node) error

type TileRegion

type TileRegion struct {
	Type          RegionType `yaml:"type"`
	XPercent      int        `yaml:"x_percent"`      // 0-100
	YPercent      int        `yaml:"y_percent"`      // 0-100
	WidthPercent  int        `yaml:"width_percent"`  // 0-100
	HeightPercent int        `yaml:"height_percent"` // 0-100
}

TileRegion defines where to tile windows.

type ValidationError

type ValidationError struct {
	Path   string
	Source Source
	Err    error
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

type WorkspaceLimit

type WorkspaceLimit struct {
	MaxTerminals int `yaml:"max_terminals,omitempty"`
}

Jump to

Keyboard shortcuts

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