TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/durable-streams/durable-streams/llms.txt
Use this file to discover all available pages before exploring further.
durable-stream CLI provides a command-line interface for creating, writing to, reading from, and deleting Durable Streams.
Installation
npx:
Global Options
These options can be used with any command and must appear before the command name.Stream server URL. Overrides the
STREAM_URL environment variable.Default: http://localhost:4437/v1/streamExample:Authorization header value for authenticating with the stream server. Overrides the
STREAM_AUTH environment variable.Common formats:Bearer <token>Basic <credentials>ApiKey <key>
Display help information and exit.Aliases:
-hExample:Environment Variables
Base URL of the stream server. Used when
--url flag is not provided.Default: http://localhost:4437/v1/streamExample:Authorization header value. Used when
--auth flag is not provided.Example:Commands
create
Create a new stream with the specified stream ID. Syntax:Unique identifier for the stream. Must be 1-256 characters containing only letters, numbers, underscores, hyphens, dots, and colons.Valid examples:
my-stream, user_123, logs.production, metrics:cpuContent-Type for the stream.Default:
application/octet-streamExamples:--content-type application/json--content-type text/plain--content-type application/octet-stream
Shorthand for
--content-type application/json. Enables JSON mode for the stream.write
Write content to an existing stream. Content can be provided as a command argument or piped from stdin. Syntax:The ID of the stream to write to.
The content to write to the stream. If not provided, content will be read from stdin.Supports escape sequences:
\n- newline\t- tab\r- carriage return\\- backslash
Content-Type for this write operation.Default:
application/octet-streamShorthand for
--content-type application/json. Write content as JSON.Write content as a JSON array, with each array element stored as a separate message. Automatically sets
--content-type application/json.Arrays are flattened one level deep:[1, 2, 3]→ 3 messages:1,2,3{"foo": "bar"}→ 1 message:{"foo": "bar"}
read
Read from a stream and write the output to stdout. Follows the stream in live mode, catching up on existing data first, then streaming new data as it arrives. Syntax:The ID of the stream to read from.
- Uses live mode with catch-up: reads all existing data first, then switches to streaming new data
- Streams data directly to stdout as it arrives
- Continues running until interrupted (Ctrl+C)
- Handles reconnections automatically
delete
Delete an existing stream and all its data. Syntax:The ID of the stream to delete.
Complete Examples
Working with JSON Streams
Create a JSON stream and write events:Working with Text Streams
Create a log stream:Piping Data
Pipe application logs to a stream:Using with Authentication
Set up authentication:Error Handling
The CLI provides helpful error messages for common issues: Invalid stream ID:Exit Codes
0- Success1- Error (validation error, network error, or stream operation failed)
Stream ID Validation
Stream IDs must meet the following requirements:- Length: 1-256 characters
- Allowed characters: letters (a-z, A-Z), numbers (0-9), underscore (
_), hyphen (-), dot (.), and colon (:) - No spaces or special characters
my-streamuser_eventslogs.productionmetrics:cpu:usagestream123
my stream(contains space)user@events(contains @)logs/production(contains /)- “ (empty string)