A streamlined command-line interface to effortlessly manage Azure Key Vaults, powered by Azure CLI (az
). Boost your productivity with smart local caching, powerful wildcard searches, and supersmooth autocompletion. β‘οΈπ
- β Quickly list Azure Key Vaults and their secrets.
- ποΈ Local caching of Key Vault and secrets names for super-fast and offline access.
- π Advanced wildcard searching capability for vaults and secrets.
- π Integrated bash autocompletion for smooth navigation of vaults, secrets, and subcommands.
- π Safe & Secure: Secret values are NEVER cached locally!
- π Python 3.7+
- βοΈ Azure CLI
- π An authenticated Azure CLI session
git clone <your-repository-url>
cd <repository-name>
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create a global symlink for the CLI script and enable bash autocomplete support:
# Link 'akv' script globally
sudo ln -s "$(realpath akv.py)" /usr/local/bin/akv
sudo chmod +x /usr/local/bin/akv
# Enable bash-completion
sudo cp akv-completion /etc/bash_completion.d/akv-completion
# Reload completion in current shell
source /etc/bash_completion.d/akv-completion
π Note: If permissions restrict changes in
/usr/local/bin
, you may symlink to another directory in your$PATH
.
Make sure you're logged in using Azure CLI:
az login
Basic workflow examples:
# Refresh local cache (vaults only)
akv update
# Fully refresh local cache (vaults & secrets; slower)
akv update_all
# List all cached vaults
akv ls
# List cached secrets from a specific Key Vault
akv kv <keyvault-name> ls
# Display ALL secrets with their values in a Vault (requires Azure access)
akv kv <keyvault-name> show
# Display the value of a specific secret
akv kv <keyvault-name> show <secret-name>
# Add a secret to a vault
akv add <vault/secret> <value>
akv kv <keyvault-name> add <secret-name> <value>
# Edit (update) the value of a secret
akv edit <vault/secret> <new-value>
akv kv <keyvault-name> edit <secret-name> <new-value>
# Refresh secrets for 'my-keyvault' only (update cache for a specific vault)
akv kv <keyvault-name> update
akv kv <keyvault-name> sync # alias for update
akv kv <keyvault-name> pull # alias for update
# Powerful wildcard search
akv search "prod-*secret*"
# Show secrets and values from wildcard search matches
akv search "prod-*secret*" show
# List key vaults in cache
akv ls
# List secrets inside 'my-keyvault'
akv kv my-keyvault ls
# Get specific secret's value from 'my-keyvault'
akv kv my-keyvault show api-key
# Add a secret to 'my-keyvault'
akv kv my-keyvault add my-secret my-value
akv add my-keyvault/my-secret my-value
# Edit a secret in 'my-keyvault'
akv kv my-keyvault edit my-secret new-value
akv edit my-keyvault/my-secret new-value
# Refresh secrets for 'my-keyvault' only
akv kv my-keyvault update
akv kv my-keyvault sync
akv kv my-keyvault pull
# Search secrets with wildcard and show values
akv search "my-vault-*" show
Enjoy effortless command completion powered by smart caching of your Key Vaults and secrets:
- Typing
akv [TAB]
reveals all available subcommands. - Typing
akv kv [TAB]
lists all cached Key Vault names. - Typing
akv kv <keyvault-name> show [TAB]
displays all cached secret names within the selected Key Vault.
Autocomplete makes navigation even easierβgive it a try! π
Exciting features planned for future releases:
-
π Move Secrets
akv mv <vault/secret> <vault/secret>
akv kv <vault> mv <secret> <vault/secret>
-
π Copy Secrets
akv cp <vault/secret> <vault/secret>
akv kv <vault> cp <secret> <vault/secret>
-
β Delete Secrets
akv rm <vault/secret>
akv kv <vault> rm <secret>
Stay tuned for these updates to make akv
even more powerful and versatile! π
-
βΆοΈ Keep Cache Updated: Periodically refresh your cache for the latest vaults and secrets:akv update_all
-
π Stay Secure: Remember, secret values are NEVER cached locally.
-
β Authentication problems?
Ensure you've authenticated using:az login
Also confirm your Azure account has permission to list and access your key vaults.
-
π§ Symlink or file permissions issue?
Usesudo
if needed. Alternatively, create the symlink in a directory included in your$PATH
and accessible without elevated privileges.
π‘ This README is designed to help you quickly set up, utilize, and troubleshoot the
akv
CLI tool efficiently. Boost your productivity today withakv
! β‘οΈπ