package cli import ( "fmt" "os" "github.com/spf13/cobra" ) var ( cfgFile string verbose bool ) var rootCmd = &cobra.Command{ Use: "at-rund", Short: "AT Protocol serverless runtime daemon", Long: `at-rund is the infrastructure daemon for hosting AT Protocol serverless bundles. It manages Firecracker microVMs, builds runtime images via Nix, and executes bundles in isolated environments with virtio-fs mounting.`, } func Execute() error { return rootCmd.Execute() } func init() { rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default: ~/.at-rund/config.toml)") rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output") rootCmd.AddCommand(initCmd) rootCmd.AddCommand(buildCmd) rootCmd.AddCommand(serveCmd) rootCmd.AddCommand(runtimeCmd) rootCmd.AddCommand(poolCmd) } func configDir() string { home, err := os.UserHomeDir() if err != nil { fmt.Fprintf(os.Stderr, "error: cannot find home directory: %v\n", err) os.Exit(1) } return home + "/.at-rund" }