This tutorial shows how to install the ZebraStream CLI and getting it functional for managing your access tokens.

Signup

If not already done so, sign up to get an account and log in.

Generate a Management API Key

ZebraStream provides two different APIs to operate, one for managing streams and stream permissions, and one for transferring data via stream addresses. At first, you need to create a Management API key to access the Management API.

Once logged in, go to the internal dashboard.

Next, click 'Reset API key' to generate a key. Copy it somewhere, it must be kept private and will not be shown again.

Prepare zebrastream-cli

ZebraStream comes with an open-source reference CLI that uses the ZebraStream Management API. While you can get the same functionality using the HTTP client of your choice (e.g. curl), we recommend to stick to our CLI for convenience and best alignment with the API evolution. If you run into issues, make sure to update it to the latest version.

Being a Python application, you should use pipx (recommended global install) or pip to install it on your OS:

pipx install zebrastream-cli

Once installed, you can run the CLI:

zebrastream-cli --help

We recommend saving the API key to the program configuration. Make sure to copy the API key secret and not the API key ID (which starts with key_):

ZEBRASTREAM_API_KEY=your_api_key_here zebrastream-cli persist-config

Then test the CLI:

zebrastream-cli list-tokens
zebrastream-cli show-usage

If the output no error, you are fine. Your current usage should also be at zero.