Last Updated: April 10, 2017

Command line clients provide an interface to Globus services from the shell, and are suited for both interactive use and simple scripting use cases.

This page includes information about the Globus CLI, a stand alone application that can be installed on the user’s machine and the the Globus legacy hosted CLI, which provides a restricted shell that users can log into and access the Globus transfer service.


Command Line Interface (CLI)

The Globus CLI is a standalone application that provides a command line interface to Globus services, both the Transfer and Auth services.

The Globus CLI is open source and available at https://github.com/globus/globus-cli You can always view CLI help by passing the --help flag to a command. That will show you any subcommands and options supported by that command.

Getting Started

Before you begin, you’ll need to install the Globus CLI. Installing the globus-cli python packge will provide you with the globus command. However, most CLI commands will require authentication to Globus services, so start out by getting logged in:

$ globus login
# follow instructions to get setup

You can check that you can correctly authenticate to the Globus APIs with two quick commands.

First, check that you can access Globus Auth:

$ globus get-identities 'go@globusid.org'
ID                                   | Full Name      | Username        | Organization | Email Address
------------------------------------ | -------------- | --------------- | ------------ | ------------------
c699d42e-d274-11e5-bf75-1fc5bf53bb24 | www.globus.org | go@globusid.org | Globus       | noreply@globus.org

Your output should be the same as above. If you are not authenticated, you will see a message similar to:

$ globus get-identities 'go@globusid.org'
Globus CLI Error: A GLobus API Error Occurred.
HTTP status:      401
code:             UNAUTHORIZED
message:          Call must be authenticated

Next, check that you can reach the Globus Transfer API:

# --filter-owner-id is the ID of 'go@globusid.org', fetched above
$ globus endpoint search 'Globus Tutorial Endpoint' \
    --filter-owner-id 'c699d42e-d274-11e5-bf75-1fc5bf53bb24'
Owner           | ID                                   | Display Name
--------------- | ------------------------------------ | ---------------------------
go@globusid.org | ddb59aef-6d04-11e5-ba46-22000b92c6ec | Globus Tutorial Endpoint 1
go@globusid.org | ddb59af0-6d04-11e5-ba46-22000b92c6ec | Globus Tutorial Endpoint 2
go@globusid.org | cf9bcaa5-6d04-11e5-ba46-22000b92c6ec | Globus S3 Tutorial Endpoint

If you are not authenticated, you will get an error like the following:

$ globus endpoint search 'Globus Tutorial Endpoint' \
    --filter-owner-id 'c699d42e-d274-11e5-bf75-1fc5bf53bb24'
Globus CLI Error: A Transfer API Error Occurred.
HTTP status:      401
request_id:       1AghTj1F6
code:             AuthenticationFailed
message:          Token is not active

Now we have the endpoint IDs for the tutorial endpoints, and can do a test directory listing:

$ globus ls 'ddb59aef-6d04-11e5-ba46-22000b92c6ec:/'
home
mnt
not shareable
share

Start exploring the CLI!

Use globus list-commands to see all of the commands in the CLI, and to get more detailed help for a specific information on a command, run that command with the --help flag.

Updating & Removing the CLI

Update

To update your version of the CLI to the latest:

$ globus update

Uninstall

To remove the CLI:

rm -r "$HOME/.globus-cli-virtualenv"

You should also edit your $HOME/.bashrc and remove the line that reads export PATH="$PATH:$HOME/.globus-cli-virtualenv/bin".

Globus CLI Examples

For CLI examples, see Using The CLI.

Hosted Command Line Interface (Legacy)

Last Updated: May 12, 2016

You will need an SSH key in order to access the Globus command line interface (CLI). If you don’t already have an SSH key, instructions for creating one are available here.

Once you have an SSH key, follow the directions below to associate your SSH key with your Globus account:

  1. Go to globusid.org.

  2. Sign in with your Globus ID account and select "manage SSH and X.509 keys".

  3. Click "Add a New Key".

  4. Enter a descriptive name in the "Alias" field.

  5. Select "SSH Public key" and copy & paste your public key into the "body" field. Note: On a Mac OS X or Linux/Unix system, your key is usually found in ~/.ssh/id_rsa.pub.

  6. Click "Add Key" to save.

It will take a few minutes for the SSH key to propagate through the system. You may then access the CLI by typing:

$ ssh <globus_username>@cli.globusonline.org
Welcome to globus.org, <globus_username>. Type 'help' for help.
$ _
Note:If you receive a "permission denied" error, please ensure that your key files have permissions set to read-only (e.g. on Linux/Mac, run: chmod 400 ~/.ssh/id_*)

© 2010- The University of Chicago Legal