cli

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 {
	HeadSHA() (string, error)
	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