📢 Release 1.1.1(2026-09-29)现已推出
Arcadia

执行 Shell 命令(Stream)

POST
/exec/v1/cmd/stream

通过 SSE(Server-Sent Events)流式返回实时日志,连接断开后命令仍继续执行。

授权

Token
headerapi-token<token>

32位令牌,在控制面板《个人设置 - 令牌管理》页面获取

请求主体

application/json
  1. body
cmd*string

要执行的 Shell 命令

响应主体

SSE 文本流,每条消息格式为 data:<JSON>\n\n,JSON 结构见 ExecStreamEvent

  1. response

SSE 流中每条 data: 消息的 JSON 结构,消息格式:data:<JSON>\n\n

interface StreamEvent {  type: 'start' | 'log' | 'exit' | 'error' // 事件类型  runId: string // 事件id,仅 `log` 和 `error` 事件存在  stream: 'stdout' | 'stderr' // 输出流类型,仅 `log` 事件存在  log: string // 日志内容,仅 `log` 和 `error` 事件存在}
type?string

事件类型

值于"start""log""exit""error"
runId?string

事件 id,仅 log 和 error 事件存在

stream?string

输出流类型,仅 log 事件存在

值于"stdout""stderr"
log?string

日志内容,仅 log 和 error 事件存在

curl -X POST "https://example.com/exec/v1/cmd/stream" \  -H "Content-Type: application/json" \  -d '{    "cmd": "string"  }'
{}