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

Function setAppDefaultCmd

pkg/cmd/config/config.go:107–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105}
106
107func setAppDefaultCmd() *cobra.Command {
108 return &cobra.Command{
109 Use: "default [app-name]",
110 Short: "Set an application as the default",
111 Long: heredoc.Doc(`
112 Set an application as the default which will be used
113 for all further operations unless specified otherwise.
114 `),
115 Example: heredoc.Doc(`
116 # Set an application as the default
117 $ stream-cli config default staging
118
119 # All underlying operations will use it if not specified otherwise
120 $ stream-cli chat get-app
121 # Prints the settings of staging app
122
123 # Specifying other apps during an operation
124 $ stream-cli chat get-app --app prod
125 # Prints the settings of prod app
126 `),
127 Args: cobra.ExactArgs(1),
128 RunE: func(cmd *cobra.Command, args []string) error {
129 config := cfg.GetConfig(cmd)
130 return config.SetDefault(args[0])
131 },
132 }
133}
134
135func runQuestionnaire(cmd *cobra.Command) error {
136 var newAppConfig cfg.App

Callers 1

NewRootCmdFunction · 0.85

Calls 1

SetDefaultMethod · 0.80

Tested by

no test coverage detected