config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSplit = "horizontal"

Variables

View Source
var DefaultLayout = &LayoutNode{
	Split: "horizontal",
	Panes: []*LayoutNode{
		{Cmd: "claude", Size: "60%"},
		{Cmd: "shell", Size: "20%"},
		{Cmd: "shell", Size: "20%"},
	},
}

Functions

func DefaultConfigPath

func DefaultConfigPath() string

Types

type Config

type Config struct {
	Workspace      string    `yaml:"workspace,omitempty"`
	Coordinator    bool      `yaml:"coordinator,omitempty"`
	CoordinatorCmd string    `yaml:"coordinator_cmd,omitempty"`
	Defaults       Defaults  `yaml:"defaults"`
	Projects       []Project `yaml:"projects"`
}

func Load

func Load(path string) (*Config, error)

func (*Config) EffectiveWorkspace

func (c *Config) EffectiveWorkspace() string

EffectiveWorkspace returns the resolved workspace directory. Defaults to the user's home directory if not set.

type Defaults

type Defaults struct {
	Layout *LayoutSpec `yaml:"layout"`
	Split  string      `yaml:"split"`
}

type LayoutNode

type LayoutNode struct {
	// Leaf fields
	Cmd  string `yaml:"cmd,omitempty"`
	Size string `yaml:"size,omitempty"`

	// Branch fields
	Split string        `yaml:"split,omitempty"`
	Panes []*LayoutNode `yaml:"panes,omitempty"`
}

LayoutNode is a recursive layout tree node. A leaf has Cmd set; a branch has Split + Panes set.

func (*LayoutNode) IsLeaf

func (n *LayoutNode) IsLeaf() bool

IsLeaf returns true if this node represents a single pane (has a command).

func (*LayoutNode) Leaves

func (n *LayoutNode) Leaves() []*LayoutNode

Leaves returns all leaf nodes in depth-first order.

type LayoutSpec

type LayoutSpec struct {
	Root *LayoutNode
}

LayoutSpec wraps a LayoutNode pointer with custom YAML unmarshaling to support both the old flat list format and the new nested format.

func (LayoutSpec) MarshalYAML

func (ls LayoutSpec) MarshalYAML() (interface{}, error)

func (*LayoutSpec) UnmarshalYAML

func (ls *LayoutSpec) UnmarshalYAML(value *yaml.Node) error

type Pane

type Pane struct {
	Cmd  string `yaml:"cmd"`
	Size string `yaml:"size"`
}

Pane is the legacy flat layout entry. Kept for backward-compatible YAML parsing.

type Project

type Project struct {
	Path   string      `yaml:"path"`
	Name   string      `yaml:"name"`
	Layout *LayoutSpec `yaml:"layout,omitempty"`
	Split  string      `yaml:"split,omitempty"`
}

func (*Project) EffectiveLayout

func (p *Project) EffectiveLayout(defaults Defaults) *LayoutNode

EffectiveLayout returns the layout tree for a project, falling back to defaults.

Jump to

Keyboard shortcuts

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