package cli import ( "fmt" "os" "github.com/spf13/cobra" "git.cloudinit.dev/coreci/orca/internal/certpaths" ) var initCmd = &cobra.Command{ Use: "init", Short: "Initialize local orca state directory", Long: "Create the local orca state directory (honors $ORCA_HOME; defaults to ~/.orca) and write a default config file.", RunE: func(cmd *cobra.Command, args []string) error { orcaDir := certpaths.Dir() if err := os.MkdirAll(orcaDir, 0o755); err != nil { return fmt.Errorf("create orca dir: %w", err) } result := map[string]string{ "path": orcaDir, "status": "initialized", } if jsonOutput { return printJSON(result) } printText("✓ Initialized orca state at %s\n", orcaDir) return nil }, } func init() { rootCmd.AddCommand(initCmd) }