Skip to main content
New protocol version released: This page may contain outdated information.
The HAIP CLI provides a comprehensive set of commands for interacting with HAIP servers. All commands support verbose output with the --verbose flag for debugging.

Global Options

All commands support these global options:
  • -v, --verbose - Enable verbose output
  • --help - Show command help
  • --version - Show version information

Core Commands

haip version

Show version information.
Output:

haip info

Show system information.
Output:

haip examples

Show usage examples.

Connection Commands

haip connect <url>

Connect to a HAIP server and maintain an interactive connection. Syntax:
Arguments:
  • url - Server URL (e.g., ws://localhost:8080)
Options:
  • -t, --transport <type> - Transport type (websocket, sse, http-streaming)
  • --token <token> - JWT authentication token
  • --timeout <ms> - Connection timeout in milliseconds (default: 10000)
  • --reconnect-attempts <count> - Maximum reconnection attempts (default: 3)
  • --reconnect-delay <ms> - Base reconnection delay in milliseconds (default: 1000)
  • -v, --verbose - Enable verbose output
Examples:
Behaviour:
  • Establishes connection and maintains it until Ctrl+C
  • Shows connection status and statistics
  • Handles reconnection automatically
  • Displays real-time connection events

Send Commands

haip send

Send messages to a HAIP server.

haip send text <message>

Send a text message. Syntax:
Arguments:
  • message - Text message to send
Options:
  • -u, --url <url> - Server URL (default: ws://localhost:8080)
  • -t, --transport <type> - Transport type (default: websocket)
  • --token <token> - JWT authentication token
  • -c, --channel <channel> - Message channel (USER, AGENT, SYSTEM) (default: AGENT)
  • --author <author> - Message author
  • --run-id <id> - Run ID
  • --thread-id <id> - Thread ID
  • -v, --verbose - Enable verbose output
Examples:

haip send tool <tool> [params...]

Call a tool with parameters. Syntax:
Arguments:
  • tool - Tool name to call
  • params - Tool parameters in key=value format
Options:
  • -u, --url <url> - Server URL (default: ws://localhost:8080)
  • -t, --transport <type> - Transport type (default: websocket)
  • --token <token> - JWT authentication token
  • -c, --channel <channel> - Message channel (default: AGENT)
  • --run-id <id> - Run ID
  • --thread-id <id> - Thread ID
  • -v, --verbose - Enable verbose output
Examples:

haip send run

Start a new run. Syntax:
Options:
  • -u, --url <url> - Server URL (default: ws://localhost:8080)
  • -t, --transport <type> - Transport type (default: websocket)
  • --token <token> - JWT authentication token
  • --thread-id <id> - Thread ID
  • --metadata <json> - Run metadata (JSON string)
  • -v, --verbose - Enable verbose output
Examples:

Monitor Commands

haip monitor

Monitor HAIP server events in real-time. Syntax:
Options:
  • -u, --url <url> - Server URL (default: ws://localhost:8080)
  • -t, --transport <type> - Transport type (default: websocket)
  • --token <token> - JWT authentication token
  • --show-timestamps - Show message timestamps
  • --show-metadata - Show message metadata
  • --filter-types <types> - Filter by message types (comma-separated)
  • --filter-channels <channels> - Filter by channels (comma-separated)
  • --max-lines <count> - Maximum lines to display
  • --follow - Follow new messages
  • -v, --verbose - Enable verbose output
Examples:
Filter Types:
  • HAI - Protocol handshake
  • PING/PONG - Heartbeat messages
  • MESSAGE_START/PART/END - Text messages
  • AUDIO_CHUNK - Audio data
  • TOOL_CALL/UPDATE/DONE/CANCEL - Tool operations
  • RUN_STARTED/FINISHED/CANCEL - Run management
  • FLOW_UPDATE - Flow control
  • ERROR - Error messages
Filter Channels:
  • USER - User messages
  • AGENT - Agent messages
  • SYSTEM - System messages
  • AUDIO_IN - Audio input
  • AUDIO_OUT - Audio output

Test Commands

haip test

Test HAIP server connectivity and performance. Syntax:
Options:
  • -u, --url <url> - Server URL (default: ws://localhost:8080)
  • -t, --transport <type> - Transport type (default: websocket)
  • --token <token> - JWT authentication token
  • --message-count <count> - Number of test messages to send (default: 100)
  • --message-size <bytes> - Size of test messages in bytes (default: 1024)
  • --delay <ms> - Delay between messages in milliseconds (default: 100)
  • --timeout <ms> - Test timeout in milliseconds (default: 30000)
  • --validate-responses - Validate server responses
  • -v, --verbose - Enable verbose output
Examples:
Test Results: The test command provides comprehensive performance metrics:
  • Connection Time - Time to establish connection
  • Message Throughput - Messages per second
  • Latency - Average message round-trip time
  • Success Rate - Percentage of successful messages
  • Error Count - Number of failed messages
  • Total Duration - Total test duration

Health Commands

haip health

Check HAIP server health status. Syntax:
Options:
  • -u, --url <url> - Server URL (default: http://localhost:8080)
  • --timeout <ms> - Request timeout in milliseconds (default: 10000)
  • --format <format> - Output format (text, json)
Examples:
Health Response:

Command Combinations

Complete Testing Session

Debugging Session

Load Testing Session

Environment Variables

All commands respect these environment variables:

Exit Codes

The CLI uses standard exit codes:
  • 0 - Success
  • 1 - General error
  • 2 - Configuration error
  • 3 - Connection error
  • 4 - Protocol error
  • 5 - Timeout error

Next Steps