360 Secure SkillHub
360 安全技能中心

Api Tester Cn

这是一款终端API测试调试工具,核心功能涵盖API端点状态检查、JSON响应验证、最佳实践合规检测、多版本API响应比对,还支持请求模板管理、测试历史查询与导出等。适合接口健康巡检、版本迭代验证、API合规审计等场景,通过终端命令调用,输出结构化状态数据、响应分析或统计报告,满足开发者日常API调试测试需求。

bytesagain
bytesagain
热度 63.05
最近更新 2026-03-27 14:01:35
分类:开发依赖:代码执行 / 读写文件应用场景:API 集成 / 调试排错 / 数据处理 / 报告撰写

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add api-tester-cn
Metadata
version
3.0.2
name
api-tester-cn
description
Test and debug API endpoints from terminal. Use when checking endpoint status, validating JSON responses, comparing API versions, or running best-practice lints.
author
BytesAgain
homepage
https://bytesagain.com
source
https://github.com/bytesagain/ai-skills

api-tester-cn

API testing and debugging toolkit — check endpoint status codes, validate JSON responses, lint for best practices (HTTPS, CORS, caching), compare two API responses, manage request templates, and export test history.

Commands

check

Test an API endpoint — shows HTTP status code, response time, content type, and server header.

scripts/script.sh check "https://api.github.com"

validate

Fetch a URL and validate the JSON response. Shows structure info (keys, types, array lengths).

scripts/script.sh validate "https://jsonplaceholder.typicode.com/posts/1"

lint

Check an API endpoint for best practices — HTTPS, CORS headers, content-type, rate limiting, and caching.

scripts/script.sh lint "https://api.example.com/v1/users"

diff

Compare JSON responses from two API endpoints side by side.

scripts/script.sh diff "https://api.v1.example.com/data" "https://api.v2.example.com/data"

format

Pretty-print JSON from a file or stdin.

scripts/script.sh format response.json
cat data.json | scripts/script.sh format

convert

Convert between JSON and CSV formats.

scripts/script.sh convert json2csv data.json
scripts/script.sh convert csv2json data.csv

template

Manage reusable request templates — save, list, and run API calls.

scripts/script.sh template list
scripts/script.sh template save "github-user" GET "https://api.github.com/users/octocat"
scripts/script.sh template run "github-user"

report

Generate a summary report of all tests run — counts by type, recent activity.

scripts/script.sh report

recent

Show the most recent test entries from history.

scripts/script.sh recent 20

search

Search test history by URL or keyword.

scripts/script.sh search "github"

stats

Show usage statistics — total requests, template count, date range.

scripts/script.sh stats

export

Export test history in json, csv, or txt format.

scripts/script.sh export json

status

Show tool status — version, data directory, entry count.

scripts/script.sh status

help

scripts/script.sh help

version

scripts/script.sh version

Examples

# Quick API health check
scripts/script.sh check "https://api.github.com"
scripts/script.sh validate "https://jsonplaceholder.typicode.com/posts"
scripts/script.sh lint "https://api.github.com"

# Compare API versions
scripts/script.sh diff "https://api.v1.example.com/data" "https://api.v2.example.com/data"

# Template workflow
scripts/script.sh template save "posts" GET "https://jsonplaceholder.typicode.com/posts"
scripts/script.sh template run "posts"

Configuration

Variable Required Description
API_TESTER_CN_DIR No Data directory (default: ~/.api-tester-cn/)

Data Storage

All data saved in ~/.api-tester-cn/:

  • history.log — Test history log
  • templates/ — Saved request templates
  • responses/ — Cached responses

Requirements

  • bash 4.0+
  • curl (for HTTP requests)
  • python3 (for JSON parsing)

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com