Skip to content

Atomic

Low-level primitives: file I/O, git, HTTP, shell, SSH, process management, and testing.

44 modules

ModuleDescription
篩選陣列依條件篩選陣列元素
排序陣列以升序或降序排序陣列元素
陣列去重從陣列中移除重複的值
OAuth2 Token ExchangeExchange authorization code, refresh token, or client credentials for an access token
DNS 查詢查詢網域記錄的 DNS
文字差異生成兩個文字字串之間的差異
編輯檔案使用精確字串匹配替換檔案中的文字
檢查檔案存在檢查檔案或目錄是否存在
讀取檔案從檔案讀取內容
寫入檔案寫入內容到檔案
Git 複製複製一個 git 儲存庫
Git 提交建立一個 git 提交
Git 差異取得 git 差異
HTTP PaginateAutomatically iterate through paginated API endpoints and collect all results
HTTP 請求傳送 HTTP 請求並接收回應
驗證 HTTP 回應驗證 HTTP 回應屬性
HTTP SessionSend a sequence of HTTP requests with persistent cookies (login → action → logout)
Webhook WaitStart a temporary server and wait for an incoming webhook callback
LLM 對話與 LLM API 互動進行智慧操作
AI 程式碼修復根據問題自動產生程式碼修復
計算執行基本數學運算
HTTP 健康檢查HTTP 健康檢查 / 上線監控
檢查埠檢查網路埠是否開啟或關閉
等待埠等待網路埠變為可用
列出程序列出所有執行中的背景程序
啟動背景程序啟動背景程序(伺服器、服務等)
停止程序停止執行中的背景程序
執行 Shell 命令執行 shell 命令並擷取輸出
SSH 執行透過 SSH 在遠端伺服器執行命令
SFTP 下載透過 SFTP 從遠端伺服器下載檔案
SFTP 上傳透過 SFTP 上傳檔案到遠端伺服器
執行 E2E 步驟依序執行端對端測試步驟
品質閘道根據定義的門檻評估品質指標
執行 HTTP 測試執行 HTTP API 測試套件
執行 Linter對原始碼執行程式碼檢查
產生報告產生測試執行報告
執行情境執行情境式測試(BDD 風格)
安全掃描掃描安全漏洞
執行測試套件執行測試集合
執行單元測試執行單元測試
視覺比較比較視覺輸出差異
評估 UI 品質全面的 UI 品質評估,具備多維度評分
AI 圖片分析使用 OpenAI Vision API(GPT-4V)分析圖片
比較圖片比較兩張圖片並識別視覺差異

Modules

篩選陣列

array.filter

依條件篩選陣列元素

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
conditionselect (eq, ne, gt, gte, lt, lte, contains, startswith, endswith, regex, in, notin, exists, empty, notempty)Yes-How to compare each item against the value
valuestringYes-Value to compare each item against (leave empty for exists/empty checks)

Output:

FieldTypeDescription
filteredarray篩選後的陣列
countnumber篩選後的數量

Example: Filter numbers greater than 5

yaml
array: [1, 5, 10, 15, 3]
condition: gt
value: 5

排序陣列

array.sort

以升序或降序排序陣列元素

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
orderselect (asc, desc)NoascDirection to sort items

Output:

FieldTypeDescription
sortedarray排序後的陣列
countnumber排序後的數量

Example: Sort numbers ascending

yaml
array: [5, 2, 8, 1, 9]
order: asc

陣列去重

array.unique

從陣列中移除重複的值

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
preserve_orderbooleanNoTrueKeep first occurrence order

Output:

FieldTypeDescription
uniquearray不重複的陣列
countnumber去重後的數量
duplicates_removednumber移除的重複數量

Example: Remove duplicates

yaml
array: [1, 2, 2, 3, 4, 3, 5]
preserve_order: true

OAuth2 Token Exchange

auth.oauth2

Exchange authorization code, refresh token, or client credentials for an access token

Parameters:

NameTypeRequiredDefaultDescription
token_urlstringYes-OAuth2 token endpoint URL
grant_typestringNoauthorization_codeOAuth2 grant type
client_idstringYes-OAuth2 application client ID
client_secretstringNo-OAuth2 application client secret
codestringNo-Authorization code received from the OAuth2 authorization flow
redirect_uristringNo-Redirect URI used in the authorization request (must match exactly)
refresh_tokenstringNo-Refresh token for obtaining a new access token
scopestringNo-Space-separated list of OAuth2 scopes
code_verifierstringNo-PKCE code verifier for public clients
client_auth_methodstringNobodyHow to send client credentials to the token endpoint
extra_paramsobjectNo{}Additional parameters to include in the token request
timeoutnumberNo15Maximum time to wait in seconds

Output:

FieldTypeDescription
okbooleanWhether token exchange was successful
access_tokenstringThe access token for API requests
token_typestringToken type (usually "Bearer")
expires_innumberToken lifetime in seconds
refresh_tokenstringRefresh token (if provided by the OAuth2 server)
scopestringGranted scopes
rawobjectFull raw response from the token endpoint
duration_msnumberRequest duration in milliseconds

Example: Exchange authorization code (Google)

