(deps commandDeps)
| 146 | } |
| 147 | |
| 148 | func newToolInfoCommand(deps commandDeps) *cobra.Command { |
| 149 | var scope toolScopeFlags |
| 150 | cmd := &cobra.Command{ |
| 151 | Use: "info <tool_id>", |
| 152 | Short: "Show one registry tool descriptor and diagnostics", |
| 153 | Example: ` # Show a tool descriptor and availability diagnostics |
| 154 | agh tool info agh__skill_view -o json`, |
| 155 | Args: exactOneNonBlankArg(), |
| 156 | RunE: func(cmd *cobra.Command, args []string) error { |
| 157 | id, err := parseToolIDArg(args[0]) |
| 158 | if err != nil { |
| 159 | return writeToolCommandError(cmd, err) |
| 160 | } |
| 161 | return runToolCommand(cmd, deps, func(client DaemonClient) error { |
| 162 | response, err := client.GetTool(cmd.Context(), id.String(), scope.query()) |
| 163 | if err != nil { |
| 164 | return err |
| 165 | } |
| 166 | return writeCommandOutput(cmd, toolInfoBundle(&response)) |
| 167 | }) |
| 168 | }, |
| 169 | } |
| 170 | scope.bind(cmd) |
| 171 | return cmd |
| 172 | } |
| 173 | |
| 174 | func newToolApproveCommand(deps commandDeps) *cobra.Command { |
| 175 | var flags toolApprovalFlags |
no test coverage detected