serve command starts a Gambiarra hub server that manages rooms and coordinates participants in your local network.
Usage
Options
Port to listen on. Also accepts
-p shorthand.Host to bind to. Also accepts
-h shorthand. Use 0.0.0.0 to accept connections from any network interface.Enable mDNS (Bonjour/Zeroconf) for local network discovery. Also accepts
-m shorthand. When enabled, the hub will be discoverable as <hostname>.local on the local network.Suppress logo output. Also accepts
-q shorthand.Examples
Start on default port
Start the hub server on the default port 3000:Start on custom port
Run the hub on port 8080:Enable mDNS discovery
Start with mDNS enabled for automatic discovery on the local network:The mDNS service name follows the format
<hostname>._gambiarra._tcp.localBind to localhost only
For security, bind to localhost only to prevent external connections:Combine multiple options
How it works
When you start the hub:- The server binds to the specified host and port
- A health check endpoint becomes available at
/health - If mDNS is enabled, the service is broadcast on the local network
- The hub is ready to accept room creation and participant registration
- Press
Ctrl+Cto gracefully shut down the server
The hub runs indefinitely until you stop it with
Ctrl+C. Make sure to keep the terminal window open while the hub is serving.Error handling
Invalid port
If you provide an invalid port number:Port already in use
If the specified port is already in use, the hub will fail to start. Try a different port:Related commands
create- Create a new room on the hublist- List all rooms on the hubmonitor- Monitor the hub in real-time with TUI
Next steps
After starting the hub:- Create a room where participants can join
- Share the room code with participants
- Monitor activity in real-time