worktrees

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package worktrees provides Git worktree isolation for multi-agent sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorktreeInfo

type WorktreeInfo struct {
	AgentName  string `json:"agent_name"`
	Path       string `json:"path"`
	BranchName string `json:"branch_name"`
	SessionID  string `json:"session_id"`
	Created    bool   `json:"created"`
	Error      string `json:"error,omitempty"`
}

WorktreeInfo contains information about an agent's worktree

type WorktreeManager

type WorktreeManager struct {
	// contains filtered or unexported fields
}

WorktreeManager manages Git worktrees for agent isolation

func NewManager

func NewManager(projectPath, session string) *WorktreeManager

NewManager creates a new WorktreeManager

func (*WorktreeManager) Cleanup

func (m *WorktreeManager) Cleanup() error

Cleanup removes all worktrees for the current session

func (*WorktreeManager) CreateForAgent

func (m *WorktreeManager) CreateForAgent(agentName string) (*WorktreeInfo, error)

CreateForAgent creates a new worktree for the specified agent

func (*WorktreeManager) GetWorktreeForAgent

func (m *WorktreeManager) GetWorktreeForAgent(agentName string) (*WorktreeInfo, error)

GetWorktreeForAgent returns worktree information for a specific agent

func (*WorktreeManager) ListWorktrees

func (m *WorktreeManager) ListWorktrees() ([]*WorktreeInfo, error)

ListWorktrees returns information about all worktrees for the current session

func (*WorktreeManager) MergeBack

func (m *WorktreeManager) MergeBack(agentName string) error

MergeBack merges an agent's worktree changes back to the main branch

func (*WorktreeManager) RemoveWorktree

func (m *WorktreeManager) RemoveWorktree(agentName string) error

RemoveWorktree removes a specific agent's worktree

Jump to

Keyboard shortcuts

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