Build a Gateway
Create a custom gateway — connect any messaging platform to CrabTalk agents.
A gateway connects an external platform to CrabTalk. Telegram is a gateway. Discord, Slack, Matrix, a custom web chat — anything that receives messages can be one.
How gateways work
A gateway is an independent binary that:
- Listens for messages from an external platform
- Connects to the CrabTalk daemon via Unix domain socket
- Forwards messages to an agent
- Streams responses back to the platform
The daemon doesn't manage the gateway process. It runs as a system service (launchd on macOS, systemd on Linux), just like the Telegram gateway.
1. Start from the template
Clone the crabtalk-client template:
gh repo create crabtalk-discord --template crabtalk/crabtalk-client
cd crabtalk-discordThe template gives you a working client that connects to the daemon and handles the message loop.
2. Implement the platform integration
Add your platform's SDK or API client. The template handles the daemon connection — you add the code to receive messages from your platform and send responses back.
3. Name and install
Name your binary crabtalk-<name>:
cargo build --release
cp target/release/crabtalk-discord ~/.cargo/bin/It becomes available as crabtalk discord. The binary handles its own service installation — crabtalk discord start installs a system service and starts it.
4. Test
crabtalk discord start
crabtalk ls # verify it's runningSend a message on your platform. The gateway forwards it to the daemon, the agent responds, and the response appears on the platform.
What's next
- Commands — client commands vs. MCP commands
- Set Up Telegram — see a working gateway in action