Skip to content
SHC Docs

shc vault

Set a secret. Both the key and the value are positional and both are required. There is no --generate; secrets that SHC mints for you are requested from an app’s vars.yaml with ref+vault://<key>?autogen:

Terminal window
shc vault set db_password mypassword123
shc vault set api_key secret123 --scope global
shc vault set admin_password s3cure! --scope tenant

Retrieve a secret:

Terminal window
shc vault get db_password
shc vault get db_password --stack myapp
shc vault get db_password --stack myapp --environment prod

get takes no --scope: you do not name a tier, you name a context with -s/--stack and -e/--environment, and resolution cascades from most precise (deployment) to least precise (global). --scope is a write and filter flag: it exists on set, rm and ls.

Check if a secret exists. Like get, it takes a context rather than a --scope:

Terminal window
shc vault exists db_password
shc vault exists db_password --stack myapp

List secrets:

Terminal window
shc vault ls
shc vault ls --scope tenant
shc vault ls --output json

Remove a secret:

Terminal window
shc vault rm old_password -y
shc vault rm temp_key --scope deployment -y
shc vault rm old_password --scope global -y