Skip to main content
Version: v5.7.0

opschain vault store-file

Included from Basic tier

opschain vault store-file <node-path> --path secret-vault://<path>/<key> -f <file> [--replace]

Uploads a file and stores its content in the server's vault under a secret-vault:// URL — text files as-is, binary files Base64-encoded by the server. Everything else follows opschain vault store: the positional node path names the owner (updatable on the node's secrets path, or on /secrets), the vault refuses to overwrite an existing value unless --replace is given, and the response carries only the cipher-stacked stored value (or the not-returned placeholder on a plaintext-storing vault). Under multi-vault a provider-qualified URL (secret-vault://<provider-code>@<path>/<key>) writes through the named provider with your stored credential for it, exactly as for opschain vault store — never a silent fallback to another vault. Server-only (see opschain docs cli/vault).

Flags​

FlagMeaning
--path <url>The secret-vault://<path>/<key> URL to store under (required).
-f, --file <file>The file whose content to store (required).
--replaceOverwrite an existing value at the URL (refused otherwise).

Output​

As opschain vault store, plus the uploaded filename in the -o json / -o yaml document (path, stored, generated — always false here — and filename).

Exit codes​

CodeMeaning
0Stored.
1The file could not be read, the server refused (value exists without --replace, authorisation), or the request failed.
2Usage error (missing required flags, malformed node path).

Named errors​

  • reading the secret file: <cause> — the -f file is unreadable.
  • expected a node path like demo, demo/environments/dev, /projects/demo/environments/dev/assets/web or demo/entities/rack_1, got "<arg>" (exit 2).
  • Server refusals arrive as ERROR: results and surface verbatim (exit 1).

Examples​

opschain vault store-file demo/environments/dev --path secret-vault://ssh/deploy_key -f ~/.ssh/deploy_key

See also​

  • opschain docs cli/vault-store — store a literal value, or have the server generate one.
  • opschain learn 3.5 — secrets and vault, guided.