Command-line API testing tool with hybrid caching and optional AI assistance
Project description
ReqSmith
A powerful command-line API testing tool with hybrid caching and optional AI assistance.
Features
- HTTP/REST API Testing: Support for GET, POST, PUT, PATCH, DELETE, OPTIONS methods
- GraphQL Support: Native GraphQL query and mutation testing
- Hybrid Caching: Memory + disk-based caching for improved performance
- Template Management: Save and reuse request templates
- Environment Variables: Manage different environments (dev, staging, prod)
- Request History: Track and replay previous requests
- Rich Output: Color-coded responses with JSON/XML formatting
- AI Assistance: Optional Gemini AI integration for request validation and suggestions
- Cross-Platform: Works on Windows, macOS, and Linux
Requirements
- Python 3.9 or higher
- Network connectivity for API testing
Installation
pip install reqsmith
Quick Start
# Simple GET request
reqsmith get https://api.example.com/users
# POST request with JSON body
reqsmith post https://api.example.com/users -d '{"name": "John", "email": "john@example.com"}'
# Save request as template
reqsmith save-template user-create --method POST --url https://api.example.com/users -d '{"name": "{{name}}", "email": "{{email}}"}'
# Use template with variables
reqsmith use-template user-create --var name="Jane" --var email="jane@example.com"
Configuration
ReqSmith stores configuration in ~/.reqsmith/config.json. You can customize:
- Storage settings (cache sizes, paths)
- Network settings (timeouts, retries)
- Output formatting preferences
- AI features (Gemini API key)
AI Features
ReqSmith includes powerful AI assistance using Google's Gemini API for enhanced API testing.
Setup AI Features
-
Get a Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
-
Configure the API Key:
Option A: Using ReqSmith configuration (recommended)
# Run the interactive setup python dev_scripts/setup_ai.py # Or configure directly reqsmith config set ai.gemini_api_key "your-api-key-here"
Option B: Environment variable
export GEMINI_API_KEY="your-api-key-here"
-
Test AI Integration:
python dev_scripts/test_ai_integration.py
AI Capabilities
- Smart Header Suggestions: Get appropriate headers for API endpoints
- JSON Validation: Intelligent validation with detailed explanations
- Status Code Explanations: Natural language explanations of HTTP status codes
- Test Scenario Generation: AI-generated test scenarios for endpoints
- API Analysis: Intelligent analysis of API endpoints and patterns
Usage Examples
# Get AI-suggested headers
reqsmith request get https://api.github.com/user --ai-headers
# AI-powered JSON validation
reqsmith validate --json '{"name": "test"}' --ai-suggest
# Natural language status explanations
reqsmith explain-status 404
# Generate test scenarios
reqsmith analyze https://api.example.com/users --generate-tests
Development
# Clone the repository
git clone https://github.com/VesperAkshay/reqsmith.git
cd reqsmith
# Install in development mode
pip install -e .
# Run tests
pytest
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reqsmith-0.1.0.tar.gz.
File metadata
- Download URL: reqsmith-0.1.0.tar.gz
- Upload date:
- Size: 162.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e4add18600ffc24724a071b1782e4d3a091d423e8c987a422dddcbcbf8e1752
|
|
| MD5 |
ba4c43af7beda037ec486567e8c1a047
|
|
| BLAKE2b-256 |
46705212618cacdefaac683d6b8c4d4a916afb340abd739b7fd26ba5fcd571cc
|
Provenance
The following attestation bundles were made for reqsmith-0.1.0.tar.gz:
Publisher:
cicd.yml on VesperAkshay/reqsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reqsmith-0.1.0.tar.gz -
Subject digest:
6e4add18600ffc24724a071b1782e4d3a091d423e8c987a422dddcbcbf8e1752 - Sigstore transparency entry: 543110404
- Sigstore integration time:
-
Permalink:
VesperAkshay/reqsmith@1c8861696d72630b2b898b3ed4affd6a022de8f1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VesperAkshay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@1c8861696d72630b2b898b3ed4affd6a022de8f1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file reqsmith-0.1.0-py3-none-any.whl.
File metadata
- Download URL: reqsmith-0.1.0-py3-none-any.whl
- Upload date:
- Size: 146.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cdd93deb3604b75a38f9a973a2c311ae7c1b902ed805a9540a056865205556e
|
|
| MD5 |
5dc28ae88e7ccf78ee66e67a43cbbec0
|
|
| BLAKE2b-256 |
f6ddbf60e0a25122dee900fb113f828984c5dce93a7d8c5732506ecb526668f4
|
Provenance
The following attestation bundles were made for reqsmith-0.1.0-py3-none-any.whl:
Publisher:
cicd.yml on VesperAkshay/reqsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reqsmith-0.1.0-py3-none-any.whl -
Subject digest:
0cdd93deb3604b75a38f9a973a2c311ae7c1b902ed805a9540a056865205556e - Sigstore transparency entry: 543110412
- Sigstore integration time:
-
Permalink:
VesperAkshay/reqsmith@1c8861696d72630b2b898b3ed4affd6a022de8f1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VesperAkshay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@1c8861696d72630b2b898b3ed4affd6a022de8f1 -
Trigger Event:
push
-
Statement type: