( cmd *cobra.Command, deps commandDeps, name string, filePath string, query SkillQuery, )
| 154 | } |
| 155 | |
| 156 | func 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 | |
| 191 | func runLocalSkillViewCommand( |
| 192 | cmd *cobra.Command, |
no test coverage detected