yaml
token_url: https://oauth2.googleapis.com/token
grant_type: authorization_code
client_id: ${env.GOOGLE_CLIENT_ID}
client_secret: ${env.GOOGLE_CLIENT_SECRET}
code: 4/0AX4XfWh...
redirect_uri: https://yourapp.com/callback

Example: Refresh an expired token

yaml
token_url: https://oauth2.googleapis.com/token
grant_type: refresh_token
client_id: ${env.GOOGLE_CLIENT_ID}
client_secret: ${env.GOOGLE_CLIENT_SECRET}
refresh_token: ${env.REFRESH_TOKEN}

Example: Client credentials (machine-to-machine)

yaml
token_url: https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
grant_type: client_credentials
client_id: ${env.AZURE_CLIENT_ID}
client_secret: ${env.AZURE_CLIENT_SECRET}
scope: https://graph.microsoft.com/.default

Example: GitHub OAuth (code exchange)

yaml
token_url: https://github.com/login/oauth/access_token
grant_type: authorization_code
client_id: ${env.GITHUB_CLIENT_ID}
client_secret: ${env.GITHUB_CLIENT_SECRET}
code: abc123...

DNS 查詢

dns.lookup

查詢網域記錄的 DNS

Parameters:

NameTypeRequiredDefaultDescription
domainstringYes-要查詢的網域名稱
record_typeselect (A, AAAA, CNAME, MX, NS, TXT, SOA, SRV)NoA要查詢的 DNS 記錄類型
timeoutnumberNo10查詢逾時秒數

Output:

FieldTypeDescription
okbooleanWhether lookup succeeded
dataobject

Example: A record lookup

yaml
domain: example.com
record_type: A

Example: MX record lookup

yaml
domain: example.com
record_type: MX

文字差異

file.diff

生成兩個文字字串之間的差異

Parameters:

NameTypeRequiredDefaultDescription
originalstringYes-原始文字
modifiedstringYes-已修改的文字
context_linesnumberNo3變更周圍的上下文行數
filenamestringNofile在差異標題中使用的檔名

Output:

FieldTypeDescription
diffstring統一的差異輸出
changedboolean是否有任何變更
additionsnumber新增行數
deletionsnumber刪除行數

Example: Diff two strings

yaml
original: hello
world
modified: hello
world!
filename: test.txt

編輯檔案

file.edit

使用精確字串匹配替換檔案中的文字

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-要編輯的檔案路徑
old_stringstringYes-要查找和替換的文字
new_stringstringYes-替換文字
replace_allbooleanNoFalse替換所有出現的地方,而不只是第一次
encodingselect (utf-8, ascii, latin-1, utf-16, gbk, big5)Noutf-8檔案編碼

Output:

FieldTypeDescription
pathstring已編輯檔案的路徑
replacementsnumber替換次數
diffstring顯示變更的差異

Example: Replace string in file

yaml
path: /tmp/example.py
old_string: def hello():
new_string: def hello_world():

檢查檔案存在

file.exists

檢查檔案或目錄是否存在

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the file

Output:

FieldTypeDescription
existsboolean路徑是否存在
is_fileboolean是否為檔案
is_directoryboolean是否為目錄

Example: Check file exists

yaml
path: /tmp/data.txt

讀取檔案

file.read

從檔案讀取內容

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the file
encodingselect (utf-8, ascii, latin-1, utf-16, gbk, big5)Noutf-8Character encoding for the file

Output:

FieldTypeDescription
contentstring檔案內容
sizenumber檔案大小

Example: Read text file

yaml
path: /tmp/data.txt
encoding: utf-8

寫入檔案

file.write

寫入內容到檔案

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the file
contentstringYes-Text content to write to the file
encodingselect (utf-8, ascii, latin-1, utf-16, gbk, big5)Noutf-8Character encoding for the file
modeselect (overwrite, append)NooverwriteHow to write content to the file

Output:

FieldTypeDescription
pathstring檔案路徑
bytes_writtennumber寫入的位元組數

Example: Write text file

yaml
path: /tmp/output.txt
content: Hello World
mode: overwrite

Git 複製

git.clone

複製一個 git 儲存庫

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-Git 儲存庫 URL (HTTPS 或 SSH)
destinationstringYes-要複製到的本地路徑
branchstringNo-複製後要檢出的分支
depthnumberNo-淺層複製深度(完整複製則省略)
tokenstringNo-私人儲存庫的個人存取權杖

Output:

FieldTypeDescription
okbooleanWhether clone succeeded
dataobject

Example: Clone public repository

yaml
url: https://github.com/user/repo.git
destination: /tmp/repo

Example: Shallow clone specific branch

yaml
url: https://github.com/user/repo.git
destination: /tmp/repo
branch: develop
depth: 1

Git 提交

git.commit

建立一個 git 提交

Parameters:

NameTypeRequiredDefaultDescription
repo_pathstringYes-Git 儲存庫的路徑
messagestringYes-提交訊息
add_allbooleanNoFalse提交前階段所有變更 (git add -A)
filesarrayNo-提交前要階段的特定檔案
author_namestringNo-覆寫提交作者名稱
author_emailstringNo-覆寫提交作者電子郵件

Output:

