cmd

package
v0.0.68 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigExists

func ConfigExists() (bool, error)

func Run

func Run(args []string) error

func SaveConfig

func SaveConfig(cfg Config) error

Types

type Config

type Config struct {
	AgentCommand          string `json:"agent_command"`
	NewBranchBaseRef      string `json:"new_branch_base_ref,omitempty"`
	NewBranchFetchFirst   *bool  `json:"new_branch_fetch_first,omitempty"`
	IDECommand            string `json:"ide_command,omitempty"`
	MainScreenBranchLimit int    `json:"main_screen_branch_limit,omitempty"`
}

func LoadConfig

func LoadConfig() (Config, error)

type GHManager

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

func NewGHManager

func NewGHManager() *GHManager

func (*GHManager) PRDataByBranch

func (m *GHManager) PRDataByBranch(repoRoot string, branches []string) (map[string]PRData, error)

func (*GHManager) PRDataByBranchForce

func (m *GHManager) PRDataByBranchForce(repoRoot string, branches []string) (map[string]PRData, error)

type LockManager

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

func NewLockManager

func NewLockManager() *LockManager

func (*LockManager) Acquire

func (m *LockManager) Acquire(repoRoot string, worktreePath string) (*WorktreeLock, error)

func (*LockManager) AcquireForPID

func (m *LockManager) AcquireForPID(repoRoot string, worktreePath string, pid int) (*WorktreeLock, error)

func (*LockManager) ForceUnlock

func (m *LockManager) ForceUnlock(repoRoot string, worktreePath string) error

func (*LockManager) IsAvailable

func (m *LockManager) IsAvailable(repoRoot string, worktreePath string) (bool, error)

func (*LockManager) ReleaseIfOwned

func (m *LockManager) ReleaseIfOwned(repoRoot string, worktreePath string) error

type PRCIState

type PRCIState string
const (
	PRCINone       PRCIState = "none"
	PRCIInProgress PRCIState = "in_progress"
	PRCIFail       PRCIState = "fail"
	PRCISuccess    PRCIState = "success"
)

type PRData

type PRData struct {
	Number              int
	URL                 string
	Branch              string
	Status              string
	ReviewDecision      string
	Approved            bool
	ReviewApproved      int
	ReviewRequired      int
	ReviewKnown         bool
	UnresolvedComments  int
	ResolvedComments    int
	CommentThreadsTotal int
	CIState             PRCIState
	CIRequired          bool
	CICompleted         int
	CITotal             int
	CIFailingNames      string
	CommentsRequired    bool
	CommentsKnown       bool
	BaseStatus          string
}

type RunResult

type RunResult struct {
	Started bool
	Warning string
}

type Runner

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

func NewRunner

func NewRunner(lockMgr *LockManager) *Runner

func (*Runner) OpenURL

func (r *Runner) OpenURL(url string) error

func (*Runner) RunInWorktree

func (r *Runner) RunInWorktree(worktreePath string, branch string, lock *WorktreeLock) (RunResult, error)

func (*Runner) RunShellInWorktree

func (r *Runner) RunShellInWorktree(worktreePath string, branch string, lock *WorktreeLock) (RunResult, error)

type WorktreeInfo

type WorktreeInfo struct {
	Path                string
	Branch              string
	Available           bool
	LastUsedUnix        int64
	PRURL               string
	PRNumber            int
	HasPR               bool
	PRStatus            string
	CIState             PRCIState
	CIDone              int
	CITotal             int
	CIFailingNames      string
	Approved            bool
	ReviewApproved      int
	ReviewRequired      int
	ReviewKnown         bool
	UnresolvedComments  int
	ResolvedComments    int
	CommentThreadsTotal int
	CommentsKnown       bool
}

type WorktreeLock

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

func (*WorktreeLock) RebindPID

func (l *WorktreeLock) RebindPID(pid int) error

func (*WorktreeLock) Release

func (l *WorktreeLock) Release()

type WorktreeManager

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

func NewWorktreeManager

func NewWorktreeManager(cwd string, lockMgr *LockManager) *WorktreeManager

func (*WorktreeManager) AcquireWorktreeLock

func (m *WorktreeManager) AcquireWorktreeLock(worktreePath string) (*WorktreeLock, error)

func (*WorktreeManager) CanDeleteWorktree

func (m *WorktreeManager) CanDeleteWorktree(path string) error

func (*WorktreeManager) CheckoutExistingBranch

func (m *WorktreeManager) CheckoutExistingBranch(worktreePath string, branch string) error

func (*WorktreeManager) CheckoutNewBranch

func (m *WorktreeManager) CheckoutNewBranch(worktreePath string, branch string, baseRef string, doFetch bool) error

func (*WorktreeManager) CreateWorktree

func (m *WorktreeManager) CreateWorktree(branch string, baseRef string) (WorktreeInfo, error)

func (*WorktreeManager) CreateWorktreeFromBranch

func (m *WorktreeManager) CreateWorktreeFromBranch(branch string) (WorktreeInfo, error)

func (*WorktreeManager) DeleteWorktree

func (m *WorktreeManager) DeleteWorktree(path string, force bool) error

func (*WorktreeManager) FetchRepo

func (m *WorktreeManager) FetchRepo() error

func (*WorktreeManager) FetchRepoBaseRef added in v0.0.61

func (m *WorktreeManager) FetchRepoBaseRef(baseRef string) error

func (*WorktreeManager) ListAllLocalBranchesByRecentUse added in v0.0.68

func (m *WorktreeManager) ListAllLocalBranchesByRecentUse() ([]string, error)

func (*WorktreeManager) ListForStatusBase

func (m *WorktreeManager) ListForStatusBase() WorktreeStatus

func (*WorktreeManager) ListLocalBranchesByRecentUse

func (m *WorktreeManager) ListLocalBranchesByRecentUse() ([]string, error)

func (*WorktreeManager) ResolveBaseRefForNewBranch

func (m *WorktreeManager) ResolveBaseRefForNewBranch() string

func (*WorktreeManager) UnlockWorktree

func (m *WorktreeManager) UnlockWorktree(worktreePath string) error

type WorktreeOrchestrator

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

func NewWorktreeOrchestrator

func NewWorktreeOrchestrator(mgr *WorktreeManager, lockMgr *LockManager, prMgr *GHManager) *WorktreeOrchestrator

func (*WorktreeOrchestrator) PRDataForBranchesWithError

func (o *WorktreeOrchestrator) PRDataForBranchesWithError(repoRoot string, branches []string, force bool) (map[string]PRData, error)

func (*WorktreeOrchestrator) PRDataForStatusWithError

func (o *WorktreeOrchestrator) PRDataForStatusWithError(status WorktreeStatus, force bool) (map[string]PRData, error)

func (*WorktreeOrchestrator) ResolveOpenTargetSlot

func (o *WorktreeOrchestrator) ResolveOpenTargetSlot(slots []openSlotState, targetBranch string, targetIsNew bool) (openSlotState, bool)

func (*WorktreeOrchestrator) Status

type WorktreeStatus

type WorktreeStatus struct {
	GitInstalled bool
	InRepo       bool
	RepoRoot     string
	CWD          string
	HasRemote    bool
	BaseRef      string
	Worktrees    []WorktreeInfo
	Orphaned     []WorktreeInfo
	Malformed    []string
	Err          error
}

Jump to

Keyboard shortcuts

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