Seven Bridges Command Line Interface

Overview

Use the Seven Bridges Command Line Interface (SB CLI) to programmatically access and automate your interaction with the Platform via the API. The CLI is called by a simple command: sb.

The Seven Bridges Command Line Interface can be installed using an automated procedure or manually, as shown below.

Automated installation for Linux and macOS

Perform an automated installation with the following command:

bash -c 'curl https://igor.sbgenomics.com/downloads/sb/install.sh -sSf | sudo -H sh'

During the installation, the script will:

  1. Download the SB binary.
  2. Install the SB binary.
  3. Enable bash completion for SB. Note that this only works with bash completion version 4, which should have been previously installed.
  4. Add man pages for SB.

During the procedure you will see information on whether each of the steps were successful or not. Upon completion, the script will inform you if SB has been successfully installed.

Manual installation for Linux, macOS, and FreeBSD

  1. Download the SB executable file for your environment:
    Linux


macOS

FreeBSD

  1. Change file permissions so you are able to run the executable (chmod +x sb).
  2. (Optional) Manually add bash completion for SB:
    a) for Linux
sb gen completion --type bash --completionfile /etc/bash_completion.d/sb.bash-completion

b) for macOS with Brew installed

sb gen completion --type bash --completionfile $(brew --prefix)/etc/bash_completion.d/sb.bash-completion
  1. (Optional) Add manual pages for SB:
sb gen man --dir `manpath | cut -d ':' -f 1`

Windows Installation

  1. Download the SB executable file for Windows:

Configure credentials

Prior to using the Seven Bridges Command Line Interface, you must enter your credentials to authenticate with the Platform. For this, you will need to know the following information:

  • The API endpoint for the Seven Bridges Platform, which you can obtain by following these steps:
    1. Click Developer in the main menu.
    2. Choose Authentication token.
    3. Find the endpoint in the API endpoint section.
  • Your authentication token.
  1. Launch the command line and enter the following:
sb configure
  1. Enter the API endpoint when prompted.
  2. Enter your authentication token.

Learn more about storing your credentials in a unified configuration file.

Specify your profiles

The Seven Bridges Command Line Interface allows you to use profiles for the credentials allowing you to access multiple user accounts. Each profile contains an endpoint and an auth token. The profiles are set up within the configuration file.

Use the following option to specify a profile:

--profile <profile_name>

Upgrade

If a new version of the Seven Bridges Command Line Interface is available, you will be notified when issuing any of the commands while using the CLI. To install the new version, just follow the procedure for installing the Seven Bridges Command Line Interface again.

Uninstall

Depending on the procedure you have followed to install the Seven Bridges Command Line Interface, you need to follow the corresponding procedure to uninstall it. If you have followed the automatic installation procedure, follow the procedure for automatic uninstallation.

In case you installed the Seven Bridges Command Line Interface manually, follow the procedure for manual uninstallation.

Automatic uninstallation

To automatically uninstall the Seven Bridges Command Line Interface, issue the following command:

bash -c 'curl https://igor.sbgenomics.com/downloads/sb/install.sh -sSf | sudo sh -s – --uninstall'

The automated procedure will be started and will perform all the necessary steps for uninstalling the Seven Bridges Command Line Interface.

Manual uninstallation

For manual uninstallation, you should reverse all the steps done during the manual installation procedure.

Troubleshooting

Using the sb troubleshoot command is an easy way to report a problem with the Seven Bridges Command Line Interface, with all relevant information included. This command generates a debug file on a specific location (on your local machine), so that you can send it to the Seven Bridges Support Team ([email protected]) along with the description of the problem. The location of the generated file is $HOME/.sevenbridges/sb/report.tar.gz and it will contain relevant information that should help Seven Bridges engineers identify the problem.

Usage:

sb troubleshoot [flags]

Flags:

  • h, --help - Help for the troubleshoot command.

Next step

Once you’ve installed and configured the Seven Bridges Command Line Interface as described above, check out our Seven Bridges Command Line Interface Reference to get started.