Install and configure the Sigma CLI
To use the Sigma CLI, you must install it on your machine. After installation, you can configure authentication, profiles, and more to manage your usage of the Sigma REST API.
SigCLI is an external command line interface tool, the use of which is governed by the CLI license ("SigCLI License”). Review the Sigma CLI Notice before connecting SigCLI with your Sigma organization.
System and user requirements
Installing the Sigma CLI requires the following:
- A compatible macOS, Linux, or Windows operating system
- Internet access
- To install the Sigma CLI using Homebrew, you must install Homebrew
- To generate API client credentials, you must be assigned the Admin account type
- To authenticate a profile for the Sigma CLI with OAuth, you must be assigned an account type with the Use Sigma API with OAuth permission enabled
Install the Sigma CLI
You can install the Sigma CLI using the provided shell installer or using Homebrew.
Shell installer
The Sigma CLI shell installer downloads and installs the latest release binary for your platform.
To install the Sigma CLI using the shell installer, run the following command:
curl --proto '=https' --tlsv1.2 -LsSf https://assets.sigmacomputing.com/sigcli/releases/latest/sigcli-installer.sh | shThe binary installs to ~/.sigcli/bin/sigcli.
To install a specific version instead of the latest, download the installer for that version and operating system from the releases page.
Homebrew
To install the Sigma CLI using Homebrew, run the following command:
brew install sigmacomputing/tap/sigcliThe binary installs to the Homebrew bin/ directory and is automatically added to your PATH.
Add the Sigma CLI to your PATH
If the Sigma CLI is not automatically added to your PATH after installation, you can add the install directory to your shell profile manually:
-
In your shell profile (
~/.zshrcfor Zsh or~/.bashrcfor Bash), add the following:export PATH="$HOME/.sigcli/bin:$PATH" -
After saving the file, restart your shell.
The Sigma CLI becomes available in your shell session as sigcli.
Verify installation
To confirm the Sigma CLI is installed and accessible, run the following command:
sigcli --versionIf the command returns a version number, such as 0.1.1, the Sigma CLI is installed.
Configure a profile in the Sigma CLI
To manage multiple sets of credentials, such as when separating production and staging access, you can configure profiles in the Sigma CLI using either OAuth or API client credentials.
Configure a profile using OAuth
To configure a profile for the Sigma CLI using OAuth, create a profile and log in to your Sigma organization:
-
Run the login command:
sigcli auth login -
Select Create new profile.
-
For Authentication method, select OAuth.
-
Enter the URL for your Sigma organization. For example,
https://app.sigmacomputing.com/example-organization. -
Enter a name for the new profile. For example,
staging. -
A new browser tab opens, prompting you to sign in to your Sigma organization. Sign in, then return to the terminal.
The profile is created in the Sigma CLI. You can authenticate to the Sigma REST API using the credentials securely stored in the profile.
To run Sigma CLI commands using the credentials stored in a profile, add -p <profile-name> to the command. For example, to check the authentication status of the staging profile, run the following command:
sigcli -p staging auth statusConfigure a profile using API client credentials
To configure a profile for the Sigma CLI using Sigma REST API client credentials, create a profile and add your credentials to it:
-
Identify the base URL for your Sigma organization and generate client credentials by following the steps in Generate client credentials.
-
Run the login command:
sigcli auth login -
Select Create new profile.
-
For Authentication method, select API key.
-
Enter a name for the new profile. For example,
staging. -
Select the API base URL you identified in step 1.
-
Enter the credentials you generated in step 1.
The profile is created in the Sigma CLI. You can authenticate to the Sigma REST API using the credentials securely stored in the profile.
To run Sigma CLI commands using the credentials stored in a profile, add -p <profile-name> to the command. For example, to check the authentication status of the staging profile, run the following command:
sigcli -p staging auth statusVerify authentication and user
After configuring multiple profiles and credentials in the Sigma CLI, you can verify authentication and identity details using the following commands:
To check the status of your current credentials, run the following command:
sigcli auth statusTo print the current bearer token, run the following command:
sigcli auth tokenTo confirm which user is authenticated, run the following command:
sigcli api whoami get