Bluemix CLI Overview

You can manage applications in IBM Bluemix PaaS by using the Bluemix command-line interface (bx CLI) tool. To manage applications by using the bx CLI, do the following main tasks:

  1. Specify the region through the API endpoint.Set the region by using either the bx api API_URL option or by using the –a API_URL option to the login command where API_URL is the API endpoint of the region that you want to log in to.
  2. Log in to an organization and space by using the bx command.Use the following command syntax for the bx login command:

    bx login [-a API_URL] [-u USERNAME] [-p PASSWORD] [-o ORG] [-s SPACE]

    • API_URL is the API endpoint of the region that you want to log in to.
    • USERNAME is the user.
    • PASSWORD is the specified user’s password.
    • ORG is the organization name.
    • SPACE is the space name.

    Any needed argument that’s not provided on the command line will be prompted. For example, you might provide the password interactively at the terminal by omitting the –p option on the command line.

  3. Push an application by using the bx command and provide applicable options.Use the following command and syntax to push an application:

    bx app push [APP] [-b URL] [-c COMMAND] [-d DOMAIN] [-i NUM_INSTANCES] [-m MEMORY] [-n HOST] [-p PATH] [-s STACK] [--no-hostname] [--no-route] [--no-start]

    APP is the application name, if not specified, the entry from the application manifest file will be used.

    Run this command from the top-level directory that contains the application and a copy of the manifest.yml file.

    Some common options for the push command:

    • -c to specify a startup command.
    • -i to specify number of instances at startup.
    • -m to specify the memory that is used by the application instance at startup.
    • --no-route to prevent connecting a route to the application.
  4. View logging information by using the bx command.To view logs from an application, run this command:

    bx app logs APP [--recent]

    APP is the application name.

    When you specify the --recent option, the most recent log history is sent to the terminal and the command ends. If you don’t use this option, the command streams log output to the terminal.

  5. View the Bluemix catalog using bx command.You can use the bx service offerings command to list all services available from the Bluemix catalog for the currently signed in user, organization, and region.

Related links

Bluemix CLI reference