cf shell helper

46 views
Skip to first unread message

Daniel Mikusa

unread,
May 30, 2014, 9:58:50 AM5/30/14
to vcap...@cloudfoundry.org
Thought I'd share a little helper script that I've been using lately, in case someone else might find it helpful too.  

I often find myself switching between CF installations and wanted an easy way to do it, so I put together this shell function.


Installation is easy, just add it to ~/.profile or save the file and source it.

Usage is like this...

- Run with no arguments to list the current and available environments.
- Run with one argument, to switch to that environment.  If the environment doesn't exist, it'll be initialized when you run cf for the first time.

Behind the scenes is nothing earth shattering, it's just adjusting the CF_HOME environment variable using the pattern "$HOME/.cf-<env-name>".  

Clean up is easy.  You can delete environments by simply deleting the "$HOME/.cf-<env-name>" folder.

Dan

Tao Deng

unread,
May 30, 2014, 10:22:43 AM5/30/14
to vcap...@cloudfoundry.org
This is fantastic and the thing what I need. It took too much time to switch among multiple cf endpoints,  also very hard to memorize all those urls, accounts, passwords.

Thanks,
Tao

James Bayer

unread,
May 30, 2014, 10:47:57 AM5/30/14
to vcap...@cloudfoundry.org
daniel, this is very very useful! thanks for sharing this. i'll make sure david lee sees this as i can easily see wanting to incorporate something like this into the CLI itself.

--
You received this message because you are subscribed to the Google Groups "Cloud Foundry Developers" group.
To view this discussion on the web visit https://groups.google.com/a/cloudfoundry.org/d/msgid/vcap-dev/CADGM0_AZtP5Lj%3DwcSHyUvT5iR4UYhcHeyLZdtDQnasxvibepYA%40mail.gmail.com.

To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.



--
Thank you,

James Bayer

Wayne E. Seguin

unread,
May 30, 2014, 11:04:29 AM5/30/14
to vcap...@cloudfoundry.org
Incorporating environment switching/management into the CLI would be a welcome addition!


Reply all
Reply to author
Forward
0 new messages