github.com/Finschia/finschia-sdk@v0.48.1/client/keys/root.go (about)

     1  package keys
     2  
     3  import (
     4  	"github.com/Finschia/ostracon/libs/cli"
     5  	"github.com/spf13/cobra"
     6  
     7  	"github.com/Finschia/finschia-sdk/client/flags"
     8  )
     9  
    10  // Commands registers a sub-tree of commands to interact with
    11  // local private key storage.
    12  func Commands(defaultNodeHome string) *cobra.Command {
    13  	cmd := &cobra.Command{
    14  		Use:   "keys",
    15  		Short: "Manage your application's keys",
    16  		Long: `Keyring management commands. These keys may be in any format supported by the
    17  Tendermint crypto library and can be used by light-clients, full nodes, or any other application
    18  that needs to sign with a private key.
    19  
    20  The keyring supports the following backends:
    21  
    22      os          Uses the operating system's default credentials store.
    23      file        Uses encrypted file-based keystore within the app's configuration directory.
    24                  This keyring will request a password each time it is accessed, which may occur
    25                  multiple times in a single command resulting in repeated password prompts.
    26      kwallet     Uses KDE Wallet Manager as a credentials management application.
    27      pass        Uses the pass command line utility to store and retrieve keys.
    28      test        Stores keys insecurely to disk. It does not prompt for a password to be unlocked
    29                  and it should be use only for testing purposes.
    30  
    31  kwallet and pass backends depend on external tools. Refer to their respective documentation for more
    32  information:
    33      KWallet     https://github.com/KDE/kwallet
    34      pass        https://www.passwordstore.org/
    35  
    36  The pass backend requires GnuPG: https://gnupg.org/
    37  `,
    38  	}
    39  
    40  	cmd.AddCommand(
    41  		MnemonicKeyCommand(),
    42  		AddKeyCommand(),
    43  		ExportKeyCommand(),
    44  		ImportKeyCommand(),
    45  		ListKeysCmd(),
    46  		ShowKeysCmd(),
    47  		DeleteKeyCommand(),
    48  		ParseKeyStringCommand(),
    49  	)
    50  
    51  	cmd.PersistentFlags().String(flags.FlagHome, defaultNodeHome, "The application home directory")
    52  	cmd.PersistentFlags().String(flags.FlagKeyringDir, "", "The client Keyring directory; if omitted, the default 'home' directory will be used")
    53  	cmd.PersistentFlags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
    54  	cmd.PersistentFlags().String(cli.OutputFlag, "text", "Output format (text|json)")
    55  
    56  	return cmd
    57  }