Structured password manager using age encryption
Files
README.md

This project is a minimal password manager written in POSIX shell that uses age and jq for encryption and editing. To run it, use the following syntax:

gate [save] filter [length]

When being ran for the first time, the script will ask for a password which will be used to encrypt/decrypt the vault. Choose a strong password, as it can only be changed manually after initial setup (this is to prevent age's secret key from ever being stored in a temporary file). To insert data into the vault, jq filters can be used:

gate '.codeberg.pass = "p455w0rd"'

This command doesn't actually store the data, it only displays the effects of the filter. To save the data, a filter has to be prefixed with the save option. Random passwords can be generated by following the command with a number which describes the desired length of the password. To use a generated password inside a filter, use the $pass variable (the length option has to be specified, otherwise $pass will be empty).

gate save '.codeberg.pass = $pass' 32

It is advised to always test filters first because some could overwrite the entire vault. Filters to view passwords should never be used with the save option:

gate .codeberg.pass

Since the vault is an encrypted json file, it can be structured in any way. For example:

{
  "email": {
    "address": [
      "mail1@example.com",
      "mail2@example.com",
      "mail3@example.com"
    ],
    "pass": "p455w0rd"
  },
  "codeberg": {
    "user": "oxetene",
    "pass": "dr0w554p"
  }
}