Documentation
¶
Overview ¶
Package github interacts with the GitHub API to search and fetch repositories.
Index ¶
Constants ¶
const ( // SkillTopic is the default topic to search for agent skills SkillTopic = "agent-skill" // APIURL is the GitHub API endpoint for searching repositories APIURL = "https://api.github.com/search/repositories" )
Variables ¶
var OfflineMode = false
OfflineMode controls whether to skip network requests
Functions ¶
func ParseBrowserURL ¶ added in v1.3.3
ParseBrowserURL parses a GitHub browser URL and extracts components Input: https://github.com/owner/repo/tree/branch/path/to/skill Returns: repoURL, branch, subDir, skillName, ok
func ParseRepoURL ¶ added in v1.4.0
ParseRepoURL parses a GitHub repository URL to extract owner and repo name Supports formats: - owner/repo - https://github.com/owner/repo - https://github.com/owner/repo.git - git@github.com:owner/repo.git
Types ¶
type Content ¶
type Content struct {
Name string `json:"name"`
Type string `json:"type"`
HTMLURL string `json:"html_url"`
}
Content represents a file or directory in a GitHub repository
type Repository ¶
type Repository struct {
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description"`
HTMLURL string `json:"html_url"`
StargazersCount int `json:"stargazers_count"`
CloneURL string `json:"clone_url"`
UpdatedAt time.Time `json:"updated_at"`
Source string `json:"-"` // Source name (e.g., "community", "anthropics")
Owner struct {
Login string `json:"login"`
} `json:"owner"`
}
Repository represents a GitHub repository structure
func FetchRepoDetails ¶ added in v0.7.2
func FetchRepoDetails(owner, repo string) (*Repository, error)
FetchRepoDetails fetches details of a GitHub repository including star count
func SearchDir ¶
func SearchDir(owner, repo, path string) ([]Repository, error)
SearchDir searches a specific directory in a GitHub repository for subdirectories (skills)
func SearchTopic ¶
func SearchTopic(topic, keyword string) ([]Repository, error)
SearchTopic searches GitHub for repositories with a specific topic and keyword
type SearchResult ¶
type SearchResult struct {
TotalCount int `json:"total_count"`
Items []Repository `json:"items"`
}
SearchResult represents the response from GitHub search API