root.go 687 B

123456789101112131415161718192021222324252627282930313233
  1. package cmd
  2. import (
  3. "fmt"
  4. "os"
  5. "github.com/letta/letta-switchboard-cli/internal/config"
  6. "github.com/spf13/cobra"
  7. )
  8. var rootCmd = &cobra.Command{
  9. Use: "letta-switchboard",
  10. Short: "CLI for routing messages to Letta agents",
  11. Long: `Letta Switchboard - Route messages to Letta AI agents
  12. Send messages immediately or schedule for later. Create recurring
  13. schedules and view execution results.`,
  14. }
  15. // Execute runs the root command
  16. func Execute() error {
  17. return rootCmd.Execute()
  18. }
  19. func init() {
  20. cobra.OnInitialize(initConfig)
  21. }
  22. func initConfig() {
  23. if err := config.InitConfig(); err != nil {
  24. fmt.Fprintf(os.Stderr, "Error initializing config: %v\n", err)
  25. os.Exit(1)
  26. }
  27. }