Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 87 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,94 @@
# ReqSmith

A powerful command-line API testing tool with hybrid caching and optional AI assistance.

## Features
⚡ **ReqSmith** is a powerful, cross-platform command-line tool designed to make API testing faster, smarter, and more efficient. Whether you’re working with REST, GraphQL, or complex workflows, ReqSmith simplifies the process of sending requests, analyzing responses, and managing test scenarios — all from your terminal.

- **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
Unlike traditional **CLI-based** API clients, ReqSmith comes with hybrid caching (in-memory + disk) for blazing-fast repeated requests, template and environment management for reusable workflows, and a rich output system that highlights and formats responses for maximum readability.

## Requirements
✨ A. Features
----------

- Python 3.9 or higher
- Network connectivity for API testing
* 🔗 **HTTP/REST API Testing** – Supports `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, and `OPTIONS` methods
* 🧩 **GraphQL Support** – Easily run GraphQL queries and mutations
* ⚡ **Hybrid Caching** – Memory + disk-based caching for optimal speed and persistence
* 📝 **Template Management** – Save, manage, and reuse request templates
* 🌍 **Environment Variables** – Seamlessly switch between dev, staging, and prod environments
* ⏳ **Request History** – Track, review, and replay past requests
* 🎨 **Rich Output** – Color-coded responses with pretty-printed `JSON/XML` formatting
* 🤖 **AI Assistance (optional)** – Google Gemini-powered features for validation, suggestions, and analysis
* 🖥️ **Cross-Platform** – Works on **Windows**, **macOS**, and **Linux**

## Installation

```bash
pip install reqsmith
```

## Quick Start
<img width="1879" height="954" alt="image" src="https://github.com/user-attachments/assets/ea8041b5-eabe-4159-b263-edcbdda6dafc" />

```bash
# 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": "[email protected]"}'
📦 B. Requirements
---------------

# Save request as template
reqsmith save-template user-create --method POST --url https://api.example.com/users -d '{"name": "{{name}}", "email": "{{email}}"}'
* Python **3.9 or higher**
* Network connectivity for API testing
* (Optional) [**Gemini API Key**](https://aistudio.google.com/app/api-keys) for AI features


# Use template with variables
reqsmith use-template user-create --var name="Jane" --var email="[email protected]"
🚀 C. Installation
---------------
```
pip install reqsmith
```

## Configuration

ReqSmith stores configuration in `~/.reqsmith/config.json`. You can customize:
⚙️ D. Configuration
----------------

- Storage settings (cache sizes, paths)
- Network settings (timeouts, retries)
- Output formatting preferences
- AI features (Gemini API key)
Customizable options include:

## AI Features

ReqSmith includes powerful AI assistance using Google's Gemini API for enhanced API testing.

### Setup AI Features
* **Storage**: cache size, cache location
* **Network**: timeouts, retries, proxy settings
* **Output**: `JSON/XML` formatting preferences, color options
* **AI**: `Gemini API key` and toggle for AI-powered features

1. **Get a Gemini API Key:**
- Visit [Google AI Studio](https://makersuite.google.com/app/apikey)
- Sign in with your Google account
- Create a new API key
🤖 E. AI Assistance
----------------

2. **Configure the API Key:**
ReqSmith integrates with **Google’s Gemini API** for smarter API testing.

**Option A: Using ReqSmith configuration (recommended)**
```bash
# Run the interactive setup
python dev_scripts/setup_ai.py

# Or configure directly
reqsmith config set ai.gemini_api_key "your-api-key-here"
```
### Setup AI Features

**Option B: Environment variable**
```bash
export GEMINI_API_KEY="your-api-key-here"
```
1. **Get a Gemini API Key:**

* Visit [**Google AI Studio**](https://aistudio.google.com/app/api-keys)
* Sign in with your Google account
* Generate a new API key

**Option A: Using ReqSmith config (recommended)**
```
# Run the interactive setup
python scripts/setup_ai.py
Comment thread
tulu-g559 marked this conversation as resolved.

3. **Test AI Integration:**
```bash
python dev_scripts/test_ai_integration.py
```
# Or configure directly
reqsmith config set ai.gemini_api_key "your-api-key-here"
```
**Option B: Using environment variable export**
```
export GEMINI_API_KEY="your-api-key-here"
```
Comment thread
tulu-g559 marked this conversation as resolved.



### 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
* 🔑 **Smart Header Suggestions** – Automatically suggest headers for APIs
* ✅ **JSON Validation** – Validate and debug JSON with detailed explanations
* 📖 **Status Code Explanations** – Human-friendly descriptions of HTTP errors
* 🧪 **Test Scenario Generation** – Generate test cases for your endpoints
* 🔍 **API Analysis** – Detect patterns and provide optimization suggestions


### Usage Examples
### AI Usage Examples

```bash
```
# Get AI-suggested headers
reqsmith request get https://api.github.com/user --ai-headers

Expand All @@ -106,20 +102,34 @@ reqsmith explain-status 404
reqsmith analyze https://api.example.com/users --generate-tests
```

## Development

```bash
# Clone the repository
git clone https://github.com/VesperAkshay/reqsmith.git
cd reqsmith
🛠️ F. Development
---------------

# Install in development mode
Clone and install in development mode:
```
git clone https://github.com/VesperAkshay/reqsmith.git
cd reqsmith
```
```
pip install -e .
```

# Run tests
Run unit tests:
```
pytest
```

## License

MIT License - see LICENSE file for details.
🗺️ G. Roadmap
-----------

* Support for WebSocket testing
* AI-assisted contract testing
* Enhanced CLI autocomplete
* Plugin system for custom integrations


📄 License
----------

This project is licensed under the **MIT License** – see the LICENSE file for details.