#!/bin/bash # River CLI Demo Script set -e echo "=== River Feed Management CLI Demo ===" echo "" DEMO_DIR="/tmp/river-demo" CLI="dune exec bin/river_cli.exe --" # Cleanup and setup rm -rf $DEMO_DIR mkdir -p $DEMO_DIR echo "1. Setting up users..." $CLI user add alice --state-dir $DEMO_DIR --name "Alice Smith" --email "alice@example.com" $CLI user add bob --state-dir $DEMO_DIR --name "Bob Jones" --email "bob@example.com" echo "" echo "2. Adding feeds to users..." $CLI user add-feed alice --state-dir $DEMO_DIR --name "HackerNews" --url "https://hnrss.org/frontpage" $CLI user add-feed alice --state-dir $DEMO_DIR --name "Lobste.rs" --url "https://lobste.rs/rss" $CLI user add-feed bob --state-dir $DEMO_DIR --name "Rust Blog" --url "https://blog.rust-lang.org/feed.xml" echo "" echo "3. Listing all users..." $CLI user list --state-dir $DEMO_DIR echo "" echo "4. Showing Alice's details..." $CLI user show alice --state-dir $DEMO_DIR echo "" echo "5. Demonstrating sync with structured logging..." echo " Note: This will show connection timeouts for demo purposes" $CLI sync alice --state-dir $DEMO_DIR --verbosity=debug 2>&1 | head -20 echo "" echo "6. Directory structure created:" find $DEMO_DIR -type f -exec echo " {}" \; echo "" echo "7. Example user JSON:" echo " Content of alice.json:" cat $DEMO_DIR/users/alice.json | sed 's/^/ /' echo "" echo "Demo complete! The River CLI has:" echo " ✓ Created user management system" echo " ✓ Added feed management for users" echo " ✓ Implemented sync functionality with deduplication" echo " ✓ Integrated structured logging with Logs, fmt, and logs.cli" echo " ✓ Supports both Atom and RSS feeds" echo " ✓ Professional CLI with multiple log levels and color support" echo "" echo "Logging features:" echo " • --verbosity=debug|info|warning|error|quiet" echo " • -v/--verbose and -q/--quiet flags" echo " • --color=auto|always|never" echo "" echo "Ready for use as the foundation for a Zulip bot!"