Skip to content

Command line

streamview COMMAND [OPTIONS]
Command What it shows
streamview demo A mock order system that makes events continuously.
streamview day One full day of mock data. This view is not live.
streamview kafka Kafka topics.
streamview nats NATS subjects and JetStream streams.
streamview rabbitmq RabbitMQ exchanges.
streamview webhooks The webhooks that other services send to the server.
streamview serve Events from a file, from standard input, or from HTTP.
streamview mock Nothing. It prints mock events.
streamview docs Nothing. It prints this documentation.
streamview update Nothing. It gets the latest version.

streamview with no command prints a summary of the commands. streamview --help and streamview -h print the same summary.

streamview COMMAND --help and streamview help COMMAND print the help for one command. For kafka, nats, and rabbitmq, the help shows all options of the adapter. streamview mock --help does not print events.

An unknown command stops with an error and the exit code 2. If the name is near the name of a command, the error gives that command. For example, streamview sreve gives streamview serve.

streamview --version and streamview -V print the version.

These options work with day, demo, kafka, nats, rabbitmq, webhooks, and serve.

Option Default What it does
--port N 4747 Gives the port of the page.
--host ADDR 127.0.0.1 Gives the address that the server listens on. With 127.0.0.1, only the same computer can connect.
--open Opens the browser.
--no-open Does not open the browser.

If there is no --host option, the server uses the STREAMVIEW_HOST environment variable.

demo, kafka, nats, rabbitmq, and webhooks open the browser automatically, if the host is 127.0.0.1. streamview and serve open the browser only with --open. The server opens the browser with open on macOS, and with xdg-open on other systems. If the server cannot open a browser, it prints cannot open a browser here and the address of the page.

Options for demo, kafka, nats, rabbitmq, webhooks, and serve

Section titled “Options for demo, kafka, nats, rabbitmq, webhooks, and serve”
Option Default What it does
--keep SECONDS 0 Deletes events that are older than this number of seconds, by event time. With 0, the server keeps all events.
--read-only Refuses new events from HTTP, and refuses changes to sets, colors, pins, and notes. The page keeps those in the browser.
--icon VALUE Gives an icon to each lane whose events do not ask for one. The value is an emoji, an image file, the address of an image, or the name of an icon of the page. An image file is svg, png, jpg, gif, webp, or ico, and approximately 44 KB or smaller. See The icon of a lane.
--no-index Does not keep the index of all values. The page can then filter only on the fields that have few different values. See Limits.

Shows one full day of mock data, approximately 5 million events. The browser makes the data. The view is not live.

The server does not store data, and it has no POST /events endpoint in this mode.

Shows a mock order system that makes events continuously. The demo starts with the events of the last 15 minutes. The demo keeps its events in a temporary file, and does not load them again at the next start.

Option Default What it does
--rate N 5 Gives the number of orders for each second.
--public Makes the demo applicable for a public server. See below.

--public changes three defaults:

  • It sets --read-only.
  • It sets --keep to 3600.
  • It sets --host to 0.0.0.0.

Reads Kafka topics. This command needs Node.js. The first time, it installs the Kafka adapter in the cache directory of the user.

Option Default What it does
--brokers HOST:PORT[,...] localhost:9092 Gives the broker addresses, with a comma between them.
--topics REGEX ^[^_] Gives a regular expression. streamview reads only the topics that match. The default matches all topics that do not start with _.
--include-internal Also reads internal topics: _schemas, and topics with a name that starts with __. Without this option, streamview does not read them, also when --topics matches them.
--latest Reads only new messages. Without this option, streamview reads all stored messages first.
--group NAME A new name for each start Gives the name of the consumer group. The default name is streamview- and eight random characters. If a group with this name read before, streamview continues from the position where that group stopped.
--tls Encrypts the connection to the broker.
--ca FILE The certificate authorities of the computer Gives the certificate authority of the broker, as a PEM file. This option also turns on --tls.
--cert FILE and --key FILE Give a client certificate and its key, as PEM files, for a broker that asks for one. These options also turn on --tls.
--tls-no-verify Does not check the certificate of the broker. This option is for tests only. It also turns on --tls.
--user NAME The value of STREAMVIEW_KAFKA_USER Gives the user name, or the API key, for the login (SASL).
--password TEXT The value of STREAMVIEW_KAFKA_PASSWORD Gives the password, or the API secret, for the login.
--mechanism NAME plain Gives the login mechanism: plain, scram-sha-256, or scram-sha-512.
--correlation-field NAME Gives the field that connects messages that are not CloudEvents, for example orderId.
--correlation-key Uses the key of a message as its correlation ID. This applies to a message that is not a CloudEvent and has no other correlation ID.
--type-prefix TEXT Gives the text to put before the topic name, to make the event type.
--db PATH streamview.db Gives the SQLite file.
--prepare Installs the Kafka adapter and stops. Use it when you build a container image.

