MCPcopy Create free account
hub / github.com/LunaSource/Luna / askForAPIKey

Function askForAPIKey

config/config.go:262–272  ·  view source on GitHub ↗
(configType string)

Source from the content-addressed store, hash-verified

260}
261
262func askForAPIKey(configType string) string {
263 fmt.Printf("→ Set API key for %s? (Enter to skip or paste)\n", configType)
264 reader := bufio.NewReader(os.Stdin)
265 input, _ := reader.ReadString('\n')
266 input = strings.TrimSpace(input)
267 if input == "" {
268 clip, _ := clipboard.ReadAll()
269 return strings.TrimSpace(clip)
270 }
271 return input
272}
273
274func contains(slice []string, item string) bool {
275 for _, s := range slice {

Callers 1

initConfigInteractiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected