360 Secure SkillHub
360 安全技能中心

Api Tester Cn

这是一个 Bash 脚本形式的 API 测试与调试工具集,支持检查端点状态码与响应时间、校验 JSON 结构、按 HTTPS/CORS/缓存等最佳实践做 lint、对比两个接口响应、格式化 JSON、JSON 与 CSV 互转、保存并运行请求模板,以及查询、检索、统计和导出历史记录,数据保存在本地目录。

bytesagain
bytesagain
热度 63.06
最近更新 2026-03-27 14:01:35
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景: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