360 Secure SkillHub
360 安全技能中心

Tinyfish Agent Run

通过 scripts/agent-run.sh 传入目标 URL 与 goal,POST 调用 TinyFish 自动化接口,以 SSE 流式获得 STARTED/PROGRESS/COMPLETE 事件,并逐行输出 JSON 供调用方展示实时进度与读取最终结果。运行前需配置 TINYFISH_API_KEY 环境变量。

bunsdev
bunsdev
热度 43.33
最近更新 2026-05-11 17:44:36
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本 / 工作流 / 研究

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add tinyfish-agent-run
Metadata
name
tinyfish-agent-run
description
Run a TinyFish automation agent against a URL and stream live progress events (STARTED / PROGRESS / COMPLETE) as one-line JSON events. Use when you want to execute an autonomous browsing goal and surface each step as it happens.
homepage
https://docs.tinyfish.ai/agent-api
requires
{"env":["TINYFISH_API_KEY"]}

TinyFish Agent Run

Execute an autonomous browsing goal against a URL and stream live events. Each SSE event is re-emitted on stdout as a single JSON line so a caller (subagent, TUI, etc.) can display progress as it arrives.

Requires: TINYFISH_API_KEY environment variable.

Pre-flight Check (REQUIRED)

[ -n "$TINYFISH_API_KEY" ] && echo "TINYFISH_API_KEY is set" || echo "TINYFISH_API_KEY is NOT set"

If the key is not set, stop and ask the user to add it. Get one at https://agent.tinyfish.ai/api-keys.

Streaming Run

scripts/agent-run.sh <url> <goal>

Example:

scripts/agent-run.sh https://scrapeme.live/shop "Extract the first 2 product names and prices. Return JSON."

Under the hood this POSTs to https://agent.tinyfish.ai/v1/automation/run-sse with:

{
  "url": "https://scrapeme.live/shop",
  "goal": "Extract the first 2 product names and prices. Return JSON."
}

and the header X-API-Key: $TINYFISH_API_KEY.

Output Format

One JSON object per line on stdout:

{"type":"STARTED","run_id":"abc123"}
{"type":"PROGRESS","run_id":"abc123","purpose":"Navigating to https://scrapeme.live/shop"}
{"type":"PROGRESS","run_id":"abc123","purpose":"Reading product list"}
{"type":"COMPLETE","run_id":"abc123","status":"COMPLETED","result":{...}}

A caller can:

  • Render each PROGRESS.purpose as a live status line.
  • Detect navigation by matching purpose against Navigating to <url> and surface the URL to an embedded browser view.
  • Parse COMPLETE.result for the final payload.

Event Types

  • STARTED — {type, run_id} — emitted once when the run begins.
  • PROGRESS — {type, run_id, purpose} — one per agent step. purpose is a short human-readable description.
  • COMPLETE — {type, run_id, status, result} — emitted once when the run finishes. status is typically COMPLETED.