Most AI projects fail. Yours doesn’t have to.
Reserve your spot today and get a production-ready Agent Blueprint in just 3 weeks
6
spots‍
‍available
Register for Your Agent Blueprint
About
Capabilities
Custom AgentsReliable RAGCustom Software DevelopmentEval Driven DevelopmentObservability
LangChainCase StudiesFocused Lab
Contact us
Back
Blog

Easily Switch AWS Profiles with Tab Completion

Tired of manually switching AWS profiles? This short bash function adds an aps command with tab completion for all your existing AWS config profiles. Just drop it in your ~/.bash_profile and go.

Feb 6, 2020

By
Austin Vance
Share:
Laptop screen showing a VS Code editor with a dark theme extension page and a coffee mug nearby

I am constantly moving between AWS profiles and wrote a bash function to help me hop between what I need.

Hopefully, someone else finds it useful

#!/bin/bash 

_getprofiles() {
    COMPREPLY=($(compgen -W "$(sed -n 's#^\[\(.*\)\]#\1#p' ~/.aws/credentials | sort -u)" -- "${COMP_WORDS[1]}"))
}


aps () {
    if [ -z "$1" ]; then
        echo $AWS_DEFAULT_PROFILE
        return
    fi
    
    export AWS_DEFAULT_PROFILE=$1
}

complete -F _getprofiles aps

Just put that function into your ~/.bash_profile or something that is sourced when a terminal session starts.

This will add the command aps and you can tab complete any of the existing profiles in your aws config.

Your message has been sent!

We’ll be in touch soon. In the mean time check out our case studies.

See all projects
/Contact Us

Let's Build better Agents Together

Modernize your legacy with Focused

Get in touch
Focused

433 W Van Buren St Suite 1100-C
Chicago, IL 60607
‍work@focused.io
‍
(708) 303-8088

‍

About
Leadership
Capabilities
Case Studies
Focused Lab
Careers
Contact
© 2026 Focused. All rights reserved.
Privacy Policy