// Copyright © 2023 Ory Corp // SPDX-License-Identifier: Apache-2.0 package identities import ( "encoding/json" "fmt" kratos "github.com/ory/kratos/pkg/httpclient" "github.com/ory/x/cmdx" "github.com/spf13/cobra" "github.com/ory/kratos/cmd/cliclient" ) func NewImportCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "import", Short: "Import resources", } cmd.AddCommand(NewImportIdentitiesCmd()) cliclient.RegisterClientFlags(cmd.PersistentFlags()) cmdx.RegisterFormatFlags(cmd.PersistentFlags()) return cmd } // NewImportIdentitiesCmd represents the import command func NewImportIdentitiesCmd() *cobra.Command { return &cobra.Command{ Use: "identities file-1.json [file-2.json] [file-3.json] [file-n.json]", Short: "Import one or more identities from files or STD_IN", Example: `Create an example identity: cat > ./file.json <