Skip to main content

A command-line client for SuperCortex Flow - a privacy-preserving, decentralized pub/sub messaging system

Project description

Flow PubSub CLI

PyPI version Python versions

A command-line client for SuperCortex Flow - a privacy-preserving, decentralized append-only pub/sub messaging system with unguessable 256-bit addressing.

Features

  • ๐Ÿ” Privacy-First Messaging: Uses 256-bit unguessable message IDs with hierarchical structure
  • ๐Ÿข Organization Management: Create and manage organizations with random 64-bit IDs
  • ๐Ÿ“ก Topic-Based Subscriptions: Subscribe to specific topics with cryptographic isolation
  • โšก Real-time Streaming: WebSocket-based event streaming for instant delivery
  • ๐Ÿ”ง Automation-Friendly: Netcat-style streaming for scripting and automation
  • ๐Ÿ›ก๏ธ Cryptographic Security: No enumeration attacks - can't discover messages without prior knowledge

Installation

pip install flow-pubsub-cli

Quick Start

1. Connect to a Flow Server

# Login with interactive prompts
flow login
# Server URL [http://localhost:2222]: 
# Token: your_auth_token_here

2. Create Organization

# Create your organization (gets random 64-bit ID)
flow config create-org --alias "my-backend"
# โœ“ Created organization: a7f3d89c2b1e4068 (alias: my-backend)

3. Send and Receive Messages

# Send events to specific topics
flow add "Database connection failed" --topic logs.errors
flow add "User login successful" --topic auth.success

# Watch topics in real-time (WebSocket streaming)
flow watch logs.errors      # Only database error logs
flow watch auth             # All authentication events

Core Commands

Authentication & Configuration

flow login                           # Interactive login
flow config show                     # View current configuration
flow config create-org --alias name  # Create new organization
flow config set-org alias           # Switch organizations

Messaging

flow add "message" --topic path      # Send event to topic
flow watch topic.path               # Watch topic in real-time
flow nc -l topic.path               # Netcat-style streaming

Topic Sharing

flow share-topic logs.errors        # Generate shareable topic prefix
# Recipients can watch: flow watch a7f3d89c2b1e40683f8a2b1cd9e7f6a2

Advanced Usage

Netcat-Style Streaming

Perfect for automation and scripting:

# Stream events to stdout
flow nc -l logs.errors | grep "timeout" | logger -t "flow-alerts"

# Send continuous input as events  
tail -f /var/log/app.log | flow nc logs.events
echo "System startup complete" | flow nc system.status

Cross-Organization Communication

# Alice shares her error logs
alice$ flow share-topic backend.errors
# Share: a7f3d89c.8f2a1b3c.d9e7f6a2

# Bob monitors Alice's errors (only this topic, nothing else)
bob$ flow watch a7f3d89c.8f2a1b3c.d9e7f6a2

Automation Scripts

# Microservice error monitoring
#!/bin/bash
flow nc -l services.errors | while read error; do
  echo "$(date): $error" >> /var/log/flow-errors.log
  if echo "$error" | grep -q "CRITICAL"; then
    mail -s "Critical Error" admin@company.com <<< "$error"
  fi
done

256-bit Address Structure

SuperCortex Flow uses a unique addressing scheme for privacy:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 64-bit      โ”‚ 32-bit      โ”‚ 32-bit      โ”‚ 128-bit         โ”‚
โ”‚ random org  โ”‚ topic hash  โ”‚ topic nonce โ”‚ random          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Example: a7f3d89c2b1e4068.3f8a2b1c.d9e7f6a2.{128-bit-collision-resistant}

Privacy Benefits

  • No enumeration attacks: Can't discover messages without prior knowledge
  • Cryptographic isolation: Each topic has unique nonces
  • Selective sharing: Share specific topics without revealing org structure
  • Organization privacy: Random 64-bit org IDs are unguessable

Requirements

  • Python 3.8+
  • Access to a SuperCortex Flow server

Dependencies

  • click>=8.1.0 - Command-line interface framework
  • requests>=2.31.0 - HTTP client for API calls
  • websockets>=12.0 - WebSocket client for real-time streaming

License

MIT License - see LICENSE file for details.

Related Projects

  • SuperCortex Flow - The complete SuperCortex Flow system including server implementation

Contributing

This is part of the SuperCortex Flow project. Please see the main repository for contribution guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flow_pubsub_cli-0.1.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flow_pubsub_cli-0.1.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file flow_pubsub_cli-0.1.1.tar.gz.

File metadata

  • Download URL: flow_pubsub_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for flow_pubsub_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5eade6c4c8016160accdf4e04f60fd594f7fa49c266dc3b875c366b4cf2ac144
MD5 9c7be9736097578e8be449cb7a3c2c75
BLAKE2b-256 b71df9ff56e7fdae2a4a4459e00d3449cf944bf177f958f9b0a358d9962ac84e

See more details on using hashes here.

File details

Details for the file flow_pubsub_cli-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flow_pubsub_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c245ddefe5de217660c4281076995dc827cfa1f63f2a5c3fcd38d23f90f4953f
MD5 61be5ae07328f8f8fb70f0ca919fed66
BLAKE2b-256 90d62dbf334833b28685d3912eb757a48d6d5bcaa32198fc1454685426f447a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page