gh

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthStatus

type AuthStatus struct {
	Username string
	Protocol string
}

AuthStatus represents the authentication status from gh CLI

type Client

type Client struct{}

Client wraps the gh CLI for GitHub operations

func NewClient

func NewClient() *Client

NewClient creates a new GitHub CLI wrapper

func (*Client) Clone

func (c *Client) Clone(repoURL, dest string) error

Clone clones a GitHub repository to the specified destination. repoURL can be:

If dest is empty, clones to the repo name in current directory.

func (*Client) CloneToTemp

func (c *Client) CloneToTemp(repoURL string) (string, error)

CloneToTemp clones a repository to a temporary directory and returns the path. The caller is responsible for cleaning up the directory.

func (*Client) GetAuthStatus

func (c *Client) GetAuthStatus() (*AuthStatus, error)

GetAuthStatus returns the current authentication status

func (*Client) IsAvailable

func (c *Client) IsAvailable() bool

IsAvailable checks if the gh CLI is installed and authenticated

func (*Client) IsInstalled

func (c *Client) IsInstalled() bool

IsInstalled checks if the gh CLI is installed (regardless of auth status)

func (*Client) IssueClose added in v0.17.0

func (c *Client) IssueClose(opts IssueCloseOptions) error

IssueClose closes an issue

func (*Client) IssueCreate added in v0.17.0

func (c *Client) IssueCreate(opts IssueCreateOptions) (*Issue, error)

IssueCreate creates a new issue

func (*Client) IssueList added in v0.17.0

func (c *Client) IssueList(opts IssueListOptions) ([]Issue, error)

IssueList lists issues in a repository

func (*Client) IssueView added in v0.17.0

func (c *Client) IssueView(number int, repo string) (*Issue, error)

IssueView retrieves a single issue by number

func (*Client) Login added in v0.17.0

func (c *Client) Login() error

Login runs gh auth login interactively

type Issue added in v0.17.0

type Issue struct {
	Number    int      `json:"number"`
	Title     string   `json:"title"`
	State     string   `json:"state"`
	Author    string   `json:"author"`
	Labels    []string `json:"labels"`
	Assignees []string `json:"assignees"`
	CreatedAt string   `json:"createdAt"`
	URL       string   `json:"url"`
	Body      string   `json:"body"`
}

Issue represents a GitHub issue

type IssueCloseOptions added in v0.17.0

type IssueCloseOptions struct {
	Number  int
	Comment string
	Reason  string // "completed" or "not planned"
	Repo    string
}

IssueCloseOptions contains options for closing an issue

type IssueCreateOptions added in v0.17.0

type IssueCreateOptions struct {
	Title    string
	Body     string
	Labels   []string
	Assignee string
	Repo     string
}

IssueCreateOptions contains options for creating an issue

type IssueListOptions added in v0.17.0

type IssueListOptions struct {
	State    string // open, closed, all
	Label    string
	Assignee string
	Limit    int
	Repo     string // optional: owner/repo
}

IssueListOptions contains options for listing issues

Jump to

Keyboard shortcuts

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