The adapter looks for new topics continuously.

--user and --password go together. If one of them is missing, the command stops. With --user and without TLS, the command prints a warning, because the password is not encrypted on the network.

If the broker refuses the login or the certificate, the command prints the cause, and the adapter stops. The page stays open.

If the first 200 messages have no correlation ID, the command prints one line in the terminal. The line gives the two options that connect messages.

Reads NATS subjects and JetStream streams. This command needs Node.js. The first time, it installs the NATS adapter in the cache directory of the user.

Option Default What it does
--servers HOST:PORT[,...] localhost:4222 Gives the server addresses, with a comma between them.
--subjects SUBJECT[,...] > Gives the subjects to read, with a comma between them. > is all subjects.
--depth N 0 Gives the number of subject parts that make the event type. With 0, the full subject is the event type.
--latest Reads only new messages from streams. Without this option, streamview reads each stream from its first message.
--no-jetstream Does not read streams. streamview subscribes to all subjects instead.
--correlation-field NAME Gives the field that connects messages that are not CloudEvents, for example orderId.
--type-prefix TEXT Gives the text to put before the subject, to make the event type.
--user NAME and --password TEXT Give the name and the password for the server.
--token TEXT Gives the token for the server.
--creds FILE Gives the path of a credentials file.
--db PATH streamview.db Gives the SQLite file.
--prepare Installs the NATS adapter and stops. Use it when you build a container image.

The adapter looks for new streams at intervals of 5 seconds.

Reads RabbitMQ exchanges. This command needs Node.js. The first time, it installs the RabbitMQ adapter in the cache directory of the user.

The adapter makes a temporary queue of its own, and connects it to the exchanges. It does not read the queues of other programs. It shows only the messages that come after it starts.

Option Default What it does
--url URL amqp://localhost Gives the address of the server. The address can contain the user, the password, and the virtual host: amqp://user:password@host:5672/vhost. The default user and password are guest. Use amqps:// for TLS.
--exchanges NAME[,...] All exchanges, but not those with a name that starts with amq. Gives the exchanges to read, with a comma between them.
--routing-keys KEY[,...] Gives more routing keys to read on direct exchanges, with a comma between them.
--management URL http://HOST:15672 Gives the address of the management API. The adapter uses it to find the exchanges, their kinds, and the routing keys of direct exchanges.
--no-management Does not use the management API. You must then give --exchanges.
--trace Reads the tracer of RabbitMQ, and not the exchanges. The tracer gives each published message, also a message that goes directly to a queue. The tracer must be on: rabbitmqctl trace_on.
--depth N 0 Gives the number of routing key parts that make the event type. With 0, the full routing key is the event type.
--correlation-field NAME Gives the field that connects messages that are not CloudEvents, for example orderId.
--type-prefix TEXT Gives the text to put before the routing key, to make the event type.
--db PATH streamview.db Gives the SQLite file.
--prepare Installs the RabbitMQ adapter and stops. Use it when you build a container image.

How the adapter reads each kind of exchange:

Kind What the adapter does
Topic Asks for all routing keys.
Fanout Gets all messages.
Headers Gets all messages.
Direct Asks for each routing key that a queue of a different program uses, and each key from --routing-keys.

The queue of the adapter keeps a maximum of 100,000 messages. If the adapter is too slow, RabbitMQ deletes the oldest messages of this queue. The adapter looks for new exchanges and routing keys at intervals of 10 seconds. If the connection closes, the adapter connects again.

