Secrets

All CLI commands

Usage: secrets-tool <command> [arguments] [--stage NAME | --file PATH] [--key PATH]. Without a command the interactive menu opens; st is an alias. --file points to the secrets.enc (default ./secrets.enc), --stage NAME instead picks the file of a stage, ./secrets.NAME.enc (see Stages), --key points to the identity.key (default see above).

Keys (identity)

CommandWhat it does
init [--no-password]Generates a new key pair, once per machine. Asks for a password; --no-password stores the key unencrypted (only for servers without a keyboard). If you set up the vault on the web, you do not need this: fetch it with identity pull or download the identity.key there.
identity pull [--force]Fetches the key from your web vault to this computer (after remote login). Asks for the vault password; a different existing identity.key only with --force, the old one is kept as identity.key.bak-….
pubkeyPrints only the public key (64 characters), no password. For handing to admins.
show-keyPath of the identity.key, public key and whether it is encrypted.
encrypt-identityAdds password protection to an unencrypted identity.key.
decrypt-identityRemoves the password protection (emergency, backup export). Keep the file safe afterwards.
change-passwordChange the password of the identity.key. Same as "Change vault password" on the web when you use the same file.
unlockEnter the password once, the unlock agent holds the private key in memory only for 30 minutes (SECRETS_TOOL_TTL in seconds changes that). No file on disk, works over SSH too.
unlock --deviceUnlock this computer permanently (Windows, macOS, Linux with a keyring; after remote login): no more password, revocable on the web under My access.
lockEnd the unlock immediately; the unlock agent ends itself.
lock --deviceRemove the device unlock of this computer.

Values

CommandWhat it does
set KEY [VALUE]Set or overwrite a value. The file is re-encrypted. Only for enrolled recipients. Without VALUE the CLI asks for it with hidden input (or reads one line from a pipe), so it is in no command line and no history.
get KEYPrint one value in plaintext, e.g. for scripts: $pw = secrets-tool get DB_PASSWORD.
set-file KEY PATHStore a file, such as a certificate, a private key or a .p8/.p12, at most 1 MB. Encrypted like any value.
get-file KEY [PATH]Write a stored file back, without a path under its name in the current folder. An existing file is only overwritten with --force.
has KEY [--kind]Checks for scripts whether an entry exists, without printing its value (from 0.9.1.44): exit code 0 = present, as text or as a file; 1 = missing; 2 = error, such as no secrets.enc, vault locked or file unreadable. With --kind the output is text or datei. Use has rather than get for checks: get also ends with 1 for a file entry, and a script would take it as missing.
list [--notes]All keys without values, one per line. With --notes the first line of the key's note follows after a tab.
entry list [SEARCH] [--json]Logins and certificates of the password vault with id prefix, folder/title and user or expiry (from 0.9.1.50), German zugang. No passwords.
entry show TITLE|ID [--field F]Shows a login, password and key hidden. --field password prints exactly that value (also user, url, note, certificate, chain, key, passphrase or the name of a custom field). Same titles: give folder/title or the id prefix.
entry copy TITLE|ID [--field F]Copies the password (for certificates the private key) to the clipboard and clears it after 30 seconds if it still holds the same text; on Windows not in the clipboard history. Printing and copying secrets is recorded in the project history when the file is linked to a project.
note KEY [TEXT]Prints or sets the note of an entry (from 0.9.1.45), German notiz. TEXT - reads it from standard input (multi-line), --delete removes it. With notes the file is STSV4.
delete KEYRemove a key.
loadAll values as PowerShell lines $env:KEY = '…', files as Base64. Use: Invoke-Expression (secrets-tool load).
exportAll values in .env format KEY=value, files as Base64, for Bash or Docker Compose. Plaintext, never commit.

Recipients

CommandWhat it does
add-recipient PUBKEYEnroll the public key of a colleague or server. The file is re-encrypted for everyone. On the web: Access tab.
remove-recipient HASHRemove a recipient by short ID (from list-recipients). Rotate affected values afterwards.
list-recipientsAll recipients with short ID and public key.

Stages

CommandWhat it does
--stage NAME …Any command on the file of that stage, e.g. secrets-tool --stage prod set DB_PASSWORD "…". Same effect: SECRETS_TOOL_STAGE=prod.
stagesStage files in the folder with number of recipients, whether you have access, and the link to the web app; the active one is marked with *.
stages new NAME [--from STAGE] [--no-names]Create a new stage: copies the recipients and the names without values from the source stage (default: the current file). --no-names (German --ohne-namen) copies only the recipients.
stages diff [STAGE…]Which names are missing or empty in which stage, never values. Without arguments all stages in the folder.

Connection to the web app

