The Svix CLI is one of the fastest ways to interact with our API, which is especially useful during development.
With the Svix CLI you can interact with our API, validate webhook payloads, quickly open our docs, and much more.
In this tutorial, we will learn how to install the Svix CLI and use it to send your first webhook message!
This tutorial assumes you have already familiar with the Svix service. If this is your first time using Svix, we recommend you first check out our quickstart documentaion.
To install the Svix CLI with Homebrew, run:
To install the Svix CLI with Scoop, run:
To install the Svix CLI on macOS without Homebrew:
Download the latest Darwin tar.gz file from https://github.com/svix/svix-cli/releases/latest
Extract the file:
tar -xvf svix_X.X.X_Darwin_x86_64.tar.gz
Optionally, install the binary in a location where you can execute it globally (e.g., /usr/local/bin).
To install the Svix CLI on Linux without a package manager:
Download the latest Linux tar.gz file from https://github.com/svix/svix-cli/releases/latest
Extract the file:
tar -xvf svix_X.X.X_Linux_x86_64.tar.gz
Run the executable:
To install the Svix CLI on Windows without Scoop:
Download the latest Windows tar.gz file from https://github.com/svix/svix-cli/releases/latest
After installing the Svix CLI, you must authenticate with your Svix account before you can start running commands.
To do so, simply set your Svix Auth Token to the
SVIX_AUTH_TOKEN env variable:
- On macOS and Linux:
- On Windows via command prompt:
- On Windows via PowerShell:
$env:SVIX_AUTH_TOKEN = '<MY-AUTH-TOKEN>'
You’re now ready to use the Svix CLI. To get started let's create a new application.
Each Svix CLI command accepts raw JSON input as either the first positional argument or piped via
We can create an application with the
application create command:
API commands also include convenience flags for common values to make it easier when hand crafting commands.
For example, the same application could have been created using the
This command creates a new application on Svix and returns the raw application object as JSON.
Now that we've created an app we can list our existing apps with the following command:
The list command by default returns the first 50 applications, you can change this limit by adding the
Next let's add an endpoint to the application we created above. The create command should have returned an Application ID. Since the application name is not unique, we will need its ID to make changes.
Let's add a webhook endpoint with the url
http://example.com/webhook. Every endpoint must have a version associated with it
to help you version your webhook API. For this example we will set the version to
Now that we have an application created and an endpoint configured to listen to messages from that app, we are ready to send our first
webhook message! Let's send a
user.created event with the user's username and email.
This message will now be sent to Svix and dispatched to all webhook endpoints listening to your application.
The Svix CLI has commands to interact with every part of the Svix API.
To get a complete list of commands, run
Since each command accepts raw JSON input piped over
stdin, you can chain Svix CLI commands together with other command line tools (like the popular JSON parser
jq) to create powerful snippets to improve your workflow.
For example, to automatically open the dashboard for the app we created in step 3, on macOS you can run the following command:
With a slight modification, we can convert this one-liner to a shell function:
Which you can run like so: