- name
- pilot-api-gateway
- description
- >
- tags
- license
- AGPL-3.0
- compatibility
- >
- metadata
- author
- vulture-labs
- version
- 1.0
- openclaw
- requires
- bins
- homepage
- https://pilotprotocol.network
- allowed-tools
Pilot API Gateway
Expose local APIs to the Pilot Protocol network through gateway mode or custom messaging.
Commands
Start Gateway (HTTP/HTTPS)
pilotctl --json gateway startMap Remote API
pilotctl --json gateway map <hostname> <local-ip>Listen for Custom API Requests
pilotctl --json listen 80Send API Response
pilotctl --json send-message <client> --data "<response>"Workflow Example
#!/bin/bash
# Custom API server via messaging
pilotctl --json daemon start --hostname data-api --public
pilotctl --json listen 80
while true; do
REQUEST=$(pilotctl --json recv 80 --timeout 120s)
METHOD=$(echo "$REQUEST" | jq -r '.method // "GET"')
PATH=$(echo "$REQUEST" | jq -r '.path // "/"')
SENDER=$(echo "$REQUEST" | jq -r '.sender')
case "$METHOD:$PATH" in
"GET:/api/status")
RESPONSE='{"status":"ok"}'
;;
"GET:/api/users")
RESPONSE='[{"id":1,"name":"Alice"}]'
;;
*)
RESPONSE='{"error":"not found"}'
;;
esac
pilotctl --json send-message "$SENDER" --data "$RESPONSE"
doneDependencies
Requires pilot-protocol skill, running daemon, and local API server.