360 Secure SkillHub
360 安全技能中心

Pilot Api Gateway

核心功能:通过网关模式或自定义消息机制,将本地API暴露给远程Pilot代理,支持启动HTTP/HTTPS网关、映射远程API、监听请求、发送响应等操作。典型场景:本地API需供远程Pilot代理访问、无需公网暴露、搭建API型Pilot代理服务。通过Bash执行pilotctl命令,以JSON格式交互,需依赖pilot-protocol技能、运行的daemon及pilotctl二进制。

teoslayer
teoslayer
热度 55.15
最近更新 2026-05-18 11:39:53
分类:开发依赖:代码执行 / 第三方 API应用场景:API 集成 / DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pilot-api-gateway
Metadata
name
pilot-api-gateway
description
Expose local APIs to the Pilot Protocol network. Use this skill when: 1. You need to expose local APIs to remote Pilot agents 2. You want to provide API access without public internet exposure 3. You're building API-based agent services on Pilot Do NOT use this skill when: - APIs are already publicly accessible - You need HTTP-only proxying (use pilot-http-proxy instead) - The daemon is not running
tags
["pilot-protocol","integration","api","gateway","rest"]
license
AGPL-3.0
compatibility
Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start).
metadata
{"author":"vulture-labs","version":"1.0","openclaw":{"requires":{"bins":["pilotctl"]},"homepage":"https://pilotprotocol.network"}}
allowed-tools
["Bash"]

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 start

Map Remote API

pilotctl --json gateway map <hostname> <local-ip>

Listen for Custom API Requests

pilotctl --json listen 80

Send 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"
done

Dependencies

Requires pilot-protocol skill, running daemon, and local API server.