cli

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package cli provides CLI command structure and execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Root

func Root(gitClient GitClient, githubClient GitHubClient, logger *slog.Logger) *cobra.Command

Root returns the root cobra command

Types

type GitClient

type GitClient interface {
	FindLatestTag(tagPrefix string) (*git.Tag, error)
	FindTagByName(name string) (*git.Tag, error)
	FindPreviousAnnotatedTag(current *git.Tag) (*git.Tag, error)
	ListCommitsSinceTag(tag *git.Tag) ([]git.Commit, error)
	ListCommitsSinceRef(refName string) ([]git.Commit, error)
	ListCommitsBetweenTags(from, to *git.Tag) ([]git.Commit, error)
	CreateAnnotatedTag(name, message string) (*git.Tag, error)
	PushTag(ctx context.Context, tagName string, auth git.BasicAuth) error
}

Interface injection for testing

type GitHubClient

type GitHubClient interface {
	GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.Release, error)
	CreateRelease(ctx context.Context, owner, repo string, opts github.CreateReleaseOptions) (*github.Release, error)
	ListPRsForCommit(ctx context.Context, owner, repo, sha string) ([]github.PR, error)
	SearchPRsForCommit(ctx context.Context, query string) ([]github.PR, error)
	PostPRComment(ctx context.Context, owner, repo string, prNumber int, body string) error
	FindPRComment(ctx context.Context, owner, repo string, prNumber int, marker string) (bool, error)
}

Jump to

Keyboard shortcuts

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