API testing that lives in git.
Rivet is a modern API testing tool designed for command-line workflows. It allows you to send HTTP requests, run test suites, import from Postman/Insomnia, generate coverage reports, and make gRPC calls - all with beautiful terminal output.
- 🚀 Send Requests: Send individual HTTP requests with pretty output and JSON syntax highlighting
- 🧪 Run Test Suites: Execute test suites with parallel execution, data-driven testing, and rich reporting
- 📊 Generate Reports: Export results in JSON, JUnit, and HTML formats
- 📝 OpenAPI Integration: Generate tests from OpenAPI specs and track endpoint coverage
- 📥 Import Support: Import collections from Postman, Insomnia, Bruno, and cURL
- 🔗 gRPC Support: Make gRPC unary calls with metadata and field assertions
- 📈 GraphQL Ready: Full GraphQL support via HTTP with query validation and performance testing
- ⚡ Performance Testing: Load test APIs with multiple patterns (constant, ramp-up, spike)
- 🎨 Beautiful Terminal UI: Spinners, progress bars, and colored output that works great in CI/CD
Once accepted into Homebrew/homebrew-core, install with:
brew install rivetUntil then, you can install directly from this repo:
brew install --formula https://raw.githubusercontent.com/szabadkai/rivet-cli/main/Formula/rivet.rbDownload the latest release for your platform:
macOS (Apple Silicon):
curl -L https://github.com/szabadkai/rivet-cli/releases/latest/download/rivet-macos-arm64 -o rivet
chmod +x rivet
sudo mv rivet /usr/local/bin/macOS (Intel):
curl -L https://github.com/szabadkai/rivet-cli/releases/latest/download/rivet-macos-x86_64 -o rivet
chmod +x rivet
sudo mv rivet /usr/local/bin/Linux:
curl -L https://github.com/szabadkai/rivet-cli/releases/latest/download/rivet-linux-x86_64 -o rivet
chmod +x rivet
sudo mv rivet /usr/local/bin/Windows:
Download rivet-windows-x86_64.exe from the latest release and add to your PATH.
# Requires Rust 1.70+
git clone https://github.com/szabadkai/rivet-cli
cd rivet-cli
cargo build --releaseCommon dev tasks are available via Cargo aliases/xtask:
# One-time setup (git hooks)
cargo dev-setup
# Build / Test / Lints
cargo build
cargo test
cargo fmt
cargo fmt-check
cargo clippy
# Run all checks like CI
cargo ci
# Start a release (maintainers)
cargo release patch # or minor/majorrivet send GET https://httpbin.org/jsonrivet send POST https://httpbin.org/post \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"name": "test"}'# Basic test run
rivet run tests/example.rivet.yaml
# With HTML report (auto-opens in browser)
rivet run tests/example.rivet.yaml --report html
# With custom template and multiple formats
rivet run tests/example.rivet.yaml --report html,json --template compact --parallel 8Rivet includes several beautiful HTML report templates:
detailed- Professional, comprehensive business reportscompact- Interactive, filterable, space-efficient with expandable test detailschatty- Friendly, conversational with storytelling elementssimple- Clean, minimal reports with basic metrics
rivet run tests/ --report html --template compact --openRivet supports user configuration via ~/.rivet/config.json:
{
"reports": {
"auto_open_browser": true,
"default_template": "compact",
"default_formats": ["html"]
}
}Default Settings:
- Auto-opens HTML reports in browser
- Uses the interactive
compacttemplate by default - Generates HTML reports by default
This file is automatically created on first run with sensible defaults.
rivet gen --spec api-spec.yaml --out tests/rivet import postman collection.json --out tests/rivet grpc --proto ./protos --call svc.Users/GetUser --data '{"id": 42}'GraphQL is fully supported using HTTP requests. Create test files for GraphQL APIs:
# Run GraphQL tests
rivet run tests/graphql/
# Performance test GraphQL endpoint
rivet perf tests/graphql/ --concurrent 10 --duration 30s
# Try the included examples
rivet run examples/graphql/See examples/graphql/ for comprehensive GraphQL testing examples.
Rivet uses YAML files for test definitions:
name: User API Tests
env: ${RIVET_ENV:dev}
vars:
baseUrl: ${BASE_URL:https://api.example.com}
token: ${TOKEN}
tests:
- name: Get user
request:
method: GET
url: "{{baseUrl}}/users/{{userId}}"
headers:
Authorization: "Bearer {{token}}"
expect:
status: 200
jsonpath:
"$.id": "{{userId}}"
dataset:
file: data/users.csv
parallel: 4name: GraphQL API Tests
vars:
baseUrl: ${BASE_URL:https://api.example.com}
token: ${TOKEN}
tests:
- name: Get users with GraphQL
request:
method: POST
url: "{{baseUrl}}/graphql"
headers:
Content-Type: application/json
Authorization: "Bearer {{token}}"
body: |
{
"query": "query GetUsers($limit: Int) { users(limit: $limit) { id name email createdAt } }",
"variables": { "limit": 10 }
}
expect:
status: 200
jsonpath:
"$.data.users": "exists"
"$.data.users[0].id": "*"
"$.errors": null
- name: Create user mutation
request:
method: POST
url: "{{baseUrl}}/graphql"
headers:
Content-Type: application/json
Authorization: "Bearer {{token}}"
body: |
{
"query": "mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { id name email } }",
"variables": {
"input": {
"name": "{{userName}}",
"email": "{{userEmail}}"
}
}
}
expect:
status: 200
jsonpath:
"$.data.createUser.id": "exists"
"$.data.createUser.email": "{{userEmail}}"
"$.errors": null
dataset:
file: data/users.csv # columns: userName, userEmail
parallel: 4rivet send <METHOD> <URL>- Send a single HTTP requestrivet run <file|dir>- Run test suitesrivet gen --spec <openapi.yaml>- Generate tests from OpenAPI specrivet coverage --spec <openapi.yaml> --from <reports>- Generate coverage reportrivet import <tool> <file>- Import from other toolsrivet grpc --proto <dir> --call <service/method>- Make gRPC calls
rivet-cli/
├── src/
│ ├── commands/ # Command implementations
│ ├── ui/ # Terminal UI components
│ ├── config.rs # Configuration structures
│ ├── http.rs # HTTP client utilities
│ ├── grpc.rs # gRPC client utilities
│ ├── report.rs # Report generation
│ └── utils.rs # Common utilities
├── tests/ # Example test files
├── examples/ # Example configurations
├── data/ # Test data files
└── reports/ # Generated reports
MIT License - see LICENSE file for details.