Transfer AWS SSO session credentials between machines. Useful when you need valid AWS credentials on a machine that doesn't have SSO configured (e.g., CI runners, dev VMs, or remote workstations).
- Export on your SSO-authenticated machine — resolves temporary credentials and saves them to a JSON file
- Transfer the file to the target machine (scp, USB, etc.)
- Import on the target machine — writes the credentials into
~/.aws/credentialsand region into~/.aws/config
make buildProduces a pac binary. Copy it to both machines.
# Ensure you're logged in
aws sso login --profile my-profile
# Export credentials
pac export --profile my-profile --output aws-creds.json# Import under the same profile name
pac import --file aws-creds.json
# Or override the profile name
pac import --file aws-creds.json --profile custom-name| Command | Flag | Description |
|---|---|---|
export |
-p, --profile |
AWS SSO profile name (required) |
export |
-o, --output |
Output file path (default aws-creds.json) |
import |
-f, --file |
Path to credentials JSON file (required) |
import |
-p, --profile |
Override target profile name |
The exported JSON contains:
{
"access_key_id": "ASIA...",
"secret_access_key": "...",
"session_token": "...",
"expiration": "2026-04-23T18:00:00Z",
"region": "eu-central-1",
"profile_name": "my-profile"
}Treat this file as a secret. It is written with 0600 permissions.
# Linux target
GOOS=linux GOARCH=amd64 go build -o pac-linux .
# macOS ARM
GOOS=darwin GOARCH=arm64 go build -o pac-darwin .