saffron-http-client

Crates.iosaffron-http-client
lib.rssaffron-http-client
version0.1.5
created_at2025-12-08 20:13:34.273834+00
updated_at2025-12-09 16:46:49.759374+00
descriptionA fast, lightweight command-line HTTP client for testing and debugging APIs
homepage
repositoryhttps://github.com/Vitorhenriquesilvadesa/Saffron
max_upload_size
id1974332
size43,332
Vitor Henrique Silva de SΓ‘ (Vitorhenriquesilvadesa)

documentation

README

Saffron πŸ¦€

Saffron is a fast, lightweight command-line HTTP client written in Rust. Test APIs, debug endpoints, and manage request collections β€” all from your terminal.

Rust License: MIT


✨ Features

  • πŸš€ Fast & Lightweight: Single binary, minimal dependencies, <5MB
  • πŸ“¦ Collections: Organize requests into reusable collections
  • πŸ”„ Import from External Tools: Import collections from Insomnia (Postman coming soon)
  • 🌍 Environments: Manage variables across dev/staging/production
  • πŸ“œ Request History: Automatic tracking with 100-entry rolling cache
  • πŸ”§ Template Variables: Use {{variables}} in URLs, headers, and body
  • 🎨 Colored Output: Beautiful, readable terminal responses
  • πŸ’Ύ Persistent Storage: All data stored locally in ~/.saffron/
  • πŸ”’ Privacy-First: No cloud sync, everything runs locally
  • ⚑ Zero Configuration: Works out of the box

πŸš€ Quick Start

Installation

From source:

git clone https://github.com/yourusername/saffron.git
cd saffron
cargo build --release

The binary will be in target/release/saffron.exe.

From crates.io (coming soon):

cargo install saffron

Your First Request

# Simple GET request
saffron send https://api.github.com

# POST with JSON
saffron send https://api.example.com/users `
  --method POST `
  --header "Content-Type: application/json" `
  --body '{"name": "Alice", "email": "alice@example.com"}'

# Using environment variables
saffron env set production api_url https://api.prod.com
saffron send {{api_url}}/users

πŸ“š Documentation


πŸ’‘ Core Concepts

Collections

Organize related requests:

# Create collection
saffron collection new github-api

# Add request
saffron collection add github-api get-user `
  --method GET `
  --url https://api.github.com/users/octocat

# Run request from collection
saffron send --from-collection "github-api/get-user"

# Import from Insomnia
saffron collection import insomnia-export.json

# List all collections
saffron collection list

Environments

Manage variables across environments:

# Set variables
saffron env set development base_url https://api.dev.com
saffron env set production base_url https://api.prod.com

# Switch environments
saffron env use production

# Use in requests
saffron send {{base_url}}/users

Request History

Automatic tracking of all requests:

# List history
saffron history list

# Show details
saffron history show abc123

# Rerun a request
saffron history rerun abc123

# Clear history
saffron history clear

🎯 Why Saffron?

Feature Saffron curl Postman
CLI-first βœ… βœ… ❌
Collections βœ… ❌ βœ…
Environments βœ… ❌ βœ…
Request History βœ… ❌ βœ…
Template Variables βœ… ❌ βœ…
Lightweight βœ… βœ… ❌
Scriptable βœ… βœ… ⚠️
Privacy βœ… βœ… ⚠️
Open Source βœ… βœ… ❌

πŸ—οΈ Architecture

Saffron is built as a modular Rust workspace:

saffron/
β”œβ”€β”€ saffron-core     # Domain models (requests, responses, collections)
β”œβ”€β”€ saffron-http     # HTTP client implementation (ureq-based)
β”œβ”€β”€ saffron-data     # Custom JSON parser (no external deps)
β”œβ”€β”€ saffron-cli      # Command-line interface (clap-based)
β”œβ”€β”€ saffron-ui       # GUI (planned)
└── saffron-utils    # Shared utilities

See Architecture for details.


πŸ§ͺ Testing

Saffron has comprehensive test coverage:

# Run all tests
cargo test

# Run specific crate tests
cargo test -p saffron-core
cargo test -p saffron-http
cargo test -p saffron-data

Current test counts:

  • saffron-core: 82 tests
  • saffron-data: 33 tests
  • saffron-http: 18 tests
  • Total: 133 tests

πŸ—ΊοΈ Roadmap

βœ… Completed (v0.1.0)

  • Core HTTP client
  • CLI interface
  • Collections management
  • Environment variables
  • Request history
  • Template variable resolution
  • Colored terminal output
  • Comprehensive documentation

🚧 In Progress

  • GUI implementation (saffron-ui)
  • Import/export (Postman, Insomnia)
  • SSL verification control
  • Proxy support

πŸ“‹ Planned

  • GraphQL support
  • WebSocket support
  • Request chaining
  • Response assertions
  • Pre/post-request scripts
  • Code generation (curl, Python, etc.)
  • Team sync (Git-based)

🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Quick checklist:

  • Fork the repository
  • Create a feature branch
  • Write tests
  • Follow coding standards
  • Submit a pull request

πŸ“ License

Saffron is licensed under the MIT License.


πŸ™ Acknowledgments

Built with these excellent Rust crates:


πŸ“§ Contact


Made with ❀️ and Rust

Commit count: 0

cargo fmt