CommandWhat it does
remote login [URL]Connect the device via browser: type the code from the terminal on the page Connect a device. Without URL: https://secret.sareba.com. It replaces a token already saved and revokes the old one on the server (from 0.9.1.42; before, the device was then listed twice under API tokens).
remote login URL TOKENStore access with a token (servers, CI). Token from My access → API tokens.
remote projectsList the projects of the tenant the token is bound to; if there are stages, the stage is shown in its own column.
remote pull PROJECT [--force]Fetch the project's secrets.enc and remember the link in secrets.enc.remote; with --stage prod the stage prod into secrets.prod.enc. Refuses if there are unsaved local changes; --force discards them.
remote syncFetch if only the web is newer; upload if only changed locally. Both changed: conflict, server version in secrets.enc.server.
remote sync --all [--quiet] [--cleanup]Sync all linked files on this computer, each like remote sync; one line per project (pulled, pushed, up to date, conflict, failed, missing). Exit code 1 only on a conflict or error. --quiet shows only conflicts and errors and writes a log; --cleanup drops missing files from the list right away (otherwise after 30 days). No password: only encrypted files go back and forth. From 0.9.1.44.
remote auto-sync on|off|statusBackground sync: remote sync --all --quiet every 15 minutes as a scheduled task of your user (Windows Task Scheduler, macOS LaunchAgent, Linux systemd). status shows whether it is set up and the last run. From 0.9.1.44.
remote config auto-pull on|offTurn auto-pull on or off (default: on).
remote config auto-push on|offTurn auto-push on or off: upload changes to a linked file right away (default: on, from 0.9.1.44).
remote config identity-check on|offHint when identity.key and the web vault are different keys (default: on; off for servers/CI with their own key).
remote push [PROJECT]Upload the local file. Aborts if someone saved in between. Without a name the stored link is used; an unknown project is created (tenant owner/admin only). For a new stage secrets-tool --stage prod remote push is enough: the project name comes from the link of another stage in the folder.
remote statusStored access and link of the local file.
remote logoutDelete the access on this machine, including its device unlock. From 0.9.1.42 it also revokes the token on the server; older versions left it in place, then revoke it on the web under My access → API tokens. An auto-sync that is set up is turned off as well.

Repository and deployment

CommandWhat it does
check [FOLDER] [--json] [--offline] [--verlauf]Checks the repository: secrets.enc and .gitignore, plaintext values, private keys and tokens, deploy scripts, server sync. Exit code 1 on errors. See Checking a repository.
check --hookInstall a pre-commit hook: check --staged before every commit.
hostenv --target PATH --map SOURCE[=TARGET] … [--host | --ssh USER@HOST]Write env files on a Docker host without any value in the console. --hash and --guard provide the check for the one-liner. See Getting env files onto the host.

Other

CommandWhat it does
statusSelf-check: identity.key present, unlock active (with remaining time), secrets.enc readable, tool on PATH; when connected to the web app also auto-pull, auto-push and auto-sync.
migrate-v2 OLD_HEX_KEYConvert very old files (STSV1, one shared key) to the current format.
version [--short]Version, Go version, build date. If a newer version exists, a hint follows.
update [--check] [--force]Update to the latest version. --check only reports whether one exists. Downloads the program from updates.sareba.com and swaps it in only after the list signature, the checksum and the program signature check out and a test run succeeds. In the menu: Update program.
language de|en|autoChoose the CLI language permanently, auto follows the system language. German alias: sprache. In the menu: Language.
helpThis overview in the terminal.

Updating

From version 0.9.1.3 on the CLI updates itself: secrets-tool update. It fetches the latest version from https://updates.sareba.com/secrets-tool. Without login it asks there directly (from 0.9.1.38 on, before that https://secret.sareba.com), otherwise the address from remote login; since 18 Oct 2026 that address redirects its updates there, so older versions find their way too. If your firewall only allows certain addresses, allow updates.sareba.com. If the program lives in a folder without write access (e.g. /usr/local/bin), run the update with sudo or as administrator. Replace older versions without update once by hand.

Environment variables

SECRETS_TOOL_PASSWORD: password of the identity.key for scripts without input (store only in protected CI variables). SECRETS_TOOL_TTL: duration of the unlock with unlock in seconds, default 1800. SECRETS_TOOL_STAGE: stage like --stage, e.g. prod in a CI pipeline. SECRETS_TOOL_LANG=de|en: language for this call, takes precedence over the language setting. SECRETS_TOOL_UPDATE_URL: different source for update. SECRETS_TOOL_NO_UPDATE_CHECK=1: turn off the "update available" hint.

Web only, not in the CLI

Random value generator, .env import with preview, history, tenant switch, token management and sharing by email. The CLI knows only keys, not accounts.