Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = common.StandardCommand(&cobra.Command{ Use: "ak", Short: "autokitteh command-line interface and local server", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if json { common.SetRenderer(common.JSONRenderer) } if niceJSON { common.SetRenderer(common.NiceJSONRenderer) } path := filepath.Join(xdg.ConfigHomeDir(), ".env") if err := godotenv.Load(path); err != nil { if !errors.Is(err, os.ErrNotExist) { return fmt.Errorf(".env loading error: %w", err) } } confmap, err := parseConfigs(configs) if err != nil { return err } if err := common.InitConfig(confmap); err != nil { return fmt.Errorf("root init config: %w", err) } cfg := common.Config() url := sdkclient.DefaultLocalURL if _, err := cfg.Get(config.ServiceUrlConfigKey, &url); err != nil { return fmt.Errorf("failed parse config: %w", err) } if !strings.HasPrefix(url, "http") { url = "http://" + url } common.InitRPCClient(url, "") return nil }, })
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.