Skip to main content

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

  1. Get a Gemini API Key:

  2. 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"
    
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reqsmith-0.1.0.tar.gz (162.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reqsmith-0.1.0-py3-none-any.whl (146.3 kB view details)

Uploaded Python 3

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

Hashes for reqsmith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6e4add18600ffc24724a071b1782e4d3a091d423e8c987a422dddcbcbf8e1752
MD5 ba4c43af7beda037ec486567e8c1a047
BLAKE2b-256 46705212618cacdefaac683d6b8c4d4a916afb340abd739b7fd26ba5fcd571cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for reqsmith-0.1.0.tar.gz:

Publisher: cicd.yml on VesperAkshay/reqsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for reqsmith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cdd93deb3604b75a38f9a973a2c311ae7c1b902ed805a9540a056865205556e
MD5 5dc28ae88e7ccf78ee66e67a43cbbec0
BLAKE2b-256 f6ddbf60e0a25122dee900fb113f828984c5dce93a7d8c5732506ecb526668f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for reqsmith-0.1.0-py3-none-any.whl:

Publisher: cicd.yml on VesperAkshay/reqsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page