MCPcopy Create free account
hub / github.com/compozy/agh / runDaemonSkillViewCommand

Function runDaemonSkillViewCommand

internal/cli/skill_commands.go:156–189  ·  view source on GitHub ↗
(
	cmd *cobra.Command,
	deps commandDeps,
	name string,
	filePath string,
	query SkillQuery,
)

Source from the content-addressed store, hash-verified

154}
155
156func runDaemonSkillViewCommand(
157 cmd *cobra.Command,
158 deps commandDeps,
159 name string,
160 filePath string,
161 query SkillQuery,
162) error {
163 if strings.TrimSpace(filePath) != "" {
164 return fmt.Errorf("skill view --workspace does not support --file")
165 }
166 client, err := clientFromDeps(deps)
167 if err != nil {
168 return err
169 }
170 record, err := client.GetSkill(cmd.Context(), name, query)
171 if err != nil {
172 return err
173 }
174 content, err := client.GetSkillContent(cmd.Context(), name, query)
175 if err != nil {
176 return err
177 }
178 rendered, err := renderSkillXML(&skills.Skill{Meta: skills.SkillMeta{Name: record.Name}}, content, nil)
179 if err != nil {
180 return err
181 }
182 item := skillViewItem{
183 Name: record.Name,
184 Source: record.Source,
185 Path: record.Dir,
186 Content: rendered,
187 }
188 return writeCommandOutput(cmd, skillViewBundle(item, rendered))
189}
190
191func runLocalSkillViewCommand(
192 cmd *cobra.Command,

Callers 1

runSkillViewCommandFunction · 0.85

Calls 6

clientFromDepsFunction · 0.85
renderSkillXMLFunction · 0.85
writeCommandOutputFunction · 0.85
skillViewBundleFunction · 0.85
GetSkillMethod · 0.65
GetSkillContentMethod · 0.65

Tested by

no test coverage detected