FieldTypeDescription
okbooleanWhether commit succeeded
dataobject

Example: Commit all changes

yaml
repo_path: /home/user/project
message: feat: add user authentication
add_all: true

Example: Commit specific files

yaml
repo_path: /home/user/project
message: fix: correct typo in readme
files: ["README.md"]

Git 差異

git.diff

取得 git 差異

Parameters:

NameTypeRequiredDefaultDescription
repo_pathstringYes-Git 儲存庫的路徑
ref1stringNoHEAD第一個參考(提交、分支、標籤)
ref2stringNo-要比較的第二個參考
stagedbooleanNoFalse僅顯示已階段的變更 (--cached)
stat_onlybooleanNoFalse僅顯示檔案統計 (--stat)

Output:

FieldTypeDescription
okbooleanWhether diff succeeded
dataobject

Example: Show unstaged changes

yaml
repo_path: /home/user/project

Example: Compare branches

yaml
repo_path: /home/user/project
ref1: main
ref2: feature/login

Example: Show staged changes stats

yaml
repo_path: /home/user/project
staged: true
stat_only: true

HTTP Paginate

http.paginate

Automatically iterate through paginated API endpoints and collect all results

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL to navigate to
methodselect (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)NoGETHTTP request method
headersobjectNo{}HTTP request headers as key-value pairs
authobjectNo-Authentication credentials for the HTTP request
strategystringNooffsetHow the API implements pagination
data_pathstringNo-Dot-notation path to the array of items in the response (e.g. "data", "results", "items")
offset_paramstringNooffsetQuery parameter name for offset
limit_paramstringNolimitQuery parameter name for page size
page_sizenumberNo100Number of items per page
page_paramstringNopageQuery parameter name for page number
start_pagenumberNo1First page number (usually 0 or 1)
cursor_paramstringNocursorQuery parameter name for cursor token
cursor_pathstringNo-Dot-notation path to the next cursor in the response (e.g. "meta.next_cursor", "pagination.next")
max_pagesnumberNo50Maximum number of pages to fetch (safety limit)
delay_msnumberNo0Milliseconds to wait between page requests (rate limiting)
timeoutnumberNo30Maximum time to wait in seconds
verify_sslbooleanNoTrueVerify SSL certificates

Output:

FieldTypeDescription
okbooleanWhether all pages were fetched successfully
itemsarrayAll collected items across all pages
total_itemsnumberTotal number of items collected
pages_fetchednumberNumber of pages fetched
duration_msnumberTotal duration in milliseconds

Example: Offset pagination (REST API)

yaml
url: https://api.example.com/users
strategy: offset
data_path: data
page_size: 100

Example: Page number pagination

yaml
url: https://api.example.com/products
strategy: page
data_path: results
page_param: page
page_size: 50
start_page: 1

Example: Cursor pagination (Slack, Notion)

yaml
url: https://api.notion.com/v1/databases/{db_id}/query
method: POST
strategy: cursor
data_path: results
cursor_path: next_cursor
cursor_param: start_cursor
auth: {"type": "bearer", "token": "${env.NOTION_TOKEN}"}

Example: Link header pagination (GitHub)

yaml
url: https://api.github.com/repos/octocat/hello-world/issues
strategy: link_header
page_size: 100
auth: {"type": "bearer", "token": "${env.GITHUB_TOKEN}"}

HTTP 請求

http.request

傳送 HTTP 請求並接收回應

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL to navigate to
methodselect (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)NoGETHTTP request method
headersobjectNo{}HTTP request headers as key-value pairs
bodyanyNo-HTTP request body content (JSON, text, or form data)
queryobjectNo{}URL query string parameters as key-value pairs
content_typeselect (application/json, application/x-www-form-urlencoded, multipart/form-data, text/plain, text/html, application/xml)Noapplication/jsonContent type of the request body
authobjectNo-Authentication credentials for the HTTP request
timeoutnumberNo30Maximum time to wait in seconds
follow_redirectsbooleanNoTrueAutomatically follow HTTP redirects
verify_sslbooleanNoTrueVerify SSL certificates
response_typeselect (auto, json, text, binary)NoautoHow to parse the response body
retry_countnumberNo0Number of retries on failure or 429/503 status
retry_backoffstringNoexponentialBackoff strategy between retries
retry_delaynumberNo1Initial delay between retries in seconds

Output:

FieldTypeDescription
okboolean請求是否成功(2xx 狀態)
statusnumberHTTP 狀態碼
status_textstringHTTP 狀態文字
headersobject回應標頭
bodyany回應內容(解析後的 JSON 或文字)
urlstring最終網址(重新導向後)
duration_msnumber請求時間(毫秒)
content_typestring內容類型
content_lengthnumber內容長度

Example: Simple GET request

yaml
url: https://api.example.com/users
method: GET

Example: POST with JSON body

yaml
url: https://api.example.com/users
method: POST
body: {"name": "John", "email": "john@example.com"}

Example: Request with Bearer auth

yaml
url: https://api.example.com/protected
method: GET
auth: {"type": "bearer", "token": "${env.API_TOKEN}"}

Example: Request with query params

