PHPackages                             sergey-bel/curl-printer - 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. sergey-bel/curl-printer

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

sergey-bel/curl-printer
=======================

Print psr requests as curl command string

4.0.0(1y ago)313.2k↓22.7%1PHPPHP &gt;=8.2CI passing

Since Dec 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SergeyBel/curl-printer)[ Packagist](https://packagist.org/packages/sergey-bel/curl-printer)[ RSS](/packages/sergey-bel-curl-printer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Curl printer
============

[](#curl-printer)

**curl-printer** is a library which allows you print request as curl command line string. It is useful for logging and debugging. Useful for PSR-7, Guzzle and custom Requests.

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

[](#installation)

```
composer require sergey-bel/curl-printer

```

Usage
-----

[](#usage)

### Request data

[](#request-data)

```
$request = new RequestData(
    HttpMethod::POST,
    'https://someapi.com/user',
     [
       'Accept' => 'application/json',
     ],
     'id=12345'
);

$printer = new CurlPrinter();
echo $printer->print($request);
// curl -X POST https://someapi.com/user -H 'Accept: application/json' -d 'id=12345'
```

### PSR-7 Request

[](#psr-7-request)

```
// $psr7Request implements RequestInterface

$extractor = new PsrRequestExtractor();
$printer = new CurlPrinter();

$request = $extractor->extract($psr7Request)
$printer->print($request);
```

### Guzzle middleware

[](#guzzle-middleware)

```
$logger = // some LoggerInterface
$stack = new HandlerStack();
$stack->push(new CurlPrinterMiddleware($logger));
$client = new Client(['handler' => $stack]);
$client->send(...);
```

### Settings

[](#settings)

Formatting settings are available in the `FormatterSettings` class

```
$settings = (new FormatterSettings())
            ->setQuotes('"');
$request = new RequestData(
    HttpMethod::POST,
    'https://someapi.com/user',
     [
       'Accept' => 'application/json',
     ],
     'id=12345'
);
$printer = (new CurlPrinter())->setSettings($settings);
echo $printer->print($request);
// curl -X POST https://someapi.com/user -H "Accept: application/json" -d "id=12345"
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance48

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Total

4

Last Release

384d ago

Major Versions

v1.0.0 → v2.0.02020-12-05

v2.0.0 → 3.02025-04-29

3.0 → 4.0.02025-04-29

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

3.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![SergeyBel](https://avatars.githubusercontent.com/u/1206414?v=4)](https://github.com/SergeyBel "SergeyBel (26 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sergey-bel-curl-printer/health.svg)

```
[![Health](https://phpackages.com/badges/sergey-bel-curl-printer/health.svg)](https://phpackages.com/packages/sergey-bel-curl-printer)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[aimeos/aimeos-base

Aimeos base layer for abstracting from host environments

2.1k134.0k1](/packages/aimeos-aimeos-base)[phpgt/dom

Modern DOM API.

12412.2M18](/packages/phpgt-dom)[anthropic-ai/sdk

Anthropic PHP SDK

129134.7k5](/packages/anthropic-ai-sdk)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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