Skip to content

Repository files navigation

Mac Cloud Manager

A lightweight zsh plugin for macOS that gives you fast context switching between AWS, Azure, GCP and Kubernetes, plus an optional right-hand prompt showing your active cloud/context.

Features

  • awsprofile, azprofile, gcpprofile, kubecontext — fzf-based interactive selectors for AWS profiles, Azure subscriptions, GCloud configurations, and Kubernetes contexts.
  • mcm — a single CLI to configure everything (which prompt blocks are shown, their colors, login shortcuts, status).
  • Right prompt segments per provider, each independently toggleable and colorable.
  • Git branch segment in the left prompt.
  • Handy aliases: k, kgp, tf, tfi, tff, tfv, tfp, tfa.

Requirements

  • zsh
  • fzf for the interactive selectors
  • Whichever CLIs you actually use: aws, az, gcloud, kubectl

Install

Clone this repo anywhere on your filesystem — it stays in place, nothing gets copied elsewhere. Then run the one setup script:

git clone https://github.com/cloudsteak/mac-cloud-manager.git ~/wherever/you/want
cd~/wherever/you/want
./setup.sh

setup.sh:

  • detects any previous cloud-tooling setup already sourced from ~/.zshrc that would conflict with mac-cloud-manager (e.g. an old script defining gcplogin, kubecontext, etc.) and offers to disable just that source line (the old file is left on disk, untouched)
  • adds a single source "<this-clone>/mac-cloud-manager.plugin.zsh" line to your ~/.zshrc, pointing at wherever you cloned it
  • checks for required tools (zsh, fzf) and offers to install anything missing via Homebrew
  • can be run again any time — it detects whether it's already wired up and offers to check dependencies again or uninstall

Since the .zshrc line points directly at the clone, moving/renaming the clone means re-running ./setup.sh from the new location (or editing the line by hand).

Manual install

If you'd rather not run setup.sh (e.g. you manage dotfiles yourself), just add this one line to ~/.zshrc:

source /path/to/mac-cloud-manager/mac-cloud-manager.plugin.zsh

Configuration

All configuration lives inside the clone itself, in config.zsh — it travels with the clone and is git-ignored, so it's safe to edit directly.

cp config.zsh.example config.zsh # or let `mcm` create it for you
mcm edit # opens config.zsh in $EDITOR

It controls which prompt blocks are visible and their colors:

# config.zsh
PROMPT_SHOW_AWS=0
PROMPT_SHOW_AZ=0
PROMPT_SHOW_GCP=1
PROMPT_SHOW_K8S=1
MCM_COLORS[gcp]="#4285f4"
MCM_COLORS[k8s]="#32cd32"

You normally don't need to edit it by hand — mcm prompt and mcm color (see below) update it for you.

Usage

mcm help# show all commands
mcm status # show which prompt blocks are active
mcm prompt -gcp -k8s # only show GCP and K8s blocks
mcm prompt -aws -az -gcp -k8s # show all
mcm prompt -none # hide all
mcm color gcp "#34a853"# customize a block's color
mcm selectgcp# same as running gcpprofile
mcm login gcp # same as running gcplogin (gcloud auth login)
mcm config # print path to the config file
mcm edit # open config.zsh in $EDITOR

Uninstall

cd /path/to/your/clone
./setup.sh
# choose "Uninstall" from the menu

This only removes the source line from ~/.zshrc; the clone itself (and its config) is left in place unless you confirm deleting the config.

Project layout

setup.sh single entry point: install / check deps / uninstall
mac-cloud-manager.plugin.zsh entry point sourced by .zshrc
config.zsh.example template for local config
config.zsh your local config (git-ignored, created on demand)
lib/
core.zsh config load/save
aws.zsh AWS selector + prompt segment
azure.zsh Azure selector + prompt segment
gcp.zsh GCP selector + prompt segment + gcplogin
k8s.zsh Kubernetes context selector + prompt segment
aliases.zsh convenience aliases
mcm.zsh the mcm CLI
prompt.zsh PROMPT/RPROMPT assembly, vcs_info

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages