CipherStash Docs

CLI reference

Manage secrets from the terminal with the stash CLI

CLI reference

The stash CLI is bundled with @cipherstash/stack and available after install. It reads credentials from the same CS_* environment variables used by the SDK.

Commands

Set a secret

Encrypt and store a secret:

npx stash secrets set --name DATABASE_URL --value "postgres://..." --environment production
npx stash secrets set -n DATABASE_URL -V "postgres://..." -e production

Get a secret

Retrieve and decrypt a secret:

npx stash secrets get --name DATABASE_URL --environment production
npx stash secrets get -n DATABASE_URL -e production

List secrets

List all secret names in an environment:

npx stash secrets list --environment production
npx stash secrets list -e production

Delete a secret

Delete a secret (prompts for confirmation):

npx stash secrets delete --name DATABASE_URL --environment production

Pass --yes to skip the confirmation prompt:

npx stash secrets delete --name DATABASE_URL --environment production --yes
npx stash secrets delete -n DATABASE_URL -e production -y

Command reference

CommandFlagsAliasesDescription
stash secrets set--name, --value, --environment-n, -V, -eEncrypt and store a secret
stash secrets get--name, --environment-n, -eRetrieve and decrypt a secret
stash secrets list--environment-eList all secret names in an environment
stash secrets delete--name, --environment, --yes-n, -e, -yDelete a secret

Configuration

The CLI reads credentials from environment variables:

VariableDescription
CS_WORKSPACE_CRNThe workspace identifier (CRN format)
CS_CLIENT_IDThe client identifier
CS_CLIENT_KEYClient key material used with ZeroKMS
CS_CLIENT_ACCESS_KEYAPI key for authenticating with the CipherStash API

On this page