The FlowMQ Command-Line Interface (CLI)
The flow
CLI is a powerful tool for interacting with your FlowMQ projects directly from the terminal. It allows you to manage resources, publish messages, and consume data without leaving your command line, making it perfect for scripting, automation, and quick administrative tasks.
Installation
(Instructions for installing the flow
CLI via package managers like Homebrew, apt
, or from binaries will be added here.)
Authentication & Contexts
Before you can interact with your projects, you need to authenticate.
flow login
This command initiates an OAuth-based browser login flow to securely authenticate you with your FlowMQ account. Your credentials are stored locally for subsequent commands.
$ flow login
> Redirecting to your browser for authentication...
> Login successful!
flow ctx
The context command allows you to manage connection profiles for different projects. You can list available projects and switch your active context, so all subsequent commands are directed to the correct project.
# List all projects you have access to
$ flow ctx list
ACTIVE PROJECT NAME PROJECT ID
* analytics-prod prj-12345
payments-staging prj-67890
# Switch your active project
$ flow ctx use payments-staging
> Context switched to project "payments-staging".
Core Messaging Commands
flow pub
Publishes a message to a topic. You can specify headers and the payload directly from the command line.
# Publish a simple message to a topic
$ flow pub orders.new --message '{"id": 1, "product": "laptop"}'
# Publish with headers
$ flow pub sensor.temp --message '22.5' -H 'unit=celsius' -H 'location=room-a'
flow sub
Subscribes to a queue, stream, or subscription to consume messages in real-time. This is useful for debugging and inspecting message flows.
# Subscribe to a queue
$ flow sub queue my-processing-queue
# Subscribe to the beginning of a stream
$ flow sub stream all-events --position earliest
# Subscribe to a topic via an ephemeral subscription
$ flow sub topic "sensors.#"
Resource Management
flow project
Manage your FlowMQ projects.
# List your projects
$ flow project list
# Create a new project
$ flow project create --name my-new-app --region us-east-1
flow stream
Create, list, and manage streams within the active project.
# Create a new stream bound to a topic filter
$ flow stream create all-orders --bind "orders.#"
# List all streams in the project
$ flow stream list