`secret vault import` took only a vault without a long-term key, and `secret init` and `secret vault create` give every vault one, so it always failed. A mnemonic enters through those two commands, so the command goes, with its tests and its README entry. The help and the note of `secret generate mnemonic` named `secret import`, which imports a file as a secret; they now name `secret init` and `secret vault create`. `secret vault import` now prints the help of `secret vault` and exits 0, as cobra does for any subcommand of `secret vault` it does not know. Judgement call: TestWorkflowMismatch in internal/vault, which replayed the import step by step, is deleted. Model: opus-5-5
This commit was merged in pull request #174.
This commit is contained in:
@@ -43,7 +43,7 @@ func newGenerateMnemonicCmd() *cobra.Command {
|
||||
Short: "Generate a random BIP39 mnemonic phrase",
|
||||
Long: `Generate a cryptographically secure random BIP39 ` +
|
||||
`mnemonic phrase that can be used with 'secret init' ` +
|
||||
`or 'secret import'.`,
|
||||
`or 'secret vault create'.`,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
cli, err := NewCLIInstance()
|
||||
if err != nil {
|
||||
@@ -115,8 +115,10 @@ func (cli *Instance) GenerateMnemonic(cmd *cobra.Command) error {
|
||||
" • If you lose this phrase, your secrets cannot be recovered")
|
||||
fmt.Fprintln(os.Stderr, "")
|
||||
fmt.Fprintln(os.Stderr, "Use this mnemonic with:")
|
||||
fmt.Fprintln(os.Stderr, " secret init (to initialize a new secret manager)")
|
||||
fmt.Fprintln(os.Stderr, " secret import (to import into an existing vault)")
|
||||
fmt.Fprintln(os.Stderr,
|
||||
" secret init (to initialize a new secret manager)")
|
||||
fmt.Fprintln(os.Stderr,
|
||||
" secret vault create <name> (to create another vault)")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user