Pcreds

When logging into the commandline using single-sign-on, you typically need to click the copy button, open your credentials file, paste the contents in the appropriate location, and then potentially change the profile name.

pcreds is a simple commandline utility to do all of these things with one alias-able command.

pcreds:

  • Reads a credentials profile from the clipboard
  • Parses the profile name and looks up an alias in pcreds.yaml (stored in your .aws folder)
  • Parses your credentials file, updates the corresponding profile and saves an updated version

Installation

Install Go from the official website

clone this repository and build the executable. Then move it to your bin folder

git clone https://github.com/DaraDadachanji/pcreds.git
cd pcreds
go build
mv ./pcreds /usr/local/bin/pcreds

Configuration

You may create a pcreds.yaml file in ~/.aws to store aliases for your profiles

profiles:
  123456789012_My-Profile: default
  123456789012_My-Dev-Profile: usdev
  987654321098_My-Profile: euprod
  987654321098_My-Dev-Profile: eudev

The key should be the profile name generated by SSO while the value should be your preferred alias for it.

This step is optional

Usage

simply copy the value from the SSO browser window and then run pcreds in your terminal

GitHub

View Github