DSVClient is the command-line client for interacting with the Distributed
Secrets Vault gateway.
- Python 3.10 or later
- A running Distributed Secrets Vault server
curlandsh(for install/uninstall scripts)
Install directly from GitHub (works whether your login shell is bash or zsh):
curl -fsSL https://raw.githubusercontent.com/S26-Distributed-Capstone/DSVClient/main/scripts/install.sh | shTo download the script first instead of piping:
curl -fsSL https://raw.githubusercontent.com/S26-Distributed-Capstone/DSVClient/main/scripts/install.sh -o /tmp/install-dsvc.sh
sh /tmp/install-dsvc.shThe installer:
- Downloads
cli.py,client.py, andconfig.py - Installs runtime files into
~/.local/share/dsvc - Installs
dsvcinto/usr/local/bin(if writable) or~/.local/bin - Prompts for initial
base_urlandusername - Writes config to
~/.dsv_client/config.json - When installing to
~/.local/bin, adds it to your shell config (~/.zshrc,~/.bashrc, or~/.profile) if needed
If dsvc is not found after install, reload your shell config (for example source ~/.zshrc) or open a new terminal.
Run command help:
dsvc helpdsvc login <username>
dsvc logoutNotes:
- You must be logged in before running API commands.
- You must run
logoutbefore logging in as a different user.
dsvc ping
dsvc create <secretName> <secretValue>
dsvc get <secretName>
dsvc get <secretName> --all
dsvc get <secretName> --version <versionNumber>
dsvc update <secretName> <updatedValue>
dsvc delete <secretName>
dsvc env <envFile>Examples:
dsvc login alice
dsvc ping
dsvc create db-password hunter2
dsvc get db-password
dsvc get db-password --all
dsvc get db-password --version 1
dsvc update db-password new-value
dsvc delete db-password
dsvc env secrets.env
dsvc logoutThe get command supports retrieving secret versions:
dsvc get <secretName>- Retrieve the current version of a secretdsvc get <secretName> --all- Retrieve all versions of a secretdsvc get <secretName> --version <versionNumber>- Retrieve a specific version of a secret
Examples:
# Get the current version
dsvc get db-password
# Get all versions (returns a list)
dsvc get db-password --all
# Get a specific version
dsvc get db-password --version 2With no arguments, dsvc prints help and exits.
Use env to process a .env file containing secret operations:
dsvc env secrets.envExample secrets.env:
Key1=new:{val}
Key2=update:{val}
Key3=delete
Key4=get
Key5=get:{version}The server rejects files containing duplicate keys.
Use --script <file> to run commands from a file:
dsvc --script commands.txtRules:
- One command per line
- Blank lines are ignored
- Lines starting with
#are ignored
Example commands.txt:
# start session
login alice
# health check
ping
# create a secret
create db-password hunter2
# retrieve it
get db-password
# update it
update db-password new-value
# remove it
delete db-password
# end session
logout
~/.dsv_client/config.json stores:
base_url: gateway base URLusername: current logged-in username
HTTP timeout, retry, and debug behavior are hardcoded in the client with internal defaults.
From the repo root:
python3 -m unittest tests/test_cli.pyOr discover all tests under tests/:
python3 -m unittest discover -s tests -p "test_*.py"curl -fsSL https://raw.githubusercontent.com/S26-Distributed-Capstone/DSVClient/main/scripts/uninstall.sh | shThe uninstall script removes:
dsvclauncher symlink- Installed runtime directory
- Client config file (
~/.dsv_client/config.json)