@meshtest/cli
v0.3.0
Published
Live API testing for the AI era — import OpenAPI/Postman specs, run live regression suites, detect drift against stored baselines
Maintainers
Readme
@meshtest/cli
Live API testing for the AI era — import OpenAPI/Postman specs, run live regression suites, detect drift against stored baselines.
meshtest is a CLI that turns any OpenAPI 3.x spec or Postman v2.1 collection into runnable, source-controlled regression tests against a live API. It auto-detects auth, generates CRUD chains with capture variables, and snapshots responses as baselines so you can diff against future runs.
If you want AI agents (Claude Desktop, Cursor, etc.) to drive this same engine over the Model Context Protocol, install @meshtest/server alongside it.
Install
# global (use the meshtest binary anywhere)
npm install -g @meshtest/cli
# project-local
npm install --save-dev @meshtest/cli
pnpm add -D @meshtest/cliNode 18+ required.
Quickstart
# 1. Scaffold config, .env.example, and meshtest.auth.yaml
meshtest init
# 2. Import an OpenAPI spec or Postman collection into a runnable manifest
meshtest generate --from openapi ./openapi.yaml -o meshtest.yaml
# 3. Run live tests against your staging API
meshtest run --env staging
# 4. Record a baseline and diff future runs against it
meshtest diff --record
meshtest diff # next time, fails if responses driftedWhat you get
- Auto-imports — OpenAPI 3.x + Postman v2.1 → ready-to-run YAML manifest
- Auth auto-detection — bearer, api_key, basic, header, and OAuth2 client-credentials flows extracted from the source spec
- CRUD capture chains — POST → capture
id→ use in subsequent GET/PATCH/DELETE - Setup/teardown hooks — seed and clean up test data per suite
- Built-in template vars —
run_id,timestamp,iso_date,random_int,random_string - Drift detection — store response snapshots, diff future runs, fail CI on unexpected changes
- Sensitive-data stripping —
baseline.strip_on_recordredacts secrets before they're written to disk - Auto-discovery —
--allfinds every*.meshtest.yamlacross configured registries
Example manifest
service:
name: petstore
base_url: https://api.petstore.example.com
auth:
type: bearer
token: "${PETSTORE_TOKEN}"
vars:
user_id: "${USER_ID}"
tests:
- suite: Pet lifecycle
tests:
- name: Create a pet
method: POST
path: /pets
body:
name: "test-{{ vars.run_id }}"
expect: { status: 201 }
capture:
pet_id: "$.id"
- name: Get the created pet
method: GET
path: /pets/{{ captured.pet_id }}
expect: { status: 200 }
- name: Delete the pet
method: DELETE
path: /pets/{{ captured.pet_id }}
expect: { status: 204 }Documentation
Full reference, guides, and recipes: meshtest-docs.vercel.app
Quick links:
- Quickstart — 60-second walkthrough
- CLI reference — every command and flag
- Manifest schema — every YAML field
- Authentication guide — bearer, api-key, OAuth2, profiles
- Test data management — capture chains, setup/teardown, built-in vars
- Baselines & drift — record, diff, strip-on-record
License
See LICENSE. Free for personal, commercial, and internal business use. Source is not redistributed.
— Mukul Kumar · github.com/developerKumar
