Interactive context-switching tool for AWS CLI and other S3-compatible clients on Windows and Linux shells.
In Windows, ensure dependencies are installed and simply place swa.cmd in PATH to use it. (recommended location: %USERPROFILE%\AppData\Local\bin).
mkdir %USERPROFILE%\AppData\Local\bin
git clone https://github.com/bruckware/swa.git
copy swa\swa.cmd "%USERPROFILE%\AppData\Local\bin\"
:: Add "%USERPROFILE%\AppData\Local\bin" to the PATH and restart running shell
swa --versionAfter ensuring about dependencies and copying swa.sh to your filesystem (recommended location: ~/.local/bin), define a shell function that invokes swa.sh using eval. This causes the script to run in a child process, and upon completion, only the required AWS environment variables are exported into the current shell session.
mkdir -p ~/.local/bin
git clone https://github.com/bruckware/swa.git
cp swa/swa.sh ~/.local/bin/swa.sh
chmod +x ~/.local/bin/swa.sh
cat >> ~/.bashrc <<'EOF'
swa() {
local out
out="$("$HOME/.local/bin/swa.sh" "$@")" || return
eval "$out"
}
EOF
source ~/.bashrc
swa --version- aws → version ≥ 2.30.3
- gum → gum (Charmbracelet) for select prompts.
- curl → included in Windows 10 (build ≥ 17063). If
curldoes not exist at%SystemRoot%\System32\curl.exe, install it via Chocolatey or Scoop package manager and updateCURL_EXEvariable inswa.cmd.
- mc → to use -i option of MinIO client
-
swadoes NOT modify the config file to switch profile.- only change that is made to the config file is when it is detemined a profile requires ca_bundle, path of newly downloaded ca_bundle is added using
aws configure set.
- only change that is made to the config file is when it is detemined a profile requires ca_bundle, path of newly downloaded ca_bundle is added using
-
swadoes NOT modify system-wide or user-wide variables table. Environment variables are only exported in the current shell session. -
swadoes NOT execute destructive commands (e.g., delete) and does not require Administrator or root privileges. It only requires the following permissions:-
Read access to AWS config file and, AWS credentials file (if present) from default paths or user-defined paths via environment variables
-
Write access to AWS config directory (for caching, runtime executables, and certificates if required by the endpoint)
-
Permission to create or update config files for of
s3cmdandmc (MinIO)in their default locations. -
Once you are certain that all requirements are already in place, you can comment out some of the checks in the requirements step. This avoids rechecking them every time you run
swaon the same system and helps speed up the script startup (for example, config and credentials file checks or tool availability checks).
-
-
EnableExtensionsis enabled by default on Windows (since NT 4.0). If it has been explicitly disabled on your system, it must be enabled before runningswa. -
ANSI escape sequences are used and a terminal that supports ANSI escape sequences is required. Native terminals of Windows 10 (build ≥ 10586) support ANSI escape sequences by default.