Sifflet CLI — Command-Line Interface

The Sifflet CLI is a tool that enables you to interact with the Sifflet application using commands in your command line shell.
With minimal configuration, you can use the Sifflet CLI to do from your terminal what you can do in the browser-based Sifflet application.

To see all available Sifflet CLI commands, see CLI Commands Reference.

Getting Started

Prerequisites

📘

Access Token

To configure your CLI, you need an Access Token. To generate one, see Access Tokens.

  • Python 3.10 or greater
  • One of these two parameters is required, depending on your type of Sifflet deployment:
    • SaaS deployments: Your Sifflet tenant name. If you access Sifflet with https://abcdef.siffletdata.com, then your tenant would be abcdef.
    • Self-hosted deployments: Your Sifflet backend URL, i.e. the full URL to the Sifflet backend on your deployment, for instance: https://sifflet-backend.mycompany.com
  • A Sifflet Access Token

Installation

Open a terminal and verify you have installed Python correctly via python -V. Ensure you have v3.10 or greater.

To avoid potential dependency version conflicts, install the Sifflet CLI via pipx (see the pipx installation guide).

pipx install sifflet

Confirm the installation with the following command:

$ sifflet --version
sifflet, version x.x.x

Upgrade

Upgrade your existing Sifflet CLI installation with the following command:

pipx install sifflet --upgrade

Configuration

Before using the Sifflet CLI, you need to set your tenant and credentials. You can do it in several ways:

  • Sifflet command line sifflet configure (which persists the configuration in a file)
  • Or with environment variables

In both cases, you need the following information:

  • <access_token>: you can find more information on how to generate it here
  • One of these two parameters is required, depending on your type of Sifflet deployment:
    • SaaS deployments: Your Sifflet <tenant_name> from the Sifflet URL https://<tenant_name>.siffletdata.com. For example, if you access the Sifflet UI with https://mycompany.siffletdata.com, the tenant's name would be mycompany.
    • Self-hosted deployments: Your Sifflet backend URL, i.e. the full URL to the Sifflet backend on your deployment, including https:// and /api, for instance: https://sifflet.mycompany.com/api

sifflet configure

You can input the tenant and credentials directly with the sifflet configure command.

  • SaaS deployments:
> sifflet configure --tenant <tenant_name>
API access token [None]: <access_token>
  • Self-hosted deployments:
> sifflet configure --backend-url <backend_url>
API access token [None]: <access_token>

sifflet configure persists the configuration in a file located at ~/.sifflet/config.ini
(or in %UserProfile%\.sifflet/config.ini on Windows).

Environment Variables

To use environment variables, you can do the following:

  • SaaS deployments:
> export SIFFLET_TENANT=<tenant_name>
> export SIFFLET_TOKEN=<access_token>
  • Self-hosted deployments:
> export SIFFLET_BACKEND_URL=<backend_url>
> export SIFFLET_TOKEN=<access_token>

You can check that the setup is done correctly with sifflet status

$ sifflet status

Sifflet version = x.x.x
Tenant = my_tenant
Tenant is up and reachable
Token expiration date = 2024-01-01 00:00:00
Token is valid with scope API
Status = OK

If you encounter any error at this step, check your tenant and token configurations.

Troubleshooting

If you see the error Unable to call Sifflet API, please check configuration., you can get more information about the connection problem by running the command sifflet --debug status. This command shows what might be configured incorrectly.

Help

The --help option is available for any command.
For instance:

sifflet --help

Or for a specific command:

sifflet rules list --help

Did this page help you?