A minimal, fast command-line interface for managing Cloudflare Stream videos.
- 🎥 Upload videos with resumable TUS protocol for large files
- 📊 Manage videos - list, get, update, delete with rich filtering
- 🔗 Generate links - preview, signed URLs, thumbnails, HLS/DASH manifests
- 📦 Embed codes - responsive iframes with customization
- 🎨 Multiple outputs - table, JSON, or YAML formats
- ⚡ Fast & efficient - direct API integration with progress tracking
go install github.com/kljensen/cfstream@latestOr build from source:
git clone https://github.com/kljensen/cfstream.git
cd cfstream
go build -o cfstreamcfstream config initOr use environment variables:
export CFSTREAM_ACCOUNT_ID=your_account_id
export CFSTREAM_API_TOKEN=your_api_tokencfstream upload file video.mp4 --name "My Video"# Preview URL
cfstream link preview VIDEO_ID
# Signed URL (expires in 24h)
cfstream link signed VIDEO_ID --duration 24h
# Thumbnail
cfstream link thumbnail VIDEO_ID --time 30scfstream embed code VIDEO_ID --responsive --autoplay --mutedcfstream config init # Interactive setup
cfstream config show # Display current configcfstream upload file video.mp4 # Upload local file
cfstream upload url <url> # Upload from URL
cfstream upload direct # Generate direct upload URLcfstream video list # List all videos
cfstream video get VIDEO_ID # Get video details
cfstream video update VIDEO_ID # Update metadata
cfstream video delete VIDEO_ID # Delete videocfstream link preview VIDEO_ID # Preview URL
cfstream link signed VIDEO_ID # Signed URL
cfstream link thumbnail VIDEO_ID # Thumbnail URL
cfstream link hls VIDEO_ID # HLS manifest
cfstream link dash VIDEO_ID # DASH manifestcfstream embed code VIDEO_ID # Get iframe embed codeUse --output or -o to change the output format:
cfstream video list --output json # JSON output
cfstream video list --output yaml # YAML output
cfstream video list # Table output (default)--output, -o- Output format (table, json, yaml)--quiet, -q- Suppress non-essential output--verbose, -v- Verbose output--help, -h- Show help--version- Show version
# Upload
cfstream upload file presentation.mp4 --name "Q4 Presentation"
# Generate signed URL (24h expiry)
cfstream link signed abc123def456 --duration 24h
# Or get embed code
cfstream embed code abc123def456 --responsive# Export all videos
cfstream video list --output json > videos.json
# Parse with jq
cfstream video get VIDEO_ID --output json | jq '.name'# Find by name
cfstream video list --search "tutorial"
# Filter by status
cfstream video list --status ready --limit 50Configuration is loaded from (in order of precedence):
- Environment variables (
CFSTREAM_*) - Config file (
~/.config/cfstream/config.yaml) - Defaults
CFSTREAM_ACCOUNT_ID- Cloudflare account IDCFSTREAM_API_TOKEN- API tokenCFSTREAM_OUTPUT- Default output format
go test ./...golangci-lint rungo build -o cfstreamUnlicense