PHPackages                             rexlabs/cuzzle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rexlabs/cuzzle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rexlabs/cuzzle
==============

Get the cURL shell command from a Guzzle request

3.0.0(2y ago)06.9k↓100%1MITPHPPHP &gt;=7.4 &lt;8.3

Since Sep 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/rexlabsio/cuzzle)[ Packagist](https://packagist.org/packages/rexlabs/cuzzle)[ RSS](/packages/rexlabs-cuzzle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (14)Used By (1)

Cuzzle, cURL command from Guzzle requests
=========================================

[](#cuzzle-curl-command-from-guzzle-requests)

This library let's you dump a Guzzle request to a cURL command for debug and log purpose.

Prerequisites
-------------

[](#prerequisites)

This library needs PHP 7.4+

It has been tested using PHP 7.4, 8.0, 8.1 and 8.2

Installation
------------

[](#installation)

You can install the library directly with composer:

```
composer require namshi/cuzzle

```

(Add `--dev` if you don't need it in production environment)

Usage
-----

[](#usage)

```
use Namshi\Cuzzle\Formatter\CurlFormatter;
use GuzzleHttp\Message\Request;

$request = new Request('GET', 'example.local');
$options = [];

echo (new CurlFormatter())->format($request, $options);
```

To log the cURL request generated from a Guzzle request, simply add CurlFormatterSubscriber to Guzzle:

```
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use Namshi\Cuzzle\Middleware\CurlFormatterMiddleware;
use Monolog\Logger;
use Monolog\Handler\TestHandler;

$logger = new Logger('guzzle.to.curl'); //initialize the logger
$testHandler = new TestHandler(); //test logger handler
$logger->pushHandler($testHandler);

$handler = HandlerStack::create();
$handler->after('cookies', new CurlFormatterMiddleware($logger)); //add the cURL formatter middleware
$client  = new Client(['handler' => $handler]); //initialize a Guzzle client

$response = $client->get('http://google.com'); //let's fire a request

var_dump($testHandler->getRecords()); //check the cURL request in the logs,
//you should see something like: "curl 'http://google.com' -H 'User-Agent: Guzzle/4.2.1 curl/7.37.1 PHP/5.5.16"
```

Tests
-----

[](#tests)

You can run tests locally with

```
phpunit

```

Feedback
--------

[](#feedback)

Add an issue, open a PR, drop us an email! We would love to hear from you!

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~270 days

Recently: every ~642 days

Total

13

Last Release

1034d ago

Major Versions

0.1.1 → 1.0.02015-03-09

1.2.1 → 2.0.02016-04-10

2.1.0 → 3.0.02023-07-19

PHP version history (4 changes)0.1.0PHP &gt;=5.4.0

2.0.0PHP &gt;=5.5.0

2.0.4PHP &gt;=7.0

3.0.0PHP &gt;=7.4 &lt;8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/18f5613c1ca6527bdee951ce1ff9dd4a626700ca01a0b787397ad9128a9dfaae?d=identicon)[rexlabsio](/maintainers/rexlabsio)

---

Top Contributors

[![tchoulom](https://avatars.githubusercontent.com/u/8807785?v=4)](https://github.com/tchoulom "tchoulom (9 commits)")[![odino](https://avatars.githubusercontent.com/u/328420?v=4)](https://github.com/odino "odino (8 commits)")[![cirpo](https://avatars.githubusercontent.com/u/51252?v=4)](https://github.com/cirpo "cirpo (6 commits)")[![ababkov](https://avatars.githubusercontent.com/u/478307?v=4)](https://github.com/ababkov "ababkov (4 commits)")[![vaidasm](https://avatars.githubusercontent.com/u/2324149?v=4)](https://github.com/vaidasm "vaidasm (3 commits)")[![lazyants](https://avatars.githubusercontent.com/u/249065?v=4)](https://github.com/lazyants "lazyants (1 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (1 commits)")[![nikita2206](https://avatars.githubusercontent.com/u/1030688?v=4)](https://github.com/nikita2206 "nikita2206 (1 commits)")[![dineshkumar-selvamani](https://avatars.githubusercontent.com/u/45995262?v=4)](https://github.com/dineshkumar-selvamani "dineshkumar-selvamani (1 commits)")[![SergeAx](https://avatars.githubusercontent.com/u/3264530?v=4)](https://github.com/SergeAx "SergeAx (1 commits)")[![sobit](https://avatars.githubusercontent.com/u/1245542?v=4)](https://github.com/sobit "sobit (1 commits)")[![csarrazi](https://avatars.githubusercontent.com/u/465798?v=4)](https://github.com/csarrazi "csarrazi (1 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (1 commits)")[![xkobal](https://avatars.githubusercontent.com/u/1136820?v=4)](https://github.com/xkobal "xkobal (1 commits)")[![lachlankrautz](https://avatars.githubusercontent.com/u/644146?v=4)](https://github.com/lachlankrautz "lachlankrautz (1 commits)")[![zainengineer](https://avatars.githubusercontent.com/u/4746235?v=4)](https://github.com/zainengineer "zainengineer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rexlabs-cuzzle/health.svg)

```
[![Health](https://phpackages.com/badges/rexlabs-cuzzle/health.svg)](https://phpackages.com/packages/rexlabs-cuzzle)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
