cli

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFromBranch

func CreateFromBranch(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, branchName, worktreeName string, withChange, silent bool) (string, error)

CreateFromBranch creates a worktree from a branch name.

func CreateFromBranchWithFS added in v1.30.0

func CreateFromBranchWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, branchName, worktreeName string, withChange, silent bool, fs OSFilesystem) (string, error)

CreateFromBranchWithFS creates a worktree from a branch name using the provided filesystem.

func CreateFromIssue added in v1.34.0

func CreateFromIssue(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, issueNumber int, baseBranch string, noWorkspace, silent bool) (string, error)

CreateFromIssue creates a worktree from an issue number.

func CreateFromIssueWithFS added in v1.34.0

func CreateFromIssueWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, issueNumber int, baseBranch string, noWorkspace, silent bool, fs OSFilesystem) (string, error)

CreateFromIssueWithFS creates a worktree from an issue number using the provided filesystem.

func CreateFromPR

func CreateFromPR(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, noWorkspace, silent bool) (string, error)

CreateFromPR creates a worktree from a PR number.

func CreateFromPRWithFS added in v1.30.0

func CreateFromPRWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, noWorkspace, silent bool, fs OSFilesystem) (string, error)

CreateFromPRWithFS creates a worktree from a PR number using the provided filesystem.

func DeleteWorktree

func DeleteWorktree(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, worktreePath string, deleteBranch, silent bool) error

DeleteWorktree deletes a worktree. If worktreePath is empty, lists available worktrees.

func FindWorktreeByPathOrName added in v1.37.0

func FindWorktreeByPathOrName(pathOrName string, worktrees []*models.WorktreeInfo, worktreeDir, repoName string) (*models.WorktreeInfo, error)

FindWorktreeByPathOrName finds a worktree by its path or name.

func RenameWorktree added in v1.37.0

func RenameWorktree(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, worktreePath, newName string, silent bool) error

RenameWorktree renames a worktree. The branch is renamed only when the current worktree name and branch name are the same.

func SelectIssueInteractive added in v1.34.0

func SelectIssueInteractive(ctx context.Context, gitSvc gitService, stdin io.Reader, stderr io.Writer) (int, error)

SelectIssueInteractive presents an interactive issue selector (fzf when available, numbered list otherwise).

func SelectIssueInteractiveFromStdio added in v1.34.0

func SelectIssueInteractiveFromStdio(ctx context.Context, gitSvc gitService) (int, error)

SelectIssueInteractiveFromStdio wraps SelectIssueInteractive with os.Stdin/os.Stderr.

func SelectPRInteractive added in v1.34.0

func SelectPRInteractive(ctx context.Context, gitSvc gitService, stdin io.Reader, stderr io.Writer) (int, error)

SelectPRInteractive presents an interactive PR selector (fzf when available, numbered list otherwise).

func SelectPRInteractiveFromStdio added in v1.34.0

func SelectPRInteractiveFromStdio(ctx context.Context, gitSvc gitService) (int, error)

SelectPRInteractiveFromStdio wraps SelectPRInteractive with os.Stdin/os.Stderr.

Types

type OSFilesystem added in v1.30.0

type OSFilesystem interface {
	Stat(name string) (os.FileInfo, error)
	MkdirAll(path string, perm os.FileMode) error
	Getwd() (string, error)
}

OSFilesystem abstracts filesystem operations for dependency injection.

var DefaultFS OSFilesystem = RealFilesystem{}

DefaultFS is the default filesystem implementation using the real os package.

type RealFilesystem added in v1.30.0

type RealFilesystem struct{}

RealFilesystem implements OSFilesystem using the real os package.

func (RealFilesystem) Getwd added in v1.30.0

func (RealFilesystem) Getwd() (string, error)

Getwd wraps os.Getwd.

func (RealFilesystem) MkdirAll added in v1.30.0

func (RealFilesystem) MkdirAll(path string, perm os.FileMode) error

MkdirAll wraps os.MkdirAll.

func (RealFilesystem) Stat added in v1.30.0

func (RealFilesystem) Stat(name string) (os.FileInfo, error)

Stat wraps os.Stat.

Jump to

Keyboard shortcuts

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