MCPcopy Create free account
hub / github.com/GetStream/stream-cli / listCmd

Function listCmd

pkg/cmd/chat/push/push.go:97–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97func listCmd() *cobra.Command {
98 cmd := &cobra.Command{
99 Use: "list-pushproviders --output-format [json|tree]",
100 Short: "List all push providers",
101 Example: heredoc.Doc(`
102 # List all push providers
103 $ stream-cli chat list-pushproviders
104 `),
105 RunE: func(cmd *cobra.Command, args []string) error {
106 c, err := config.GetConfig(cmd).GetClient(cmd)
107 if err != nil {
108 return err
109 }
110
111 resp, err := c.ListPushProviders(cmd.Context())
112 if err != nil {
113 return err
114 }
115
116 return utils.PrintObject(cmd, resp.PushProviders)
117 },
118 }
119
120 fl := cmd.Flags()
121 fl.StringP("output-format", "o", "json", "Output format. One of: json|tree")
122
123 return cmd
124}
125
126func deleteCmd() *cobra.Command {
127 cmd := &cobra.Command{

Callers 1

NewCmdsFunction · 0.70

Calls 3

GetConfigFunction · 0.92
PrintObjectFunction · 0.92
GetClientMethod · 0.80

Tested by

no test coverage detected