Stream Machine CLI reference

The Stream Machine CLI (strm) is the primary tool for managing your Stream Machine resources.

The CLI follows the same structure as many other popular CLI tools, like kubectl. This is visible in the following way:

Principles

Verbs first

Most commands in the CLI start with a verb, and then a noun, for example: create stream.

The currently supported verbs are:

  • create: Create a new resource. An error is returned if the resource already exists

  • update: Update an existing resource. An error is returned if the resource does not exist.

  • delete: Delete an existing resource. An error is returned if the resource does not exist.

  • list: List resources of a given type, with optional filters. An empty list is returned if nothing is found.

  • get: Get a resource by its primary key (usually a "name" or "ref" attribute). An error is returned if the resource does not exist.

Sensible defaults

Not every attribute needs to be specified when creating resources, so typically only one or two options are needed to create a resource.

Global commands

The following commands that are not directly tied to a resource are available in the CLI:

  • help: The general help page.

  • version: Displays the current version and build information.

  • auth: Various authentication commands for the CLI.

  • completion: generates completions for a given terminal (bash, zsh, fish, PowerShell)

  • sim: Runs a simulation with random events on a given stream.

  • egress: Connects to the egress Web Socket endpoint to listen for events.

Global flags

Flag Description

--api-auth-url string

Auth URL for user logins (default "https://api.streammachine.io/v1")

--api-host string

API host name (default "apis.streammachine.io:443")

--config-path string

config path (default is $HOME/.config/stream-machine/)

--egress string

Websocket to receive events from (default "wss://out.strm.services/ws").

--event-auth-host string

Security Token Service for events (default "auth.strm.services")

--events-gateway string

Endpoint to send events to (default "https://in.strm.services/event")

--help

Displays the help page

--recursive

Available on many list, get and delete commands. Displays the dependents of an entity in the case of list and get .Deletes the entity along with its dependents in the case of delete.

--save

Available on many create commands. Saves the entity details to a JSON file in the config directory.

--token-file string

config file (default is $HOME/.config/stream-machine/strm-creds-<api-auth-host>.json)

Entities

The following entities are available in the CLI:

  • batch-exporter

  • event-contract

  • kafka-cluster

  • kafka-exporter

  • kafka-user

  • key-stream

  • schema

  • sink

  • stream