Working with Secrets
Overview
Britive’s vault stores secrets such as passwords, API keys, and certificates. PyBritive lets you view and download secrets directly from your terminal without exposing them in a browser session.
What you’ll learn:
- How to list secrets available to you
- How to view a secret value in the terminal
- How to download a secret to a file
Before You Begin
- PyBritive installed and authenticated — see Getting Started
- At least one secret available in your Britive vault — see Listing Your Access
Note: Secret paths in this tutorial are from the Britive demo tenant. Use
pybritive ls secretsto find your own secret paths.
View and Download Secrets
List available secrets
List the secrets available to your identity:
pybritive ls secretsSecrets are identified by their vault path. Note the full path including the leading / — you will need it for view and download commands. For example:
/Britive Team Secrets/LearningSiteSecretNote: The path does not include the root folder shown in the Britive UI. Start the path from the first subfolder — for example, use
/Britive Team Secrets/LearningSiteSecret, not/Britive/Britive Team Secrets/LearningSiteSecret.
View a secret
Display the value of a secret in your terminal:
pybritive secret view "/Britive Team Secrets/LearningSiteSecret"The secret value is printed to stdout.
Change the output format
Use the --format flag to change how the secret is displayed:
JSON:
pybritive secret view "/Britive Team Secrets/LearningSiteSecret" --format jsonTable:
pybritive secret view "/Britive Team Secrets/LearningSiteSecret" --format tableDownload a file-type secret
The secret download command is for secrets that have a file attached — such as certificates, PEM files, or configuration files. It does not work for key-value secrets like Username/Password pairs.
Save a file-type secret to your current directory:
pybritive secret download "/Cloud Secrets/AWS CLI VM Cert"The file is saved with its original filename in the current directory.
To save to a specific location:
pybritive secret download "/Cloud Secrets/AWS CLI VM Cert" \
--file ~/secrets/aws-cli-vm-cert.pemTo print the file contents to stdout instead of saving:
pybritive secret download "/Cloud Secrets/AWS CLI VM Cert" --file -Troubleshoot
| Symptom | Cause | Fix |
|---|---|---|
Secret not found | Path typo or missing leading / | Run pybritive ls secrets and copy the exact path |
Not authenticated error | Session expired | Run pybritive login and try again |
No file found for secret | Secret is a key-value type, not a file type | Use pybritive secret view for key-value secrets |
| Downloaded file is empty | Secret has no file content | Use pybritive secret view instead of download |
Next Steps
- Check Out and Check In — request temporary credentials for cloud accounts and resources
- Approval Workflows — manage access requests for secrets that require approval