gist

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package gist provides GitHub Gist operations for agent sharing. It uses the gh CLI tool for authentication and API access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURL

func GetURL(gistID string) string

GetURL returns the web URL for a gist ID.

func ParseGistRef

func ParseGistRef(ref string) (string, error)

ParseGistRef extracts a gist ID from a URL or raw ID. Supports:

Types

type Client

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

Client wraps gh CLI operations for gist management.

func NewClient

func NewClient() (*Client, error)

NewClient creates a new gist client. Returns an error if gh CLI is not available.

func (*Client) Create

func (c *Client) Create(description string, public bool, files map[string]string) (*Gist, error)

Create creates a new gist with the given files. Returns the created gist with ID and URL populated.

func (*Client) Get

func (c *Client) Get(gistID string) (*Gist, error)

Get fetches a gist by ID.

func (*Client) Update

func (c *Client) Update(gistID string, files map[string]string) error

Update updates an existing gist with new file contents.

type Gist

type Gist struct {
	ID          string
	URL         string
	Description string
	Public      bool
	Files       map[string]string // filename -> content
}

Gist represents a GitHub Gist.

Jump to

Keyboard shortcuts

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