/cli

The official command line client for Cloud Foundry

Primary LanguageGoApache License 2.0Apache-2.0

Getting Started | Download | Known Issues | Bugs/Feature Requests | Plugin Development | Contributing

CF logo

Cloud Foundry CLI

GitHub version Documentation Command help pages Slack License

Cloud Foundry CLI is the official command line client for Cloud Foundry. Latest help of each command is here (or run cf help);

Currently, there are two versions of the cf CLI in development:

  • the supported v6 cf CLI. See here for more information.
  • v7 beta cf CLI which is currently in development and will be in beta mode until it is completely backed by the v3 API. See here for more information.

Important Note: The v6 CF CLI supports as far back as CF Deployment v7.0.0, CAPI Release: 1.74.0 (APIs 2.128.0 and 3.63.0). See our Versioning Policy for more information. If you are on an older version of CF Deployment, we recommend you upgrade to a supported version.

Important Note: The v7 CF CLI beta under rapid development and as such is tested only against CC API v3 Release Candidate.

If you have any questions, ask away on the #cli channel in our Slack community and the cf-dev mailing list, or open a GitHub issue. You can follow our development progress on Core CF CLI Pivotal Tracker or v3/v7 CLI VAT Pivotal Tracker.

Getting Started

Download and install the cf CLI from the Downloads Section for either the v6 cf CLI or the v7 beta cf CLI.

Once installed, you can log in and push an app.

Example

Check out our community contributed CLI plugins to further enhance your CLI experience.

Downloads

Downloading the V6 CLI

It is recommended to download installers from the published URLs or using one of the documented package managers (APT/deb/homebrew repos). Published URLs may redirect requests to URLs that may change over time, so may installer filenames change over time.

Installing using a package manager

Mac OS X and Linux using Homebrew via the cloudfoundry tap:

brew install cloudfoundry/tap/cf-cli

Note: cf tab completion requires bash-completion to be installed properly in order to work.

Debian and Ubuntu based Linux distributions:

# ...first add the Cloud Foundry Foundation public key and package repository to your system
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
# ...then, update your local package index, then finally install the cf CLI
sudo apt-get update
sudo apt-get install cf-cli

Enterprise Linux and Fedora systems (RHEL6/CentOS6 and up):

# ...first configure the Cloud Foundry Foundation package repository
sudo wget -O /etc/yum.repos.d/cloudfoundry-cli.repo https://packages.cloudfoundry.org/fedora/cloudfoundry-cli.repo
# ...then, install the cf CLI (which will also download and add the public key to your system)
sudo yum install cf-cli

Installers and compressed binaries

Mac OS X 64 bit Windows 64 bit Linux 64 bit
Installers pkg zip rpm / deb
Binaries tgz zip tgz

Release notes, and 32 bit releases can be found here.

Download examples with curl for Mac OS X and Linux binaries

# ...download & extract Mac OS X binary
curl -L "https://packages.cloudfoundry.org/stable?release=macosx64-binary&source=github" | tar -zx
# ...or Linux 64-bit binary
curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" | tar -zx
# ...move it to /usr/local/bin or a location you know is in your $PATH
mv cf /usr/local/bin
# ...copy tab completion file on Ubuntu (takes affect after re-opening your shell)
sudo curl -o /usr/share/bash-completion/completions/cf https://raw.githubusercontent.com/cloudfoundry/cli/master/ci/installers/completion/cf
# ...and to confirm your cf CLI version
cf --version
Edge binaries

Edge binaries are not intended for wider use; they're for developers to test new features and fixes as they are 'pushed' and passed through the CI. Follow these download links for Mac OS X 64 bit, Windows 64 bit and Linux 64 bit.


Downloading the V7 beta CLI

Important Note: The v7 CF CLI beta under rapid development and as such is tested only against CC API v3 Release Candidate. Use at your own risk. See releases for more information.

Compatibility

