Socket
Book a DemoInstallSign in
Socket

@durable-streams/cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@durable-streams/cli

CLI tool for working with Durable Streams

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

Durable Streams CLI

A command-line tool for interacting with durable streams.

Installation

From npm

# Global installation
npm install -g @durable-streams/cli

# Or run directly with npx
npx @durable-streams/cli create my-stream
npx @durable-streams/cli read my-stream

From source (for development)

# Clone the repository
git clone https://github.com/durable-streams/durable-streams.git
cd durable-streams

# Install dependencies
pnpm install

# Build the CLI
pnpm build

# Link globally for development (uses tsx, no rebuild needed)
cd packages/cli
pnpm link:dev

# Now you can use durable-stream-dev anywhere
durable-stream-dev create my-stream

Quick Start

The easiest way to get started is to run the local development server and use the CLI:

Terminal 1: Start the local server

pnpm start:dev

This will start a Durable Streams server at http://localhost:4437 with live reloading.

Terminal 2: Use the CLI

# Set the server URL (optional, defaults to http://localhost:4437)
export STREAM_URL=http://localhost:4437

# Create a stream
durable-stream-dev create my-stream

# Write to the stream
durable-stream-dev write my-stream "Hello, world!"

# Read from the stream (follows live)
durable-stream-dev read my-stream

Usage

Environment Variables

  • STREAM_URL - Base URL of the stream server (default: http://localhost:4437)

Commands

Create a stream

durable-stream-dev create <stream_id>

Write to a stream

# Write content as arguments
durable-stream-dev write <stream_id> "Hello, world!"

# Pipe content from stdin
echo "Hello from stdin" | durable-stream-dev write <stream_id>
cat file.txt | durable-stream-dev write <stream_id>

Read from a stream

# Follows the stream and outputs new data to stdout
durable-stream-dev read <stream_id>

Delete a stream

durable-stream-dev delete <stream_id>

Complete Example Workflow

# Terminal 1: Start the local development server
pnpm start:dev

# Terminal 2: Set up the stream
export STREAM_URL=http://localhost:4437
durable-stream-dev create test-stream

# Terminal 3: Start reading (will show data as it arrives)
export STREAM_URL=http://localhost:4437
durable-stream-dev read test-stream

# Back in Terminal 2: Write data and watch it appear in Terminal 3
durable-stream-dev write test-stream "First message"
durable-stream-dev write test-stream "Second message"
echo "Piped content!" | durable-stream-dev write test-stream

Development

# Start the example server with live reloading
pnpm start:dev

# Watch mode for CLI development (rebuilds dist/)
pnpm dev

# Build
pnpm build

# Link globally for development (uses tsx, no rebuild needed)
pnpm link:dev

Keywords

cli

FAQs

Package last updated on 25 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts