Bluemix and Cloud Foundry Command Line Utilities

Overview

For developers it is often handy to be able to interact with a service or application via the command line. When using Bluemix you actually have 2 utilities that you can use if you want to keep working from the terminal. 

Cloud Foundry CLI

The Cloud Foundry CLI provides a way to interact with Cloud Foundry based applications. It can be used to interact with the various Bluemix service offerings as well as providing a way to manage the organizations, spaces, and users on a Bluemix account. 
 

Installing the Cloud Foundry CLI

Visit the Cloud Foundry Releases page and download the appropriate installer for your Operating System. Once the CLI has been installed you can log in to your Bluemix account by issuing the following commands: 
    
# Set the API endpoint. In this case the US Bluemix Region
$ cf api api.ng.bluemix.net
$ cf login
 

Bluemix CLI

The Bluemix CLI provides a unified way to interact with your applications, virtual servers and containers hosted in Bluemix. The Bluemix CLI is not duplicating the command line tools from the Cloud Foundry, Docker and Openstack communities, but can utilize their underlying functionality when interacting with specific compute types. 
 

Installing the Bluemix CLI

Visit the Bluemix CLI page and download the appropriate installer for your Operating System. Once the CLI has been installed you can log in to your Bluemix account by issuing the following commands:
 
# Set the API endpoint. In this case the US Bluemix Region
$ bx api api.ng.bluemix.net
$ bx login
 

For a more in-depth introduction, see the SLDN Blog post Getting started with the Cloud Foundry and Bluemix Command Line Utilities