MCPcopy Index your code
hub / github.com/cli/cli / fetchDescription

Function fetchDescription

internal/skills/discovery/discovery.go:622–635  ·  view source on GitHub ↗

fetchDescription fetches and parses the frontmatter description for a skill.

(client *api.Client, host, owner, repo string, skill *Skill)

Source from the content-addressed store, hash-verified

620
621// fetchDescription fetches and parses the frontmatter description for a skill.
622func fetchDescription(client *api.Client, host, owner, repo string, skill *Skill) string {
623 if skill.BlobSHA == "" {
624 return ""
625 }
626 content, err := FetchBlob(client, host, owner, repo, skill.BlobSHA)
627 if err != nil {
628 return ""
629 }
630 result, err := frontmatter.Parse(content)
631 if err != nil {
632 return ""
633 }
634 return result.Metadata.Description
635}
636
637// FetchDescriptionsConcurrent fetches descriptions with bounded concurrency.
638func FetchDescriptionsConcurrent(client *api.Client, host, owner, repo string, skills []Skill, onProgress func(done, total int)) {

Callers 2

Calls 2

ParseFunction · 0.92
FetchBlobFunction · 0.85

Tested by

no test coverage detected