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

Function newSkillWhereCommand

internal/cli/skill_commands.go:316–361  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

314}
315
316func newSkillWhereCommand(deps commandDeps) *cobra.Command {
317 var workspace string
318 var agentName string
319
320 cmd := &cobra.Command{
321 Use: "where <name>",
322 Short: "Show every path participating in skill resolution",
323 Example: " # Show which skill declaration wins and which ones are shadowed\n agh skill where code-review",
324 Args: exactOneNonBlankArg(),
325 RunE: func(cmd *cobra.Command, args []string) error {
326 scope, err := resolveSkillCommandScope(cmd.Context(), cmd, deps, agentActionCLI("skill.where"))
327 if err != nil {
328 return err
329 }
330 if scope.useDaemon {
331 client, err := clientFromDeps(deps)
332 if err != nil {
333 return err
334 }
335 record, err := client.GetSkillShadows(cmd.Context(), args[0], scope.query)
336 if err != nil {
337 return err
338 }
339 return writeCommandOutput(cmd, skillWhereBundle(record))
340 }
341
342 ctx, err := loadSkillCommandContext(cmd.Context(), deps, scope.query.ForAgent)
343 if err != nil {
344 return err
345 }
346 shadows, ok := skills.ShadowsForSkillList(ctx.skills, args[0], cliNow(deps.now))
347 if !ok {
348 return fmt.Errorf("skill %q not found", strings.TrimSpace(args[0]))
349 }
350 return writeCommandOutput(cmd, skillWhereBundle(skillShadowsRecordFromDomain(shadows)))
351 },
352 }
353 cmd.Flags().StringVar(
354 &workspace,
355 workspaceSkillSource,
356 "",
357 "Resolve the daemon-managed skill from a workspace id, name, or path",
358 )
359 cmd.Flags().StringVar(&agentName, "for-agent", "", "Resolve the effective skill set for one logical agent")
360 return cmd
361}
362
363func newSkillCreateCommand(deps commandDeps) *cobra.Command {
364 return &cobra.Command{

Callers 1

newSkillCommandFunction · 0.85

Calls 10

exactOneNonBlankArgFunction · 0.85
resolveSkillCommandScopeFunction · 0.85
agentActionCLIFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
skillWhereBundleFunction · 0.85
loadSkillCommandContextFunction · 0.85
cliNowFunction · 0.85
GetSkillShadowsMethod · 0.65

Tested by

no test coverage detected