yaml
url: https://api.example.com/search
method: GET
query: {"q": "flyto", "limit": 10}

驗證 HTTP 回應

http.response_assert

驗證 HTTP 回應屬性

Parameters:

NameTypeRequiredDefaultDescription
responseobjectYes-HTTP response object from http.request
statusanyNo-Expected status code (number, array of numbers, or range string "200-299")
body_containsanyNo-String or array of strings that body should contain
body_not_containsanyNo-String or array of strings that body should NOT contain
body_matchesstringYes-Regular expression pattern
json_pathobjectNo-Object mapping JSON paths to expected values (e.g., {"data.id": 123})
json_path_existsarrayNo-Array of JSON paths that should exist
header_containsobjectNo-Object mapping header names to expected values
content_typeselect (application/json, application/x-www-form-urlencoded, multipart/form-data, text/plain, text/html, application/xml)No-Content type of the request body
max_duration_msnumberNo-Maximum allowed response time in milliseconds
schemaobjectNo-JSON Schema to validate response body against
fail_fastbooleanNoFalseStop on first assertion failure

Output:

FieldTypeDescription
okboolean所有驗證是否通過
passednumber通過的驗證數量
failednumber失敗的驗證數量
totalnumber總驗證數量
assertionsarray詳細的驗證結果
errorsarray錯誤訊息

Example: Assert status 200

yaml
response: ${http_request.result}
status: 200

Example: Assert JSON structure

yaml
response: ${http_request.result}
status: 200
json_path: {"data.id": "${expected_id}", "data.name": "John"}
json_path_exists: ["data.created_at", "data.email"]

Example: Assert API response

yaml
response: ${api_result}
status: [200, 201]
content_type: application/json
max_duration_ms: 1000
json_path: {"success": true}

HTTP Session

http.session

Send a sequence of HTTP requests with persistent cookies (login → action → logout)

Parameters:

NameTypeRequiredDefaultDescription
requestsarrayYes-Ordered list of HTTP requests to execute with shared cookies
authobjectNo-Authentication applied to all requests in the session
stop_on_errorbooleanNoTrueStop executing remaining requests if one fails (non-2xx)
timeoutnumberNo30Maximum time per individual request
verify_sslbooleanNoTrueVerify SSL certificates

Output:

FieldTypeDescription
okbooleanWhether all requests succeeded
resultsarrayResults from each request in order
cookiesobjectFinal session cookies as key-value pairs
duration_msnumberTotal duration in milliseconds

Example: Login and fetch data

yaml
requests: [{"label": "Login", "url": "https://example.com/api/login", "method": "POST", "body": {"username": "${env.USER}", "password": "${env.PASS}"}}, {"label": "Get Profile", "url": "https://example.com/api/profile", "method": "GET"}]
stop_on_error: true

Example: CSRF token flow

yaml
requests: [{"label": "Get CSRF Token", "url": "https://example.com/csrf-token", "method": "GET"}, {"label": "Submit Form", "url": "https://example.com/api/submit", "method": "POST", "body": {"data": "value"}}]

Webhook Wait

http.webhook_wait

Start a temporary server and wait for an incoming webhook callback

Parameters:

NameTypeRequiredDefaultDescription
pathstringNo/webhookURL path to listen on (e.g. /webhook, /callback)
portnumberNo0Port to listen on (0 = auto-assign)
timeoutnumberNo300Maximum time to wait for the webhook callback
use_ngrokbooleanNoFalseCreate an ngrok tunnel for public access (requires pyngrok)
ngrok_tokenstringNo-ngrok authentication token (free at ngrok.com)
expected_methodstringNoPOSTOnly accept this HTTP method (empty = accept any)
response_statusnumberNo200HTTP status code to respond with when webhook is received
response_bodystringNo{"ok": true}Response body to send back to the webhook caller

Output:

FieldTypeDescription
okbooleanWhether webhook was received before timeout
webhook_urlstringThe URL to send webhooks to (public if ngrok enabled)
methodstringHTTP method of the received webhook
headersobjectHeaders from the received webhook
bodyanyBody from the received webhook (parsed JSON or raw text)
queryobjectQuery parameters from the received webhook
duration_msnumberTime waited for the webhook in milliseconds

Example: Wait for Stripe webhook (local)

yaml
path: /webhook/stripe
port: 8765
timeout: 120
use_ngrok: false

Example: Wait for webhook with ngrok tunnel

yaml
path: /webhook
timeout: 300
use_ngrok: true
ngrok_token: ${env.NGROK_AUTH_TOKEN}

LLM 對話

llm.chat

與 LLM API 互動進行智慧操作

Parameters:

NameTypeRequiredDefaultDescription
promptstringYes-The prompt or question to send to the AI model
system_promptstringNo-System instructions to set AI behavior and context
contextobjectNo-Additional context data to include
messagesarrayNo-Previous messages for multi-turn conversation
providerselect (openai, anthropic, ollama)NoopenaiAI model provider
modelstringNogpt-4oSpecific model to use
temperaturenumberNo0.7Creativity level (0=deterministic, 1=creative)
max_tokensnumberNo2000Maximum tokens in response
response_formatselect (text, json, code, markdown)NotextExpected format of the AI response
api_keystringNo-API key (defaults to provider env var)
base_urlstringNo-Custom API base URL (for Ollama or proxies)

