The Walrus CLI is a lightweight client for interacting with a distributed Walrus cluster over TCP. It supports both interactive shell mode and one-off commands.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nubskr/walrus/llms.txt
Use this file to discover all available pages before exploring further.
Connection Setup
The CLI connects to any node in the cluster via TCP on the client port (default:9091). The cluster automatically routes requests to the appropriate leader node.
Address of the client listener in the format
HOST:PORTWire Format
The CLI uses a simple length-prefixed text protocol over TCP:Request Structure
- Length prefix: 4 bytes (u32) in little-endian byte order representing the command length
- Command payload: UTF-8 encoded command string
Response Structure
- Length prefix: 4 bytes (u32) in little-endian byte order representing the response length
- Response payload: UTF-8 encoded response string
Response Types
OK- Success with no payloadOK [payload]- Success with data payloadEMPTY- No data available (GET command only)ERR <message>- Error with descriptive message
Frame Limits
- Minimum frame length: 1 byte
- Maximum frame length: 64 KB (65,536 bytes)
- Invalid frame lengths return
ERR invalid frame length
Usage Modes
Interactive Shell (REPL)
Start the CLI without a subcommand to enter interactive mode:- Command history
- Tab completion
- Exit with
exit,quit,q, or Ctrl+C - Direct command input without prefixes
One-off Commands
Execute single commands using subcommands:Available Commands
The CLI supports five commands:- REGISTER - Create a topic if it doesn’t exist
- PUT - Append data to a topic
- GET - Read the next entry from a topic
- STATE - Get topic metadata as JSON
- METRICS - Get Raft metrics as JSON
Error Handling
- Connection failures return context about the connection attempt
- Invalid UTF-8 encoding returns
ERR invalid utf-8 - Unknown commands return
ERR unknown command - Command-specific errors include descriptive messages
- Non-zero exit codes for failures in one-off mode
Cluster Integration
- Connect to any node in the cluster
- Non-leader nodes automatically forward requests to the leader
- Sealed segments can be read from any replica
- Transparent failover during leadership changes