MCPcopy Create free account
hub / github.com/cli/cli / fetchDescription

Function fetchDescription

internal/skills/discovery/discovery.go:649–662  ·  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

647
648// fetchDescription fetches and parses the frontmatter description for a skill.
649func fetchDescription(client *api.Client, host, owner, repo string, skill *Skill) string {
650 if skill.BlobSHA == "" {
651 return ""
652 }
653 content, err := FetchBlob(client, host, owner, repo, skill.BlobSHA)
654 if err != nil {
655 return ""
656 }
657 result, err := frontmatter.Parse(content.Raw())
658 if err != nil {
659 return ""
660 }
661 return result.Metadata.Description
662}
663
664// FetchDescriptionsConcurrent fetches descriptions with bounded concurrency.
665func FetchDescriptionsConcurrent(client *api.Client, host, owner, repo string, skills []Skill, onProgress func(done, total int)) {

Callers 2

Calls 3

ParseFunction · 0.92
FetchBlobFunction · 0.85
RawMethod · 0.80

Tested by

no test coverage detected