FishmemDocs

Vaults, references and run

How secrets are organised in vaults, how fishmem run injects them, and how fm:// references keep .env files safe to commit.

Vaults

A vault is like one .env file: a set of items for one app, service or area of your life (my-saas, homelab). Item names are unique within a vault. There are no environments inside a vault: development and production are two vaults, such as my-saas and my-saas-prod, each with its own service tokens and webhooks. Every account has a default vault, Personal; it comes first in every list and can't be deleted. You can rename it like any vault: double-click it in the Dashboard's sidebar, or change its name in its settings. fm://Personal/NAME keeps pointing at it after a rename. In the Dashboard's sidebar your own vaults are always listed under Private, with a lock on the folder icon: only you can see them. A workspace's shared vaults, such as a family's, are listed under that workspace's name, with people on the folder icon. A vault's page says the same above its items: "Private · 2 items", or the workspace's name.

fishmem secrets create my-saas
fishmem secrets create my-saas-prod
fishmem secrets vaults                       # every vault, Personal first

One item can be in several vaults. Linking puts the same item in another vault, not a copy: edit it once and every vault sees the change. Removing it from one vault leaves the others alone.

fishmem secrets link OPENAI_API_KEY -p my-saas --to blog    # the same item in blog too
fishmem secrets rm OPENAI_API_KEY -p blog                   # only from blog; --everywhere deletes it from every vault
fishmem secrets duplicates                                  # same value saved separately; --merge N or --merge-all links them

Most commands take -p VAULT (--vault), a vault name or id. Without it, the vault comes from FISHMEM_VAULT, then from .fishmem.json in the repository; ls, get, set and rm fall back to Personal, while run, export, token and webhook need a vault.

Kinds of secrets

KindForFields
api_keyTokens and keysvalue, note
passwordLoginsvalue, username, URL, 2FA, note
noteFree text, recovery codes, certificatesvalue
textPlain settings that aren't secret but belong with the restvalue

SSH keys and passkeys are kinds too; they're created by fishmem ssh and the browser extension.

fishmem secrets set STRIPE_KEY -p my-saas-prod                          # hidden prompt
echo -n "$VALUE" | fishmem secrets set STRIPE_KEY -p my-saas-prod       # from stdin
fishmem secrets set github.com --kind password --username me --url https://github.com    # no -p: Personal
fishmem secrets get STRIPE_KEY -p my-saas-prod
fishmem secrets rm STRIPE_KEY -p my-saas-prod                           # 30 days in the trash

Avoid passing a value as a command-line argument on shared machines: it lands in your shell history and the process list. The hidden prompt and stdin don't.

fishmem run

fishmem run -p my-saas -- npm run dev

run decrypts one vault and starts the command with every secret set as an environment variable. The values exist only in that process and its children.

  • Existing variables are overridden by default. Use --no-override to keep what's already set.
  • --env-file FILE also reads KEY=VALUE lines from files, resolving fm:// references in them.
  • --only-refs resolves references only, without injecting the whole vault. Use it when a program should see a few named keys and nothing else.

References

A reference is a pointer to a secret, written where a value would go:

ReferencePoints to
fm://NAMENAME in the current vault
fm://VAULT/NAMENAME in any vault you can read

Both can end in #field to pick another field, such as fm://Personal/github.com#username. The old three-part form fm://PROJECT/ENV/NAME is refused with a hint to write fm://VAULT/NAME.

References turn a .env file into something you can commit:

# .env.example — safe to commit
DATABASE_URL=fm://DATABASE_URL
STRIPE_KEY=fm://my-saas-prod/STRIPE_KEY
LOG_LEVEL=debug
fishmem run --env-file .env.example -- npm test

The same references work in the JS SDK and in values that are already in the environment when fishmem run starts.

Exporting for deploy tools

Some tools want a file or a shell snippet. export prints a vault in the format they need:

fishmem secrets export -p my-saas-prod --format dotenv
fishmem secrets export -p my-saas-prod --format json
eval "$(fishmem secrets export -p my-saas --format shell)"

Prefer fishmem run when you can: an exported file is plaintext on disk until you delete it.

History, trash and rollback

  • Each secret keeps its last 20 versions: fishmem secrets versions NAME and fishmem secrets restore NAME --version N.
  • Deleted secrets stay in the trash for 30 days: fishmem secrets trash, untrash, purge.
  • The server also keeps the last 50 versions of each vault, so you can roll an entire vault back: fishmem secrets history -p my-saas-prod and fishmem secrets rollback -p my-saas-prod --version 3.

Item history is sealed with your master key: service tokens can read the current values of their vault, never old ones.

Compare and rotate

fishmem secrets diff my-saas my-saas-prod          # names only, values are never printed
fishmem secrets diff my-saas my-saas-prod --check  # exit 1 if a name is missing on either side, for CI
fishmem secrets remind STRIPE_KEY -p my-saas-prod --every 90d
fishmem secrets due                                # what's due, and tokens about to expire
fishmem secrets rotate-key -p my-saas-prod         # new vault key, tokens re-wrapped

Sync

Secrets are stored on the device first and work offline. While you're signed in, they sync with your other devices automatically, on every plan, the free one included: each secret merges independently (the latest write wins) and deletions are kept as tombstones, so a stale device can't bring a deleted secret back. fishmem secrets sync syncs right away.

A family's shared vaults sync while the family's plan is active; see Plans and billing.

Something missing or wrong? Tell us at support@fishmem.com