Manage secrets from the terminal
This guide lists, sets, points and removes secrets with nocturn secret. Run every command on the daemon's machine, in the folder that holds .env and nocturn-data/, with NOCTURN_MASTER_PASSPHRASE set. In Docker, prefix each with docker compose exec -T nocturn.
List what is stored
nocturn secret ls
nocturn secret source showls prints names only, never a value.
Give an extension its credential
printf %s "$TOKEN" | nocturn secret set acme # an MCP server, or an extension with one credential
printf %s "$KEY" | nocturn secret set weather/apikey # one named credential of a plugin
nocturn reloadThe value is read from stdin. Running set again replaces it.
Point a credential at a Vaultwarden item
Instead of a copy, keep a reference to an item of a connected source:
nocturn secret set weather/apikey --ref vault-home:<item id>Keep a secret of your own for some hosts
An entry of nocturn's own vault, vault/<name>, can be used by the HTTP tools (as: vault/<name>) for the hosts you name and no others:
printf %s "$TOKEN" | nocturn secret set vault/grafana --host grafana.home.example
printf %s "$TOKEN" | nocturn secret set vault/hass --host hass.home.example \
--header Authorization --prefix 'Bearer '--host repeats for several hosts. The value rides in Authorization: Bearer <value> unless --header and --prefix say otherwise. Without any --host, nothing can use it.
Store an SSH key
nocturn secret set vault/fw-admin --ssh-user admin --host fw.home.example < ~/.ssh/nocturn_fwThe key must have no passphrase: the vault is encrypted already. See SSH.
The mailbox's passwords
printf %s "$SMTP_PASSWORD" | nocturn secret set mail/smtp # a separate app password for sendingChange or remove a source
nocturn secret source set vault-home --sync 15m # change how often it syncs
nocturn secret source set vault-home --name vault-family # rename; aliases and rules follow
nocturn secret source add bitwarden --replace --name vault-home --url https://vault.home.example --collection nocturn
nocturn secret source remove vault-homeA new --url needs the credentials again, so it goes through add --replace, which reads them from stdin as add does. Removing a source also drops the rules on its items.
Remove a secret
nocturn secret rm weather/apikey
nocturn secret rm vault/grafana