MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / runConfig

Function runConfig

cmd/configcmd.go:16–42  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

14}
15
16func runConfig(cmd *cobra.Command, args []string) error {
17 cfg, err := config.Load()
18 if err != nil {
19 return err
20 }
21 if cfg == nil {
22 fmt.Println("Not authenticated. Run `cloudcent init` to authenticate.")
23 return nil
24 }
25
26 p, _ := config.Path()
27 maskedKey := "Not set"
28 if cfg.APIKey != nil {
29 key := *cfg.APIKey
30 if len(key) > 12 {
31 maskedKey = key[:8] + "..." + key[len(key)-4:]
32 } else {
33 maskedKey = "****"
34 }
35 }
36
37 fmt.Printf("Config Path: %s\n", p)
38 fmt.Printf("CLI ID: %s\n", cfg.CliID)
39 fmt.Printf("API Key: %s\n", maskedKey)
40 fmt.Println("Status: Authenticated")
41 return nil
42}

Callers

nothing calls this directly

Calls 2

LoadFunction · 0.92
PathFunction · 0.92

Tested by

no test coverage detected