Output:

FieldTypeDescription
okboolean請求是否成功
responsestringLLM 回應文字
parsedany解析的回應(如果請求 JSON 格式)
modelstring使用的模型
tokens_usednumber使用的 Token 數量
finish_reasonstring完成原因

Example: Code Review

yaml
prompt: Review this code for bugs and improvements:

${code}
system_prompt: You are an expert code reviewer. Be specific and actionable.
model: gpt-4o

Example: Generate Fix

yaml
prompt: The UI evaluation found these issues: ${issues}

Generate code fixes.
system_prompt: You are a frontend developer. Return only valid code.
response_format: code

Example: Decision Making

yaml
prompt: Based on these test results, should we deploy? ${test_results}
system_prompt: You are a DevOps engineer. Return JSON: {"decision": "yes/no", "reason": "..."}
response_format: json

AI 程式碼修復

llm.code_fix

根據問題自動產生程式碼修復

Parameters:

NameTypeRequiredDefaultDescription
issuesarrayYes-List of issues to fix (from ui.evaluate, test results, etc.)
source_filesarrayYes-Files to analyze and potentially fix
fix_modeselect (suggest, apply, dry_run)NosuggestHow to handle the suggested fixes
backupbooleanNoTrueCreate .bak backup before modifying files
contextstringNo-Text content to process
modelstringNogpt-4oSpecific model to use
api_keystringNo-API key (defaults to provider env var)

Output:

FieldTypeDescription
okboolean操作是否成功
fixesarray產生的修復列表
appliedarray已套用的修復列表
failedarray失敗的修復列表
summarystring修復摘要

Example: Fix UI Issues

yaml
issues: ${ui_evaluation.issues}
source_files: ["./src/components/Footer.tsx", "./src/styles/footer.css"]
fix_mode: suggest
context: React + Tailwind CSS project

Example: Auto-fix and Apply

yaml
issues: ${test_results.failures}
source_files: ["./src/App.tsx"]
fix_mode: apply
backup: true

計算

math.calculate

執行基本數學運算

Parameters:

NameTypeRequiredDefaultDescription
operationselect (add, subtract, multiply, divide, power, modulo, sqrt, abs)Yes-Operation to perform
anumberYes-First operand
bnumberNo-Second operand (not required for sqrt and abs)
precisionnumberNo2Number of decimal places

Output:

FieldTypeDescription
resultnumber計算結果
operationstring執行的操作
expressionstring計算式

Example: Add two numbers

yaml
operation: add
a: 10
b: 5

Example: Calculate power

yaml
operation: power
a: 2
b: 8

HTTP 健康檢查

monitor.http_check

HTTP 健康檢查 / 上線監控

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-要檢查的 URL
methodselect (GET, HEAD, POST)NoGETHTTP 方法
expected_statusnumberNo200預期的 HTTP 狀態碼
timeout_msnumberNo10000請求超時時間(毫秒)
headersobjectNo-自訂請求標頭
bodystringNo-請求內容(用於 POST)
check_sslbooleanNoTrue檢查 SSL 憑證的有效性和到期日
containsstringNo-回應內容必須包含此字串
follow_redirectsbooleanNoTrue跟隨 HTTP 重定向

Output:

FieldTypeDescription
okbooleanWhether check completed
dataobject

Example: Basic health check

yaml
url: https://api.example.com/health
expected_status: 200

Example: Check with content validation

yaml
url: https://api.example.com/health
contains: "status":"ok"
timeout_ms: 5000

檢查埠

port.check

檢查網路埠是否開啟或關閉

Parameters:

NameTypeRequiredDefaultDescription
portanyYes-要檢查的埠號或埠號陣列
hoststringNolocalhost要檢查的埠號或埠號陣列
connect_timeoutnumberNo2要連線的主機
expect_openbooleanNo-每次連線嘗試的逾時時間

Output:

FieldTypeDescription
okboolean設為 true 預期埠開啟,false 預期關閉
resultsarray所有檢查是否通過(如果有設定 expect_open)
open_portsarray所有檢查是否通過(如果有設定 expect_open)
closed_portsarray埠檢查結果陣列
summaryobject開啟的埠列表

Example: Check single port

yaml
port: 3000

Example: Check multiple ports

yaml
port: [3000, 8080, 5432]
host: localhost

Example: Assert ports are open

yaml
port: [80, 443]
host: example.com
expect_open: true

等待埠

port.wait

等待網路埠變為可用

Parameters:

NameTypeRequiredDefaultDescription
portnumberYes-要等待的埠號
hoststringNolocalhost要連線的主機
timeoutnumberNo60要連線的主機
intervalnumberNo500最大等待時間
expect_closedbooleanNoFalse連線嘗試之間的間隔(毫秒)

Output:

FieldTypeDescription
okboolean改為等待埠變為不可用
availableboolean埠是否在預期狀態
hoststring埠是否在預期狀態
portnumber埠目前是否可用
wait_time_msnumber檢查的主機
attemptsnumber檢查的埠

Example: Wait for dev server

