package cmd import ( "fmt" "os" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "pop", Short: "ProtonMail CLI tool", Long: `pop is a CLI tool for interacting with ProtonMail. It provides commands for managing emails, contacts, and attachments with full PGP encryption support.`, } func NewRootCmd() *cobra.Command { rootCmd.AddCommand(loginCmd()) rootCmd.AddCommand(logoutCmd()) rootCmd.AddCommand(sessionCmd()) rootCmd.AddCommand(mailCmd()) rootCmd.AddCommand(mailDraftCmd()) rootCmd.AddCommand(contactCmd()) rootCmd.AddCommand(attachmentCmd()) return rootCmd } func init() { cobra.OnInitialize(initConfig) } func initConfig() { // Initialize config loading // Config is loaded from ~/.config/pop/ } func Execute() { if err := rootCmd.Execute(); err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } }