Info shows metadata about a skill, checking local installed first, then registries. If fromRegistry is non-empty, only that registry is queried for remote metadata. The function is a thin orchestrator — each row of the output (name, description, version, …) is rendered by a focused helper so the fun
(ctx context.Context, name string, fromRegistry string)
| 604 | // helper so the function stays under the project's complexity budget and |
| 605 | // each row can be exercised independently in tests. |
| 606 | func (sh *SkillHandler) Info(ctx context.Context, name string, fromRegistry string) { |
| 607 | ctx, cancel := context.WithTimeout(ctx, 10*time.Second) |
| 608 | defer cancel() |
| 609 | |
| 610 | local := sh.findBestLocalInfo(name) |
| 611 | remote := sh.resolveRemoteSkillMeta(ctx, name, fromRegistry) |
| 612 | |
| 613 | if local == nil && remote == nil { |
| 614 | fmt.Printf("\n %s\n\n", i18n.T("skill.info.not_found", name)) |
| 615 | return |
| 616 | } |
| 617 | |
| 618 | fmt.Println() |
| 619 | sh.printSkillInfoHeader(name, local, remote) |
| 620 | sh.printSkillInfoDetails(local, remote) |
| 621 | sh.printSkillSourceLinks(remote) |
| 622 | |
| 623 | if remote != nil && registry.IsSkillsShSource(remote.RegistryName) && remote.Slug != "" { |
| 624 | sh.showSecurityAudits(ctx, remote) |
| 625 | } |
| 626 | printSkillModeration(remote) |
| 627 | sh.printSkillInstallStatus(name) |
| 628 | fmt.Println() |
| 629 | } |
| 630 | |
| 631 | // findBestLocalInfo returns the first local install record matching the |
| 632 | // (base) name, or nil when nothing local exists. |
no test coverage detected