The idea started as those annoyances switching between projects, github and AWS accounts I kept working around.
I often switch between different identities for projects and customer environments, and eventually got tired of managing the context around all of that manually. After years of trying to work around it with zsh, oh-my-zsh and a bunch of helper functions, I decided to build something instead.
I called hats. It's an open-source CLI tool, and it's usable today. Although I admit, there's still plenty of room to improve it.
It's nothing revolutionary, but I thought it might be useful to other engineers juggling multiple projects and environments.
A quick hat <profilename> completely changes identities in that single terminal.
hat normal
In this example, I'm switching between a personal and work 'hats'.

I'd be interested to hear how other people handle this kind of thing, or whether there's something obvious I've missed.
The code is here: https://github.com/planesailingio/hats
I also wrote a bit more about the original problem and why I decided to build it on Medium, if you're interested:
https://medium.com/@rhysjtevans/i-wear-a-lot-of-hats-my-terminal-only-had-one-5fee560a83f6
Top comments (0)