rick-cli 0.2.1

A better cURL, written in Rust
rick-cli-0.2.1 is not a library.

The Problem

You want to POST some JSON. Here's cURL:

curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"name": "rick"}' https://api.example.com/users

Here's rick:

rick --json '{"name": "rick"}' https://api.example.com/users

That's it. That's the whole pitch.


Installation

Pre-built binaries (recommended)

Download the latest release for your platform:

# macOS (Apple Silicon)
curl -L https://github.com/beratcano/rick/releases/latest/download/rick-macos-arm64.tar.gz | tar xz
sudo mv rick-macos-arm64 /usr/local/bin/rick

# macOS (Intel)
curl -L https://github.com/beratcano/rick/releases/latest/download/rick-macos-x86_64.tar.gz | tar xz
sudo mv rick-macos-x86_64 /usr/local/bin/rick

# Linux (x86_64)
curl -L https://github.com/beratcano/rick/releases/latest/download/rick-linux-x86_64.tar.gz | tar xz
sudo mv rick-linux-x86_64 /usr/local/bin/rick

# Linux (ARM64)
curl -L https://github.com/beratcano/rick/releases/latest/download/rick-linux-arm64.tar.gz | tar xz
sudo mv rick-linux-arm64 /usr/local/bin/rick

Or download manually from Releases.

From source

git clone https://github.com/beratcano/rick
cd rick
cargo build --release
sudo cp target/release/rick /usr/local/bin/

Cargo

cargo install rick-cli

Quick Start

# GET request
rick https://api.github.com/users/octocat

# POST JSON (the killer feature)
rick --json '{"title": "Hello", "body": "World"}' https://api.example.com/posts

# Custom headers
rick -H "Authorization: Bearer token123" https://api.example.com/me

# Save response to file
rick -o response.json https://api.example.com/data

# See what's happening
rick -v https://api.example.com/debug

Why rick?

1. --json flag

The single feature that justifies rick's existence.

# cURL (pain)
curl -H "Content-Type: application/json" -H "Accept: application/json" -d '{"key": "value"}' URL

# rick (joy)
rick --json '{"key": "value"}' URL

2. Smart defaults

Behavior cURL rick
Follow redirects No (-L to enable) Yes (--no-follow to disable)
POST when data provided No (-X POST required) Yes (auto-detected)

3. HTTP-focused

cURL supports 25+ protocols (FTP, LDAP, SMTP, Gopher...). rick supports HTTP and HTTPS. That's it. This keeps the codebase simple, the binary small, and the mental model clear.

4. Zero dependencies

Single static binary. No OpenSSL. No system libraries. Download and run.


Usage

rick [OPTIONS] <URL>

Arguments:
  <URL>  URL to request

Options:
  -X, --method <METHOD>   HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD)
  -H, --header <HEADER>   Add header (can be used multiple times)
  -d, --data <DATA>       Request body
      --json <JSON>       JSON body (sets Content-Type & Accept automatically)
  -o, --output <FILE>     Write response to file
  -i, --include           Show response headers
  -v, --verbose           Show request and response headers
      --no-follow         Don't follow redirects
  -h, --help              Print help

Examples

GET request

rick https://httpbin.org/get

POST with form data

rick -d "username=rick&password=morty" https://httpbin.org/post

POST JSON

rick --json '{"dimension": "C-137"}' https://httpbin.org/post

Custom headers

rick -H "Authorization: Bearer abc123" -H "X-Custom: value" https://api.example.com

PUT request

rick -X PUT --json '{"updated": true}' https://api.example.com/resource/1

Download file

rick -o image.png https://example.com/image.png

Debug request/response

rick -v https://httpbin.org/get
# > GET https://httpbin.org/get HTTP/1.1
# >
# < HTTP/1.1 200 OK
# < content-type: application/json
# ...

Include response headers

rick -i https://httpbin.org/get
# HTTP/1.1 200 OK
# content-type: application/json
# ...
#
# {"args": {}, ...}

vs cURL

Feature cURL rick
JSON POST -H "Content-Type: application/json" -d '{}' --json '{}'
Follow redirects Need -L Default behavior
Auto-detect POST Need -X POST Automatic with -d/--json
Protocols 25+ HTTP(S) only
Binary size ~540 KB (dynamic) ~7 MB (static)
Dependencies OpenSSL, libcurl, etc. None

When to use cURL instead

  • You need FTP, SFTP, SCP, or other protocols
  • You need advanced features (cookies file, netrc, proxy auth)
  • You're writing a shell script that must work everywhere
  • Binary size is critical

When to use rick

  • 99% of your API testing
  • You're tired of the JSON header dance
  • You want sane defaults
  • You want a single static binary

Name

rick = Rust Integrated Curl + K (for fun)

Yes, it should be "ric" but that looked weird.


Design Philosophy

  1. Optimize for the common case — JSON APIs are everywhere, make them easy
  2. Respect muscle memory — Keep familiar flags (-H, -d, -o, -v, -i, -X)
  3. Modern defaults — Follow redirects, auto-detect methods
  4. Do one thing well — HTTP only, no feature creep

See DECISIONS.md for detailed design rationale.


Building from source

# Clone
git clone https://github.com/beratcano/rick
cd rick

# Build
cargo build --release

# Run tests
cargo test

# Install locally
cargo install --path .

Requirements

  • Rust 1.75 or later
  • That's it

Contributing

Contributions are welcome! Please read the guidelines:

  1. Keep it simple — rick is intentionally minimal
  2. Discuss first — Open an issue before adding features
  3. Document decisions — Update DECISIONS.md for non-trivial changes
# Format code
cargo fmt

# Run clippy
cargo clippy

# Run tests
cargo test

Roadmap

  • Progress bar for large downloads
  • Timeout configuration (--timeout)
  • Retry logic (--retry)
  • Read body from file (--json @file.json)
  • Response time display
  • Config file for defaults

Not planned:

  • Other protocols (FTP, etc.)
  • Cookie jars
  • .netrc support
  • Feature parity with cURL

License

MIT License — do whatever you want.