The V7 CLI is developed and tested against CAPI release candidates. See the releases page for the minimum CAPI RC version required for each V7 beta version.

Installing using a package manager

Mac OS X and Linux using Homebrew via the cloudfoundry tap:

brew install cloudfoundry/tap/cf7-cli

Note: cf7 tab completion requires bash-completion to be installed properly in order to work.

Debian and Ubuntu based Linux distributions:

# ...first add the Cloud Foundry Foundation public key and package repository to your system
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
# ...then, update your local package index, then finally install the cf CLI
sudo apt-get update
sudo apt-get install cf7-cli

Enterprise Linux and Fedora systems (RHEL6/CentOS6 and up):

# ...first configure the Cloud Foundry Foundation package repository
sudo wget -O /etc/yum.repos.d/cloudfoundry-cli.repo https://packages.cloudfoundry.org/fedora/cloudfoundry-cli.repo
# ...then, install the cf CLI (which will also download and add the public key to your system)
sudo yum install cf7-cli

Installers and compressed binaries

Mac OS X 64 bit Windows 64 bit Linux 64 bit
Installers pkg zip rpm / deb
Binaries tgz zip tgz

Release notes, and 32 bit releases can be found here.

Download examples with curl for Mac OS X and Linux binaries

# ...download & extract Mac OS X binary
curl -L "https://packages.cloudfoundry.org/stable?release=macosx64-binary&version=v7&source=github" | tar -zx
# ...or Linux 64-bit binary
curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=v7&source=github" | tar -zx
# ...move it to /usr/local/bin or a location you know is in your $PATH
mv cf7 /usr/local/bin
# ...copy tab completion file on Ubuntu (takes affect after re-opening your shell)
sudo curl -o /usr/share/bash-completion/completions/cf7 https://raw.githubusercontent.com/cloudfoundry/cli/master/ci/installers/completion/cf7
# ...and to confirm your cf CLI version
cf7 --version
Edge binaries

Edge binaries are not intended for wider use; they're for developers to test new features and fixes as they are 'pushed' and passed through the CI. Follow these download links for Mac OS X 64 bit, Windows 64 bit and Linux 64 bit.

Known Issues

  • On Windows in Cygwin and Git Bash, interactive password prompts (in cf login) do not hide the password properly from stdout (issue #1835). Please use an alternative command (non-interactive authentication cf auth instead of cf login) to work around this. Or, use the Windows cmd command line.
  • On Windows, cf ssh may not display correctly if the TERM is not set. We've found that setting TERM to msys fixes some of these issues.
  • On Windows, cf ssh will hang when run from the MINGW32 or MINGW64 shell. A workaround is to use PowerShell instead.
  • CF CLI/GoLang do not use OpenSSL. Custom/Self Signed Certificates need to be installed in specific locations in order to login/auth without --skip-ssl-validation.
  • API tracing to terminal (using CF_TRACE=true, -v option or cf config --trace) doesn't work well with some CLI plugin commands. Trace to file works fine. On Linux, CF_TRACE=/dev/stdout works too. See this Diego-Enabler plugin issue for more information.
  • .cfignore used in cf push must be in UTF-8 encoding for CLI to interpret correctly. (issue #281)
  • On Linux, when encountering message "bash: .cf: No such file or directory", ensure that you're using the correct binary or installer for your architecture.

Filing Issues & Feature Requests

First, update to the latest cli and try the command again.

If the error remains or feature still missing, check the open issues and if not already raised please file a new issue with the requested details.

Plugin Development

The CF CLI supports external code execution via the plugins API. For more information follow:

When importing the plugin code use import "code.cloudfoundry.org/cli/plugin". Older plugins that import github.com/cloudfoundry/cli/plugin will still work as long they vendor the plugins directory.

Contributing & Build Instructions

Please read the contributors' guide

If you'd like to submit updated translations, please see the i18n README for instructions on how to submit an update.