Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
Name string `json:"name"`
Branch string `json:"branch"`
Repo string `json:"repo"`
Base string `json:"base"`
Created string `json:"created"`
Assistant string `json:"assistant"` // "claude", "codex", "gemini"
Scripts ScriptsConfig `json:"scripts"`
ScriptMode string `json:"script_mode"` // "concurrent" or "nonconcurrent"
Env map[string]string `json:"env"`
PortBase *int `json:"port_base"`
LastActiveBufferName string `json:"last_active_buffer_name"`
OpenTabs []TabInfo `json:"open_tabs,omitempty"` // Persisted tabs
ActiveTabIndex int `json:"active_tab_index"`
}
Metadata stores per-worktree configuration
type MetadataStore ¶
type MetadataStore struct {
// contains filtered or unexported fields
}
MetadataStore manages per-worktree metadata persistence
func NewMetadataStore ¶
func NewMetadataStore(metadataRoot string) *MetadataStore
NewMetadataStore creates a new metadata store
func (*MetadataStore) Delete ¶
func (s *MetadataStore) Delete(wt *Worktree) error
Delete removes metadata for a worktree
type Project ¶
type Project struct {
Name string `json:"name"`
Path string `json:"path"` // Absolute path to repository
Worktrees []Worktree `json:"-"` // Discovered dynamically via git
}
Project represents a registered git repository with its worktrees
func NewProject ¶
NewProject creates a new Project from a repository path
func (*Project) AddWorktree ¶
AddWorktree adds a worktree to the project
func (*Project) FindWorktree ¶
FindWorktree finds a worktree by its root path
func (*Project) FindWorktreeByName ¶
FindWorktreeByName finds a worktree by its name
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the projects.json file for persistent project tracking
func NewRegistry ¶
NewRegistry creates a new registry at the specified path
func (*Registry) AddProject ¶
AddProject adds a project path to the registry
func (*Registry) RemoveProject ¶
RemoveProject removes a project path from the registry
type ScriptsConfig ¶
type ScriptsConfig struct {
Setup string `json:"setup"`
Run string `json:"run"`
Archive string `json:"archive"`
}
ScriptsConfig holds the setup/run/archive script commands
type Worktree ¶
type Worktree struct {
Name string `json:"name"`
Branch string `json:"branch"`
Base string `json:"base"` // Base ref (e.g., origin/main)
Repo string `json:"repo"` // Primary checkout path
Root string `json:"root"` // Worktree path
Created time.Time `json:"created"`
}
Worktree represents a git worktree entry with its associated metadata
func NewWorktree ¶
NewWorktree creates a new Worktree with the current timestamp
func (Worktree) ID ¶
func (w Worktree) ID() WorktreeID
ID returns a unique identifier for the worktree based on its repo and root paths
func (Worktree) IsMainBranch ¶
IsMainBranch returns true if this worktree is on main or master branch
func (Worktree) IsPrimaryCheckout ¶
IsPrimaryCheckout returns true if this is the main checkout (not a worktree)