Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudSelect

An interactive CLI utility written in Go to select an OpenStack cloud from your clouds.yaml and automatically export it to your shell environment.


🚀 Features

  • Parses ~/.config/openstack/clouds.yaml
  • Interactive cloud selection using promptui
  • Outputs export OS_CLOUD=<selected> to stdout
  • Updates .zshrc with the selected cloud
  • Works on macOS and Linux

📦 Installation

git clone https://github.com/m-mansoorali/cloudselect.git
cd cloudselect
go build -o cloudselect

🧪 Usage

./cloudselect
eval $(./cloudselect 2>/dev/null | grep "^export OS_CLOUD")

Or open a new terminal after sourcing .zshrc

Or the best way to run this is by creating a function in .zshrc or .bashrc and call the script

cloudselect() {
  cd /<path>/cloudselect && ./cloudselect "$@"
  source ~/.zshrc
}

source the file once and now you can call the script cloudselect from anywhere. No need to source it again ever


🛠 Dependencies

• Go 1.20+ • promptui • yaml.v3


📂 Example Output

Select Cloud Name:
    dev
    staging
    prod

export OS_CLOUD=dev
Updated ~/.zshrc: export OS_CLOUD="dev"
Run 'source ~/.zshrc' or open a new terminal to apply changes.

About

An interactive CLI utility written in Go to select an OpenStack cloud from your clouds.yaml and automatically export it to your shell environment.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages