PHPackages                             roadsigns/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. [HTTP &amp; Networking](/categories/http)
4. /
5. roadsigns/cuzzle

ActiveLibrary[HTTP &amp; Networking](/categories/http)

roadsigns/cuzzle
================

Get the cURL shell command from a Guzzle request

1.0.1(3y ago)420.6k↓29.5%1MITPHPPHP &gt;=8.0

Since Jan 9Pushed 3y agoCompare

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

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

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

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

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

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

[](#prerequisites)

This library needs PHP 8.0+

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

[](#installation)

You can install the library directly with composer:

```
composer require RoadSigns/cuzzle

```

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

Usage
-----

[](#usage)

```
use RoadSigns\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 RoadSigns\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

```

Original
--------

[](#original)

This package is a fork from This is to allow people to use this package with Guzzle &gt;= 7.0

Some fundamental changes have been made to the code so a simple port across might not work exactly.

We are now returning a `Curl` class that is `Stringable` instead of a string. This allows us to move all the logic to create the cURL out of the Request formatter.

Feedback
--------

[](#feedback)

Add an issue, open a PR, drop us a message!

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

1225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00bae19ef67b1fed707d050adebb9ad2bb6c55a3d4ff417aaabc4a82da6706fa?d=identicon)[RoadSigns](/maintainers/RoadSigns)

---

Top Contributors

[![RoadSigns](https://avatars.githubusercontent.com/u/5822139?v=4)](https://github.com/RoadSigns "RoadSigns (16 commits)")[![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 (7 commits)")[![vaidasm](https://avatars.githubusercontent.com/u/2324149?v=4)](https://github.com/vaidasm "vaidasm (3 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)")[![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)")[![zainengineer](https://avatars.githubusercontent.com/u/4746235?v=4)](https://github.com/zainengineer "zainengineer (1 commits)")[![csarrazi](https://avatars.githubusercontent.com/u/465798?v=4)](https://github.com/csarrazi "csarrazi (1 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)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[api-platform/metadata

API Resource-oriented metadata attributes and factories

243.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[mimmi20/browser-detector

Library to detect Browsers and Devices

48153.5k3](/packages/mimmi20-browser-detector)[discord-php/http

Handles HTTP requests to Discord servers

25318.7k8](/packages/discord-php-http)

PHPackages © 2026

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