elhaz shell¶
Synopsis¶
elhaz shell [OPTIONS]
Description¶
Spawn an interactive shell with auto-refreshed AWS credentials. elhaz sets
AWS_CREDENTIAL_PROCESS so AWS SDKs transparently fetch fresh credentials
from the daemon on every API call. Initial credentials are also exported as
environment variables for immediate use.
Shell-specific behavior:
- bash / sh
PROMPT_COMMANDis set to re-export credentials before each prompt, keepingAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, andAWS_SESSION_TOKENcurrent in the environment.- zsh
PROMPT_COMMANDis not natively supported. elhaz exports anELHAZ_PRECMDvariable containing the refresh command and prints a tip at startup. To enable automatic refresh, wire it up in your precmd hook:precmd_functions+=(elhaz_precmd) elhaz_precmd() { eval $ELHAZ_PRECMD }
Exit the shell at any time with exit to return to the original
environment.
Options¶
--name,-nNAMEConfig name. If omitted, an interactive selection prompt is shown.
--helpShow help message and exit.
Examples¶
Spawn a shell with credentials for a config:
elhaz shell -n prod
aws s3 ls
aws sts get-caller-identity
exit
Select a config interactively:
elhaz shell
See also
elhaz exec — for running a single command without opening an interactive shell.