Command Line Interface (CLI)
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.
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 'firstname.lastname@example.org' ID | Full Name | Username | Organization | Email Address ------------------------------------ | -------------- | --------------- | ------------ | ------------------ c699d42e-d274-11e5-bf75-1fc5bf53bb24 | www.globus.org | email@example.com | Globus | firstname.lastname@example.org
Your output should be the same as above. If you are not authenticated, you will see a message similar to:
$ globus get-identities 'email@example.com' 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 'firstname.lastname@example.org', fetched above $ globus endpoint search 'Globus Tutorial Endpoint' \ --filter-owner-id 'c699d42e-d274-11e5-bf75-1fc5bf53bb24' Owner | ID | Display Name --------------- | ------------------------------------ | --------------------------- email@example.com | ddb59aef-6d04-11e5-ba46-22000b92c6ec | Globus Tutorial Endpoint 1 firstname.lastname@example.org | ddb59af0-6d04-11e5-ba46-22000b92c6ec | Globus Tutorial Endpoint 2 email@example.com | 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!
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
Updating & Removing the CLI
To update your version of the CLI to the latest:
$ globus update
To remove the CLI:
rm -r "$HOME/.globus-cli-virtualenv"
You should also edit your
$HOME/.bashrc and remove the line that reads
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:
Go to globusid.org.
Sign in with your Globus ID account and select "manage SSH and X.509 keys".
Click "Add a New Key".
Enter a descriptive name in the "Alias" field.
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.
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. $ _
chmod 400 ~/.ssh/id_*)