ghcli

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ghcli provides a GitHub CLI (gh) tool that agents can use for GitHub operations not covered by the native SCM tools, such as viewing workflow run logs, listing Actions runs, and other gh-specific capabilities.

The tool is only bootstrapped when both the `gh` binary is available on PATH and a GITHUB_TOKEN is provided via the secret configuration. This keeps the tool optional — deployments without GitHub access simply skip it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Token string `yaml:"token,omitempty" toml:"token,omitempty"`
}

Config holds configuration for the gh CLI tool provider. Token is the GitHub personal access token or fine-grained token. When empty, the tool provider is not bootstrapped.

type ToolProvider

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

ToolProvider wraps the gh CLI tool and satisfies the tools.ToolProviders interface so it can be passed directly to tools.NewRegistry. The provider is only created when gh is available and a token is configured.

func New

func New(ctx context.Context, cfg Config) *ToolProvider

New creates a ToolProvider if both the gh binary is on PATH and the token is non-empty. Returns nil if either prerequisite is missing. This makes the tool entirely opt-in: deployments without the gh binary or without a GITHUB_TOKEN simply don't get the tool.

func (*ToolProvider) GetTools

func (p *ToolProvider) GetTools() []tool.Tool

GetTools returns the gh_cli tool.

Jump to

Keyboard shortcuts

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