(deps commandDeps)
| 79 | } |
| 80 | |
| 81 | func newToolListCommand(deps commandDeps) *cobra.Command { |
| 82 | var scope toolScopeFlags |
| 83 | cmd := &cobra.Command{ |
| 84 | Use: toolOperatorListKey, |
| 85 | Short: "List operator-visible registry tools", |
| 86 | Example: ` # List all operator-visible tools as JSON |
| 87 | agh tool list -o json |
| 88 | |
| 89 | # Inspect the session-scoped operator view for one agent |
| 90 | agh tool list --workspace ws-1 --session sess-1 --agent coder -o json`, |
| 91 | Args: cobra.NoArgs, |
| 92 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 93 | return runToolCommand(cmd, deps, func(client DaemonClient) error { |
| 94 | response, err := client.ListTools(cmd.Context(), scope.query()) |
| 95 | if err != nil { |
| 96 | return err |
| 97 | } |
| 98 | return writeCommandOutput(cmd, toolListBundle(response)) |
| 99 | }) |
| 100 | }, |
| 101 | } |
| 102 | scope.bind(cmd) |
| 103 | return cmd |
| 104 | } |
| 105 | |
| 106 | func newToolSearchCommand(deps commandDeps) *cobra.Command { |
| 107 | var scope toolScopeFlags |
no test coverage detected