Thanks to visit codestin.com
Credit goes to github.com

Skip to content

binbandit/curly

Repository files navigation

Curly - The Next Generation HTTP Client

Curly is a modern, intuitive HTTP client designed to reimagine the curl command line utility with beautiful output formatting and powerful features.

Features

Beautiful Output

  • Syntax-highlighted JSON and XML responses
  • Color-coded HTTP status codes (green: 2xx, yellow: 3xx, red: 4xx/5xx)
  • Formatted headers with color coding
  • Progress bars for downloads

🚀 Modern HTTP Support

  • HTTP/1.1 and HTTP/2
  • Automatic compression (gzip, brotli, deflate)
  • Cookie jar support with automatic persistence
  • Built-in timeout handling
  • Request timing information

🎯 Intuitive Commands

  • Simple, memorable syntax
  • Environment variable support
  • .env file loading
  • Request sequencing (execute multiple requests in order)
  • Request collections (coming soon)

Installation

cargo install curly

Or build from source:

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

Usage

Simple GET Request

# Simple GET request
curly https://api.example.com/users

# Or with explicit command
curly get https://api.example.com/users

Request with Headers

curly get https://api.example.com/users \
  -H "Authorization: Bearer token" \
  -H "Accept: application/json"

POST Request with JSON

curly post https://api.example.com/users \
  --json '{"name": "John Doe", "email": "[email protected]"}'

POST Request with Form Data

curly post https://api.example.com/login \
  -F "username=john" \
  -F "password=secret"

PUT Request

curly put https://api.example.com/users/123 \
  --data '{"name": "Jane Doe"}'

DELETE Request

curly delete https://api.example.com/users/123 \
  -H "Authorization: Bearer token"

Save Response to File

curly get https://api.example.com/data.json -o response.json

Show Response Headers

# Include response headers in output
curly get https://api.example.com/users -i

# Show only headers (no body)
curly get https://api.example.com/users -I

Request Timing

# Show request timing information
curly get https://api.example.com/users -t

# Output shows DNS lookup, TCP connect, TLS handshake, etc.

Request Sequences

# Execute a sequence of requests from a TOML file
curly seq api-test.toml --var "API_TOKEN=secret"

# Example sequence file (api-test.toml):
# [[requests]]
# name = "Login"
# method = "POST"
# url = "https://api.example.com/login"
# body = '{"username": "user", "password": "pass"}'
# 
# [[requests]]
# name = "Get Profile"
# method = "GET"
# url = "https://api.example.com/profile"
# headers = { Authorization = "Bearer {token}" }

Environment Variables

# Load from .env file
curly get https://api.example.com/users --env-file .env

# Or use system environment variables
API_TOKEN=secret curly get https://api.example.com/users \
  -H "Authorization: Bearer $API_TOKEN"

Cookies

# Cookies are enabled by default and persisted between requests
curly get https://example.com/login
curly get https://example.com/protected  # Automatically sends cookies

# Disable cookies for a single request
curly get https://example.com --no-cookies

# Enable cookies explicitly (if disabled in config)
curly get https://example.com --cookies

Configuration

# Show current configuration
curly config show

# Set configuration values (coming soon)
curly config set timeout 60
curly config set follow_redirects true
curly config set cookies_enabled false

Global Options

  • -v, --verbose - Enable verbose output
  • -q, --quiet - Suppress all output except errors
  • -r, --raw - Output raw response without formatting
  • -i, --include - Include response headers in output
  • -I, --head - Show response headers only
  • -t, --timing - Show request timing information
  • --env-file <path> - Load environment variables from file

Roadmap

  • Beautiful JSON/XML syntax highlighting
  • Request timing information
  • Request sequencing from TOML/JSON files
  • Environment variable and .env support
  • Progress bars for downloads
  • Request collections and workspaces
  • Response caching
  • Request history with search
  • GraphQL support
  • WebSocket support
  • gRPC support
  • Plugin system
  • Export to curl/wget commands
  • Mock server mode
  • Response diff mode
  • Interactive TUI mode

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published