yaml
port: 3000
timeout: 30

Example: Wait for database

yaml
port: 5432
host: localhost
timeout: 60

Example: Wait for port to close

yaml
port: 8080
expect_closed: true
timeout: 10

列出程序

process.list

列出所有執行中的背景程序

Parameters:

NameTypeRequiredDefaultDescription
filter_namestringNo-Filter processes by name (substring match)
include_statusbooleanNoTrueInclude running/stopped status check for each process

Output:

FieldTypeDescription
okboolean操作成功
processesarray操作成功
countnumber操作成功
runningnumber程序資訊列表
stoppednumber程序總數

Example: List all processes

yaml

Example: Filter by name

yaml
filter_name: dev

啟動背景程序

process.start

啟動背景程序(伺服器、服務等)

Parameters:

NameTypeRequiredDefaultDescription
commandstringYes-Shell command to execute
cwdstringNo-Directory to execute command in
envobjectNo-Additional environment variables to set
namestringNo-Friendly name to identify the process
wait_for_outputstringNo-String to wait for in stdout before returning
wait_timeoutnumberNo60Maximum time to wait in seconds
capture_outputbooleanNoTrueCapture stdout/stderr output from the process
log_filestringNo-File path to write process output to
auto_restartbooleanNoFalseAutomatically restart the process if it exits

Output:

FieldTypeDescription
okboolean程序是否成功啟動
pidnumber程序是否成功啟動
process_idstring程序是否成功啟動
namestring程序 ID
commandstring供 process.stop 使用的內部程序識別碼
cwdstring程序名稱
started_atstring執行的命令
initial_outputstring程序啟動的 ISO 時間戳記

Example: Start dev server

yaml
command: npm run dev
cwd: ./frontend
name: frontend-dev
wait_for_output: ready on
wait_timeout: 30

Example: Start Python HTTP server

yaml
command: python -m http.server 8000
name: static-server

Example: Start with environment

yaml
command: node server.js
env: {"PORT": "3000", "NODE_ENV": "test"}
name: api-server
wait_for_output: listening

停止程序

process.stop

停止執行中的背景程序

Parameters:

NameTypeRequiredDefaultDescription
process_idstringNo-Internal process identifier (from process.start)
namestringNo-Friendly name to identify the process
pidnumberNo-System process ID (PID) of the process
signalselect (SIGTERM, SIGKILL, SIGINT)NoSIGTERMSignal to send to the process
timeoutnumberNo10Maximum time to wait in seconds
forcebooleanNoFalseForce kill the process immediately with SIGKILL
stop_allbooleanNoFalseStop all tracked processes

Output:

FieldTypeDescription
okboolean所有程序是否成功停止
stoppedarray所有程序是否成功停止
failedarray已停止的程序資訊列表
countnumber已停止的程序資訊列表

Example: Stop by process ID

yaml
process_id: ${start_result.process_id}

Example: Stop by name

yaml
name: dev-server

Example: Force kill by PID

yaml
pid: 12345
force: true

Example: Stop all processes

yaml
stop_all: true

執行 Shell 命令

shell.exec

執行 shell 命令並擷取輸出

Parameters:

NameTypeRequiredDefaultDescription
commandstringYes-Shell command to execute
cwdstringNo-Directory to execute command in
envobjectNo-Additional environment variables to set
timeoutnumberNo300Maximum time to wait in seconds
shellbooleanNoFalseExecute command through shell (enables pipes, redirects)
capture_stderrbooleanNoTrueCapture stderr separately from stdout
encodingselect (utf-8, ascii, latin-1, utf-16, gbk, big5)Noutf-8Character encoding for the file
raise_on_errorbooleanNoFalseRaise exception if command returns non-zero exit code

Output:

FieldTypeDescription
okboolean命令是否成功執行(結束代碼 0)
exit_codenumber命令是否成功執行(結束代碼 0)
stdoutstring命令是否成功執行(結束代碼 0)
stderrstring命令結束代碼
commandstring標準輸出
cwdstring標準錯誤輸出
duration_msnumber執行的命令

Example: Run npm install

yaml
command: npm install
cwd: ./my-project

Example: Run tests with pytest

yaml
command: python -m pytest tests/ -v
timeout: 120

Example: Git status

yaml
command: git status --porcelain

Example: Build project

yaml
command: npm run build
cwd: ./frontend
env: {"NODE_ENV": "production"}

SSH 執行

ssh.exec

透過 SSH 在遠端伺服器執行命令

Parameters:

NameTypeRequiredDefaultDescription
hoststringYes-SSH 伺服器的主機名稱或 IP
portnumberNo22SSH 埠
usernamestringYes-SSH 使用者名稱
passwordstringNo-SSH 密碼
private_keystringNo-PEM 格式的私鑰
commandstringYes-在遠端伺服器上執行的命令
timeoutnumberNo30命令的逾時秒數

Output:

FieldTypeDescription
okbooleanWhether command succeeded
dataobject

Example: List files on remote server

yaml
host: 192.168.1.100
username: deploy
command: ls -la /var/www

Example: Restart service

yaml
host: 10.0.0.5
username: root
command: systemctl restart nginx

SFTP 下載

ssh.sftp_download

