Wrapper is a transparent configuration profile manager for any CLI binary. It allows you to manage multiple environment configurations (profiles) and seamlessly switch between them.
- π§ Universal: Works with any binary (vault, aws, kubectl, etc.)
- π Profile Management: Create, list, and switch between profiles
- π Transparent Execution: Acts as a pass-through wrapper
- πΎ Simple Storage: Profiles stored as
.envfiles - π― Smart Resolution: Automatically finds the real binary in PATH
Wrapper stores all profiles in ~/.config/wrapper/:
$HOME/.config/wrapper/
βββ aliases.bash
βββ aliases.fish
βββ aliases.zsh
βββ gcloud
β βββ current.env -> $HOME/.config/wrapper/gcloud/prod.env
β βββ dev.env
β βββ preprod.env
β βββ prod.env
βββ vault
βββ current.env -> $HOME/.config/wrapper/vault/prod.env
βββ dev.env
βββ prod.env
βββ test.env
aliases.*- Shell-specific alias files<binary>/- Directory for each wrapped binary<binary>/*.env- Profile files (KEY=VALUE format)<binary>/current.env- Symlink to the active profile
brew tap jycamier/homebrew-tap
brew install wrapperdocker run --rm ghcr.io/jycamier/wrapper:latest versionCheck out the releases page.
Imagine you have a staging and production instances of Vault. You can create a profile for each instance.
wrapper vault profile create stagingThis command creates ~/.config/wrapper/vault/staging.env. Then you can edit it to configure the environment variable
you need for your profile.
VAULT_ADDR=https://vault.example.com
VAULT_NAMESPACE=adminYou need to set the profile to use for the current session.
wrapper vault profile set staging
wrapper vault status ## Then you can calls vault status command with staging environment loaded:
wrapper vault statuswrapper aliasThis creates alias command files in ~/.config/wrapper/ for bash, zsh, and fish. These commands wrap the initial command
with the profile you set.
Here's an example of the alias.bash file:
# Wrapper aliases for Bash
# Generated by wrapper - DO NOT EDIT MANUALLY
# Regenerate with: wrapper alias
vault() { wrapper vault "$@"; }
vault profile set prodvault status
# Executes /usr/bin/vault status with prod environment# List all configured binaries
wrapper list
# Generate shell alias files
wrapper alias# List profiles (with colors and current highlighted)
wrapper <binary> profile
# Create a new profile
wrapper <binary> profile create <name>
# Set current profile
wrapper <binary> profile set <name>It's possible to create a token contextualized to a profile.
You need to create a token_helper like this one, which is
a way to customize the token storage.
So, you can create this token helper:
curl https://gist.githubusercontent.com/jycamier/0e8e03526d31a4bbcdbdaa4f48ca630e/raw/21634540afb97d0cf9e5bcd7f8ffe9c6728e6ba0/.vault-token-helper.sh > $HOME/.vault-token-helper.sh
echo "token_helper = \"$(echo $HOME)/.vault-token-helper.sh\"" >> ${HOME}/.vaultThen you can set a VAULT_ENV in your profile to stock the token in a dedicated file..
VAULT_ADDR=https://vault.staging.exemple.com
VAULT_NAMESPACE=admin
VAULT_ENV=stagingSee LICENSE file.