age icon indicating copy to clipboard operation
age copied to clipboard

cmd/age: passphrase optionnaly supplied from an environment variable

Open wj opened this issue 2 years ago • 14 comments

The passphrase is now read from the AGE_PASSPHRASE environment variable, as an alternative to being requested interactively.

This enables the following usage patterns:

  • automation of the encryption, without having to manage an additional private key file
  • provide a less error prone way of supplying a passphrase. Copy-pasting to an echo-less prompt, for example, is often hazardous on some platforms.

wj avatar Aug 15 '23 14:08 wj

Hi, How exactly is the env var AGE_PASSPHRASE to be supplied? I was trying age -d --AGE_PASSPHRASE but that doesn't seem to work?

Edit: Never mind, figured out.

ghost avatar Jan 26 '24 13:01 ghost

This would be nice to see, as it would allow one to use 1Password Secret reference syntax for shared passphrases.

jc00ke avatar Feb 27 '24 01:02 jc00ke

This would be great for automation/CI!

@FiloSottile

gaby avatar May 22 '24 12:05 gaby