APIgentMan is an agentic CLI tool for testing and monitoring APIs โ like Postman but lighter, autonomous, and terminal-first. It can run API test collections, monitor performance, detect anomalies, and even generate new tests via an LLM.
- Run API collections (YAML format) from the CLI
- Assertions on status codes, response time, and payloads
- Performance tracking with simple anomaly detection
- LLM-powered test generation (
gen-tests) - Monitor mode for repeated runs
- Rich CLI with colored output and reports
.
โโโ main.py # APIgentMan CLI entrypoint
โโโ sample_test_app.py # Example FastAPI app to test against
โโโ sample.yaml # Sample test collection
โโโ README.md # You are here
git clone https://github.com/dhirajdj30/APIgentMan.git
cd apigentman
uv add fastapi groq httpx pydantic python-dotenv pyyaml rich typer uvicornExport your OpenAI key:
export OPENAI_API_KEY="sk-xxxxx"Run the demo FastAPI server:
uvicorn sample_test_app:app --reload --port 8000This exposes:
GET /pingGET /items/{item_id}POST /items
Execute the sample test collection:
python main.py run sample.yamlpython main.py gen-tests --prompt "Generate tests for a weather API with /current and /forecast endpoints"python main.py monitor sample.yaml --interval 30tests:
- name: ping test
method: GET
url: http://localhost:8000/ping
expect_status: 200
- name: get item
method: GET
url: http://localhost:8000/items/1
expect_status: 200
expect_body_contains: "item"
- name: create item
method: POST
url: http://localhost:8000/items
json: {"name": "Book"}
expect_status: 200
expect_body_contains: "Book"- Export performance metrics (Prometheus/Grafana integration)
- Slack/email alerts on anomalies
- Load testing support
- Self-healing test logic
- OpenAPI โ test suite auto-generation