sreq
Service-aware API client with automatic credential resolution.
sreq eliminates the overhead of manually fetching credentials from multiple sources when testing APIs. Just specify the service name and environment — sreq handles the rest.
The Problem
You want to test an API endpoint on your auth service:
POST /api/v1/users on auth-service
Current workflow:
- Open Consul → find auth-service base URL for dev
- Open AWS Secrets Manager → find auth-service credentials
- Copy-paste into Postman/curl
- Repeat for staging... repeat for prod...
This context-switching kills productivity and introduces errors.
The Solution
sreq run POST /api/v1/users -s auth-service -e dev -d '{"name":"test"}'
sreq automatically:
- Fetches base URL from Consul
- Fetches credentials from AWS Secrets Manager
- Makes the authenticated request
- Caches credentials for faster subsequent requests
Key Features
Service-Aware
Pass the service name, sreq resolves everything else. No more hunting for URLs and credentials.
sreq run GET /api/v1/health -s billing-service -e prod
Multi-Provider Support
Pull credentials from multiple sources in a single request:
- Consul KV — Base URLs, usernames, configuration
- AWS Secrets Manager — Passwords, API keys, sensitive data
- Environment Variables — Direct env var resolution for CI/CD and containers
- Dotenv Files — Read from
.envfiles for local development - HashiCorp Vault — Coming soon
Environment Switching
Seamlessly switch between dev, staging, and production:
sreq run GET /status -s auth -e dev # Development
sreq run GET /status -s auth -e staging # Staging
sreq run GET /status -s auth -e prod # Production
Offline Mode
Cache credentials locally for faster requests and offline use:
sreq sync dev # Cache dev credentials
sreq run GET /api -s auth --offline # Works without network
Request History
Track, replay, and export previous requests:
sreq history # View recent requests
sreq history 5 --replay # Replay request #5
sreq history 5 --curl # Export as curl command
Interactive TUI
Build and execute requests with a terminal UI:
sreq tui
Quick Example
1. Initialize configuration:
sreq init
2. Configure providers:
sreq auth
3. Add a service:
sreq service add auth-service --consul-key auth --aws-prefix auth-svc
4. Make requests:
sreq run GET /api/v1/users -s auth-service -e dev
Why "sreq"?
service + request = sreq
A CLI tool that makes service-aware HTTP requests with automatic credential resolution.
Next Steps
- Installation — Get sreq installed
- Getting Started — Your first request in minutes
- Configuration — Deep dive into config options
- Providers — Provider-specific setup guides