PHPackages                             devwing/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. devwing/cuzzle

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

devwing/cuzzle
==============

Get the cURL shell command from a Guzzle request

0267PHP

Since Jul 7Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

 [![Tests](https://github.com/octoper/cuzzle/workflows/Tests/badge.svg)](https://github.com/octoper/cuzzle/actions?query=workflow%3ATests) [![Latest Stable Version](https://camo.githubusercontent.com/9e9b52eef52ab340aa997e87fad1191622b684f8b477c5620a6c4ee2e3d4a480/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f63746f7065722f63757a7a6c653f6c6162656c3d737461626c65)](https://packagist.org/packages/octoper/cuzzle)[![License](https://camo.githubusercontent.com/1e1b471f47c59fc7d1625a32c7873730e04dea7bc15c234bf6bd89a7fc5fda77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f63746f7065722f63757a7a6c652e737667)](https://packagist.org/packages/octoper/cuzzle)

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.3+.

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

[](#installation)

You can install the library directly with composer:

```
composer require octoper/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

```
./vendor/bin/pest

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae6093dec88b7c528d37eda088616255f81906a022c809fd05b6a2378d733988?d=identicon)[devwing](/maintainers/devwing)

---

Top Contributors

[![octoper](https://avatars.githubusercontent.com/u/6823226?v=4)](https://github.com/octoper "octoper (11 commits)")[![cholladay0816](https://avatars.githubusercontent.com/u/57429754?v=4)](https://github.com/cholladay0816 "cholladay0816 (11 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 (6 commits)")[![vaidasm](https://avatars.githubusercontent.com/u/2324149?v=4)](https://github.com/vaidasm "vaidasm (3 commits)")[![zhanghuanchong](https://avatars.githubusercontent.com/u/3062319?v=4)](https://github.com/zhanghuanchong "zhanghuanchong (2 commits)")[![nikita2206](https://avatars.githubusercontent.com/u/1030688?v=4)](https://github.com/nikita2206 "nikita2206 (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)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (1 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (1 commits)")[![lazyants](https://avatars.githubusercontent.com/u/249065?v=4)](https://github.com/lazyants "lazyants (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)")

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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