streamview webhooks [OPTIONS]

Starts a server that accepts webhooks at POST /webhooks/NAME, and makes one event from each webhook. See POST /webhooks/NAME and Events from webhooks.

This command does not need Node.js. It also accepts events at POST /events.

Option Default What it does
--correlation-field NAME[,NAME] Gives the fields of the body that have the correlation ID. A period goes into an object: data.object.id. The server uses the first field that the body has.
--db PATH streamview.db Gives the SQLite file.

The other commands that store events also accept webhooks: demo, kafka, nats, rabbitmq, and serve. With these commands, --correlation-field applies to the webhooks also.

streamview serve [FILE|-] [OPTIONS]

Reads events from FILE, with one JSON object on each line. With -, it reads from standard input. With or without a file, it also accepts events at POST /events and webhooks at POST /webhooks/NAME.

A JSON object can be a CloudEvent or a plain JSON record. The server makes an event from each plain JSON record. See Events from plain JSON records. The input can be a gzip file, or two or more gzip files one after the other.

Option Default What it does
--type-field NAME[,NAME] Gives the fields of a plain JSON record that have the event type. The server uses the first field that the record has.
--type TEXT Gives one event type to all plain JSON records.
--time-field NAME[,NAME] Gives the fields of a plain JSON record that have the time. The server uses the first field that it can read.
--correlation-field NAME[,NAME] Gives the fields of a plain JSON record that have the correlation ID. It applies to webhooks also.
--icon-field NAME[,NAME] Gives the fields of a plain JSON record that have the icon of its lane. See The icon of a lane.
--sort Holds all events until the end of the input, and then puts them in time sequence. Use it for an input that is not in time sequence.
--db PATH streamview.db Gives the SQLite file.

In a field name, a period goes into an object: metadata.timestamp. The field options apply to FILE, to standard input, and to POST /events.

With --sort, the page shows no events until the input ends. Do not use it with a program that does not stop.

streamview mock [--rate N] [--backfill SECONDS] [--once]

Prints the events of a mock order system to standard output, with one event on each line. It does not start a server.

Option Default What it does
--rate N 5 Gives the number of orders for each second.
--backfill SECONDS 600 Gives the number of seconds of old events to print first.
--once Stops the command after it prints the old events.

The mock order system makes two faults in each interval of ten minutes: a bad release and a payment outage.

streamview docs [NAME | --all | --search TEXT]

Prints the documentation as Markdown. The documentation is in the program, so the command needs no network. It is the documentation of the version that you have. The website has the documentation of the latest version.

Command What it prints
streamview docs The list of all pages, with the name of each page.
streamview docs NAME One page. A part of the name is sufficient if only one page has it, for example streamview docs kafka-system.
streamview docs --all All pages, one after the other.
streamview docs --search TEXT The lines that contain the text, with the name of their page. It shows a maximum of 8 lines for each page.

The pages do not have the pictures and the diagrams of the website. A link to a different page shows as the command that prints that page.

An AI agent can read the documentation with these commands, and does not need the website. A server in operation gives the same text over HTTP. See HTTP endpoints.

Gets the latest version of streamview, and puts it in the place of the program that runs.

The command has no options. It needs curl and a network connection.

  • If you have the latest version, the command tells you and changes nothing.
  • If there is a newer version, the command downloads the install script of that version and runs it. The script checks the download.
  • In a container, the command does not update. Pull the image again.

The commands that show a page do this check when they start. The mock and update commands do not.

  • streamview asks GitHub for the number of the latest version. It asks one time in 24 hours at most.
  • The request is a GET request for the address of the latest release. streamview does not send data about your computer or your events.
  • GitHub sees your IP address, as each server does for each request.
  • streamview keeps the answer in the file ~/.cache/streamview/latest-version.
  • If there is a newer version, streamview prints one line in the terminal. If there is no network, it prints nothing.
Variable What it does
STREAMVIEW_NO_UPDATE_CHECK Set it to 1 to stop the check.
CI If a system sets it, streamview does not do the check.