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

Function newToolsetsInfoCommand

internal/cli/tool_operator.go:312–336  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

310}
311
312func newToolsetsInfoCommand(deps commandDeps) *cobra.Command {
313 var scope toolScopeFlags
314 cmd := &cobra.Command{
315 Use: "info <toolset_id>",
316 Short: "Show one registry toolset expansion",
317 Example: ` # Show one toolset and expanded tool ids
318 agh toolsets info agh__catalog -o json`,
319 Args: exactOneNonBlankArg(),
320 RunE: func(cmd *cobra.Command, args []string) error {
321 id, err := parseToolsetIDArg(args[0])
322 if err != nil {
323 return writeToolCommandError(cmd, err)
324 }
325 return runToolCommand(cmd, deps, func(client DaemonClient) error {
326 response, err := client.GetToolset(cmd.Context(), id.String(), scope.query())
327 if err != nil {
328 return err
329 }
330 return writeCommandOutput(cmd, toolsetInfoBundle(response))
331 })
332 },
333 }
334 scope.bind(cmd)
335 return cmd
336}
337
338func (f *toolScopeFlags) bind(cmd *cobra.Command) {
339 cmd.Flags().StringVar(&f.workspaceID, "workspace", "", "Workspace id for scoped diagnostics")

Callers 1

newToolsetsCommandFunction · 0.85

Calls 10

queryMethod · 0.95
bindMethod · 0.95
exactOneNonBlankArgFunction · 0.85
parseToolsetIDArgFunction · 0.85
writeToolCommandErrorFunction · 0.85
runToolCommandFunction · 0.85
writeCommandOutputFunction · 0.85
toolsetInfoBundleFunction · 0.85
GetToolsetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected