Skip to content
In this guidecoffre CLI

coffre CLI

Runs any program with the secrets in its environment and manages your vaults from the terminal. You type your master password here, and it never goes to the server.

  • coffrebox-cli 0.2.0
  • Linux, macOS, and Windows
  • Open source (MIT)

Install

Terminal · Linux
# On ARM (Graviton, Raspberry Pi), replace x86_64 with aarch64
B=https://github.com/brunosps/coffrebox-sdk/releases/download/v0.2.0
curl -fLO $B/coffre-0.2.0-x86_64-unknown-linux-musl.tar.gz -fLO $B/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missing \
  && tar -xzf coffre-0.2.0-x86_64-unknown-linux-musl.tar.gz coffre \
  && sudo install coffre /usr/local/bin/
Terminal · macOS
# On an Intel Mac, replace aarch64 with x86_64
B=https://github.com/brunosps/coffrebox-sdk/releases/download/v0.2.0
curl -fLO $B/coffre-0.2.0-aarch64-apple-darwin.tar.gz -fLO $B/SHA256SUMS
grep aarch64-apple-darwin SHA256SUMS | shasum -a 256 -c \
  && tar -xzf coffre-0.2.0-aarch64-apple-darwin.tar.gz coffre \
  && sudo install coffre /usr/local/bin/
PowerShell · Windows
$B = "https://github.com/brunosps/coffrebox-sdk/releases/download/v0.2.0"
Invoke-WebRequest "$B/coffre-0.2.0-x86_64-pc-windows-msvc.zip" -OutFile coffre.zip
Invoke-WebRequest "$B/SHA256SUMS" -OutFile SHA256SUMS
$expected = (Select-String "x86_64-pc-windows-msvc.zip" SHA256SUMS).Line.Split(" ")[0]
if ((Get-FileHash coffre.zip -Algorithm SHA256).Hash -ne $expected) { throw "SHA-256 mismatch" }
else { Expand-Archive coffre.zip -DestinationPath "$env:LOCALAPPDATA\coffre" }
# Then add %LOCALAPPDATA%\coffre to your PATH
Terminal · Cargo
# Requires Rust 1.89 or newer; the binary goes to ~/.cargo/bin
cargo install coffrebox-cli --locked

The Linux binaries are static and run on any distribution, including Alpine. The macOS and Windows binaries aren’t signed yet: if you download them from the terminal, as above, the system doesn’t block them. If you download the file with a browser on macOS, check its SHA-256 against the release’s SHA256SUMS, as in the block above, and only then run xattr -d com.apple.quarantine coffre.

Each release also carries a build provenance attestation signed by GitHub. With the GitHub CLI, gh attestation verify <file> -R brunosps/coffrebox-sdk --signer-workflow brunosps/coffrebox-sdk/.github/workflows/release.yml confirms the file was built and signed by the public repository’s release workflow.

The CLI supports English and Brazilian Portuguese. Use coffre --lang en --help or coffre --lang pt-BR --help. Without the flag, it reads LC_ALL, then LC_MESSAGES, then LANG, skipping empty variables. Portuguese locales (pt*) use pt-BR; other values, including C and POSIX, use English. If all locale variables are empty or unset, it uses English. The flag works with every subcommand.

Old Portuguese names remain as hidden aliases in 0.2.x and warn on stderr without changing stdout or exit codes. Use the new names: account codes, account check-codes, account new-codes, account change-authenticator, account rotate-secret, account change-password, vault trust, --name, --recovery-code, --all, --type personal|app, --role and --format.

Sign in

You create your account in the web vault. The CLI signs in with it:

Terminal
coffre login --server https://coffrebox.net --email you@example.com

The CLI asks for your master password, without showing what you type, and for the code from your authenticator app. The password doesn’t leave your computer: only a key derived from it goes to the server.

The session is kept in the system keychain (Keychain, Credential Manager, or Secret Service). Without a keychain, as on a headless server, it goes to ~/.config/coffrebox/session.json with 0600 permissions. That file opens your vaults while the session is valid: on servers and in CI, use an application credential instead.

Without a keychain, set HOME, XDG_CONFIG_HOME, or COFFREBOX_SESSION_FILE to choose where the session and trust file are stored. Without these paths, the CLI refuses to write them; it never falls back to /tmp. New trust file directories are created with 0700 permissions on Linux and macOS.

Run with the secrets

coffre run fetches the vault, verifies it, decrypts it, and hands the secrets to the program as environment variables. The secrets don’t go to disk.

Terminal
# On a server or in CI: COFFREBOX_URL and COFFREBOX_TOKEN are already in the environment
coffre run -- node server.js

# On your computer, with your session: pick the vault by name
coffre run --vault "Payments API" -- npm run dev
  • With COFFREBOX_TOKEN in the environment, the CLI reads that access’s vault and ignores the session. The application credential isn’t passed to the program: it receives only the secrets.
  • On Linux and macOS, the program takes the CLI’s place in the same process: it receives signals (docker stop, systemctl stop) directly, and the exit code is its own.
  • The secrets are read once, at startup. To pick up a new value, restart the program.

Commands

CommandWhat it does
coffre login · logoutSign in and sign out. logout --all also ends the sessions on your other devices.
coffre vault ls · vault createList and create vaults. --type app creates a vault for systems.
coffre ls · getList the names in a vault and read a value. get requires --reveal outside a terminal; without it, the exit code is 77.
coffre setStore a secret. The value comes from standard input or from a prompt without echo, never from an argument, which would stay in your shell history.
coffre rm · historyDelete a secret and see its latest versions.
coffre app create · app ls · app revokeCreate, list, and revoke system accesses. The application credential is shown once.
coffre member invite · confirm · rmInvite, confirm (after the person accepts through the e-mail link), and remove people from a shared vault.
coffre runRun a program with the secrets in its environment.
coffre envPrint the secrets in plaintext, as dotenv or JSON, with a warning on stderr. Requires --reveal outside a terminal; without it, the exit code is 77.
coffre accountRecovery codes, and changing the authenticator app and the master password.

coffre --help and coffre <command> --help show all the options.

get and env refuse output to pipes, files, and command substitutions with exit code 77 (EX_NOPERM), without printing any values. In a terminal, they work as before. This means $(coffre get …) and eval "$(coffre env)" now need --reveal, for example $(coffre get "Payments API" STRIPE_SECRET_KEY --reveal) and eval "$(coffre env --vault 'Payments API' --reveal)". The flag allows plaintext output; env still warns on stderr. To pass secrets to a program, prefer coffre run --vault <vault> -- <command>.

Terminal
# Store a secret without leaving the value in your shell history
printf %s "$NEW_KEY" | coffre set "Payments API" STRIPE_SECRET_KEY

# Create an access for CI
coffre app create "CI" --vault "Payments API"

Shared vaults

When the owner of a shared vault changes keys (because they switched devices or accounts), the CLI stops opening the vault until you check the new key through another channel, like a phone call, and confirm it with coffre vault trust <vault>. This is what stops the server from swapping the owner’s key without anyone noticing.