透過 SFTP 從遠端伺服器下載檔案

Parameters:

NameTypeRequiredDefaultDescription
hoststringYes-SSH 伺服器的主機名稱或 IP
portnumberNo22SSH 埠
usernamestringYes-SSH 使用者名稱
passwordstringNo-SSH 密碼
private_keystringNo-PEM 格式的私密金鑰
remote_pathstringYes-遠端伺服器上的檔案路徑
local_pathstringYes-本地機器上的目的地路徑

Output:

FieldTypeDescription
okbooleanWhether download succeeded
dataobject

Example: Download server log

yaml
host: 10.0.0.5
username: deploy
remote_path: /var/log/nginx/access.log
local_path: /tmp/access.log

SFTP 上傳

ssh.sftp_upload

透過 SFTP 上傳檔案到遠端伺服器

Parameters:

NameTypeRequiredDefaultDescription
hoststringYes-SSH 伺服器的主機名稱或 IP
portnumberNo22SSH 埠
usernamestringYes-SSH 使用者名稱
passwordstringNo-SSH 密碼
private_keystringNo-PEM 格式的私鑰
local_pathstringYes-要上傳的本地檔案路徑
remote_pathstringYes-遠端伺服器上的目標路徑
overwritebooleanNoTrue覆蓋現有的遠端檔案

Output:

FieldTypeDescription
okbooleanWhether upload succeeded
dataobject

Example: Upload deployment archive

yaml
host: 10.0.0.5
username: deploy
local_path: /tmp/app.tar.gz
remote_path: /opt/releases/app.tar.gz

執行 E2E 步驟

testing.e2e.run_steps

依序執行端對端測試步驟

Parameters:

NameTypeRequiredDefaultDescription
stepsarrayYes-測試步驟定義陣列
stop_on_failurebooleanNoTrueWhether to stop on failure
timeout_per_stepnumberNo30000Timeout Per Step value

Output:

FieldTypeDescription
okboolean操作是否成功
passednumber操作是否成功
failednumber操作是否成功
resultsarray通過的測試數量

品質閘道

testing.gate.evaluate

根據定義的門檻評估品質指標

Parameters:

NameTypeRequiredDefaultDescription
metricsobjectYes-要評估的指標
thresholdsobjectYes-要評估的指標
fail_on_breachbooleanNoTrueWhether to fail on breach

Output:

FieldTypeDescription
okboolean各指標的門檻值
passedboolean操作是否成功
resultsarray操作是否成功
summarystring通過的測試數量

執行 HTTP 測試

testing.http.run_suite

執行 HTTP API 測試套件

Parameters:

NameTypeRequiredDefaultDescription
testsarrayYes-HTTP 測試定義陣列
base_urlstringNo-Base URL for API requests
headersobjectNo{}HTTP request headers

Output:

FieldTypeDescription
okboolean操作是否成功
passednumber操作是否成功
failednumber操作是否成功
resultsarray通過的測試數量

執行 Linter

testing.lint.run

對原始碼執行程式碼檢查

Parameters:

NameTypeRequiredDefaultDescription
pathsarrayYes-要檢查的檔案或目錄
linterstringNoautoLinter
fixbooleanNoFalseWhether to fix

Output:

FieldTypeDescription
okboolean操作是否成功
errorsnumber操作是否成功
warningsnumber操作是否成功
issuesarray發現的錯誤數量

產生報告

testing.report.generate

產生測試執行報告

Parameters:

NameTypeRequiredDefaultDescription
resultsobjectYes-Results data
formatstringNojsonFormat
titlestringNoTest ReportTitle

Output:

FieldTypeDescription
okboolean操作是否成功
reportstring操作是否成功
formatstring操作是否成功
summaryobject報告內容

執行情境

testing.scenario.run

執行情境式測試(BDD 風格)

Parameters:

NameTypeRequiredDefaultDescription
scenarioobjectYes-包含 given/when/then 的情境定義
contextobjectNo{}Additional context data

Output:

FieldTypeDescription
okboolean包含 given/when/then 的情境定義
passedboolean操作是否成功
stepsarray操作是否成功

安全掃描

testing.security.scan

掃描安全漏洞

Parameters:

NameTypeRequiredDefaultDescription
targetsarrayYes-要掃描的檔案、URL 或路徑
scan_typestringNoallScan Type
severity_thresholdstringNomediumSeverity Threshold

Output:

FieldTypeDescription
okboolean操作是否成功
vulnerabilitiesarray操作是否成功
summaryobject操作是否成功

執行測試套件

testing.suite.run

執行測試集合

Parameters:

NameTypeRequiredDefaultDescription
testsarrayYes-測試定義陣列
parallelbooleanNoFalseWhether to parallel
max_failuresnumberNo0測試定義陣列

Output:

FieldTypeDescription
okboolean0 = 無限制
passednumber0 = 無限制
failednumber操作是否成功
skippednumber通過的測試數量
resultsarray失敗的測試數量

執行單元測試

testing.unit.run

執行單元測試

Parameters:

NameTypeRequiredDefaultDescription
pathsarrayYes-測試檔案或目錄的路徑
patternstringNotest_*.pyPattern
verbosebooleanNoFalseWhether to verbose

