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

Function newSkillViewCommand

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

Source from the content-addressed store, hash-verified

110}
111
112func newSkillViewCommand(deps commandDeps) *cobra.Command {
113 var filePath string
114 var workspace string
115 var agentName string
116
117 cmd := &cobra.Command{
118 Use: "view <name>",
119 Short: "Read a skill or one of its resource files",
120 Example: ` # Render a skill as the XML block injected into agents
121 agh skill view code-review
122
123 # Read a resource file inside a skill directory
124 agh skill view code-review --file references/checklist.md`,
125 Args: exactOneNonBlankArg(),
126 RunE: func(cmd *cobra.Command, args []string) error {
127 return runSkillViewCommand(cmd, deps, args[0], filePath)
128 },
129 }
130 cmd.Flags().StringVar(&filePath, "file", "", "Relative file path inside the skill directory")
131 cmd.Flags().StringVar(
132 &workspace,
133 workspaceSkillSource,
134 "",
135 "Resolve the daemon-managed skill from a workspace id, name, or path",
136 )
137 cmd.Flags().StringVar(&agentName, "for-agent", "", "Resolve the effective skill set for one logical agent")
138 return cmd
139}
140
141func runSkillViewCommand(cmd *cobra.Command, deps commandDeps, name string, filePath string) error {
142 skillName := strings.TrimSpace(name)

Callers 1

newSkillCommandFunction · 0.85

Calls 2

exactOneNonBlankArgFunction · 0.85
runSkillViewCommandFunction · 0.85

Tested by

no test coverage detected