Output:

FieldTypeDescription
okboolean操作是否成功
passednumber操作是否成功
failednumber操作是否成功
errorsnumber通過的測試數量
resultsarray失敗的測試數量

視覺比較

testing.visual.compare

比較視覺輸出差異

Parameters:

NameTypeRequiredDefaultDescription
actualstringYes-實際圖片的路徑或 base64
expectedstringYes-實際圖片的路徑或 base64
thresholdnumberNo0.1預期圖片的路徑或 base64
output_diffbooleanNoTrueWhether to output diff

Output:

FieldTypeDescription
okboolean允許的最大差異(0-1)
matchboolean操作是否成功
differencenumber操作是否成功
diff_imagestring比對結果

評估 UI 品質

ui.evaluate

全面的 UI 品質評估,具備多維度評分

Parameters:

NameTypeRequiredDefaultDescription
screenshotstringYes-要評估的截圖路徑或網址
app_typestringNoweb_app應用程式類型
page_typestringNo-正在評估的頁面類型
evaluation_criteriaarrayNo['visual_design', 'usability', 'accessibility', 'consistency', 'responsiveness']要評估的特定標準(預設為全部)
target_audiencestringNo-目標使用者說明
brand_guidelinesstringNo-簡要的品牌指南以供檢查
min_scorenumberNo70通過的最低整體分數(0-100)
api_keystringNo-OpenAI API 金鑰(預設使用 OPENAI_API_KEY 環境變數)

Output:

FieldTypeDescription
okboolean評估是否成功
passedboolean是否通過
overall_scorenumber整體 UI 品質分數(0-100)
scoresobject各評估標準的分數
strengthsarrayUI 優點列表
issuesarray發現的問題
recommendationsarray改善建議
summarystring評估摘要

Example: Evaluate Dashboard

yaml
screenshot: ./screenshots/dashboard.png
app_type: dashboard
page_type: analytics dashboard
target_audience: business analysts
min_score: 75

Example: E-commerce Page Review

yaml
screenshot: ./screenshots/product.png
app_type: e_commerce
page_type: product detail
evaluation_criteria: ["usability", "cta_effectiveness", "visual_design"]

AI 圖片分析

vision.analyze

使用 OpenAI Vision API(GPT-4V)分析圖片

Parameters:

NameTypeRequiredDefaultDescription
imagestringYes-Image file path, URL, or base64 data
promptstringYes-What to analyze in the image
analysis_typeselect (general, ui_review, accessibility, bug_detection, comparison, data_extraction)NogeneralType of analysis to perform
contextstringNo-Additional context about the image
output_formatselect (text, structured, json, checklist)NostructuredFormat of the analysis output
modelstringNogpt-4oSpecific model to use
max_tokensnumberNo1000Maximum tokens in response
api_keystringYes-API key for authentication
header_namestringNoX-API-KeyHTTP header name
detailselect (low, high, auto)NohighLevel of detail for image analysis

Output:

FieldTypeDescription
okboolean分析是否成功
analysisstring分析是否成功
structuredobjectAI 分析結果
modelstring結構化分析資料(如果 output_format 是 structured/json)
tokens_usednumber用於分析的模型

Example: UI Review

yaml
image: ./screenshots/dashboard.png
prompt: Review this dashboard UI. Evaluate: 1) Visual hierarchy 2) Color contrast 3) Button visibility 4) Overall usability. Suggest specific improvements.
analysis_type: ui_review
output_format: structured

Example: Bug Detection

yaml
image: ./screenshots/form.png
prompt: Find any visual bugs, layout issues, or broken elements in this form
analysis_type: bug_detection

Example: Accessibility Check

yaml
image: ./screenshots/page.png
prompt: Evaluate accessibility: color contrast, text readability, button sizes, clear labels
analysis_type: accessibility

比較圖片

vision.compare

比較兩張圖片並識別視覺差異

Parameters:

NameTypeRequiredDefaultDescription
image_beforestringYes-Path to baseline/before image
image_afterstringYes-Path to current/after image
comparison_typeselect (visual_regression, layout_diff, content_diff, full_analysis)Novisual_regressionType of comparison to perform
thresholdnumberNo5Acceptable difference percentage
focus_areasarrayNo-Specific areas to focus on
ignore_areasarrayNo-Areas to ignore (dynamic content, ads, etc.)
modelstringNogpt-4oSpecific model to use
api_keystringYes-API key for authentication
header_namestringNoX-API-KeyHTTP header name

Output:

FieldTypeDescription
okboolean比較是否成功
has_differencesboolean比較是否成功
similarity_scorenumber是否發現顯著差異
differencesarray相似度百分比(0-100)
summarystring識別到的差異列表
recommendationstring比較結果摘要

Example: Visual Regression Test

yaml
image_before: ./screenshots/baseline/home.png
image_after: ./screenshots/current/home.png
comparison_type: visual_regression
threshold: 5

Example: Layout Comparison

yaml
image_before: ./design/mockup.png
image_after: ./screenshots/implementation.png
comparison_type: layout_diff
focus_areas: ["header", "main content"]

Released under the Apache 2.0 License.