PHPackages                             guzzlehttp/command - 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. guzzlehttp/command

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

guzzlehttp/command
==================

Provides the foundation for building command-based web service clients

2.0.0(4w ago)11611.4M↓44.6%2119MITPHPPHP ^7.4 || ^8.0CI passing

Since Mar 16Pushed 4w ago9 watchersCompare

[ Source](https://github.com/guzzle/command)[ Packagist](https://packagist.org/packages/guzzlehttp/command)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ GitHub Sponsors](https://github.com/Nyholm)[ RSS](/packages/guzzlehttp-command/feed)WikiDiscussions 2.0 Synced 2w ago

READMEChangelog (10)Dependencies (24)Versions (60)Used By (19)

Guzzle Command
==============

[](#guzzle-command)

Guzzle Command provides the foundation for building command-based web service clients on top of Guzzle. A command represents one service operation, and a result represents the processed response from that operation.

Use this package when you are building an SDK-style client with named operations such as `listUsers()` or `createOrder()`. If you only need to send ordinary HTTP requests, install [`guzzlehttp/guzzle`](https://github.com/guzzle/guzzle/blob/8.0/README.md)instead.

For declarative service descriptions that define operations from API metadata, see [Guzzle Services](https://github.com/guzzle/guzzle-services/blob/2.0/README.md).

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

[](#installation)

```
composer require guzzlehttp/command
```

Version Guidance
----------------

[](#version-guidance)

VersionStatusPHP Version2.0Latest&gt;=7.4,&lt;8.61.5Maintenance&gt;=7.2.5,&lt;8.6Quick Start
-----------

[](#quick-start)

```
use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Command\CommandInterface;
use GuzzleHttp\Command\Result;
use GuzzleHttp\Command\ResultInterface;
use GuzzleHttp\Command\ServiceClient;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

$client = new ServiceClient(
    new HttpClient(['base_uri' => 'https://api.example.com']),
    function (CommandInterface $command): RequestInterface {
        return new Request(
            'POST',
            '/' . rawurlencode($command->getName()),
            ['Content-Type' => 'application/json'],
            \json_encode($command->toArray(), \JSON_THROW_ON_ERROR)
        );
    },
    function (
        ResponseInterface $response,
        RequestInterface $request,
        CommandInterface $command
    ): ResultInterface {
        return new Result(\json_decode((string) $response->getBody(), true, 512, \JSON_THROW_ON_ERROR));
    }
);

$result = $client->createUser(['name' => 'Ada']);
```

The service client can also execute commands asynchronously and run many commands with a configurable concurrency limit.

Documentation
-------------

[](#documentation)

- [Service Clients](docs/service-clients.md)
- [Executing Commands](docs/executing-commands.md)
- [Async and Concurrency](docs/async-and-concurrency.md)
- [Middleware: Extending the Client](docs/middleware-extending-the-client.md)
- [Upgrade Guide](UPGRADING.md)
- [Changelog](CHANGELOG.md)

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to . All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/command/security/policy) for more information.

License
-------

[](#license)

Guzzle Command is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-command?utm_source=packagist-guzzlehttp-command&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance94

Actively maintained with recent releases

Popularity62

Solid adoption and visibility

Community37

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 53.8% 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 ~155 days

Recently: every ~3 days

Total

30

Last Release

28d ago

Major Versions

0.9.0 → 1.0.02016-11-24

1.5.x-dev → 2.0.02026-07-20

PHP version history (5 changes)0.2.0PHP &gt;=5.4.0

0.9.0PHP &gt;=5.5.0

1.1.0PHP &gt;=7.2.5

1.2.0PHP ^7.2.5 || ^8.0

2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/190930?v=4)[Michael Dowling](/maintainers/mtdowling)[@mtdowling](https://github.com/mtdowling)

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (127 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (88 commits)")[![jeremeamia](https://avatars.githubusercontent.com/u/107867?v=4)](https://github.com/jeremeamia "jeremeamia (9 commits)")[![Konafets](https://avatars.githubusercontent.com/u/363363?v=4)](https://github.com/Konafets "Konafets (5 commits)")[![seiffert](https://avatars.githubusercontent.com/u/1111118?v=4)](https://github.com/seiffert "seiffert (2 commits)")[![tianyiw2013](https://avatars.githubusercontent.com/u/4644588?v=4)](https://github.com/tianyiw2013 "tianyiw2013 (1 commits)")[![bumbummen99](https://avatars.githubusercontent.com/u/4533331?v=4)](https://github.com/bumbummen99 "bumbummen99 (1 commits)")[![elyobo](https://avatars.githubusercontent.com/u/407806?v=4)](https://github.com/elyobo "elyobo (1 commits)")[![hpatoio](https://avatars.githubusercontent.com/u/249948?v=4)](https://github.com/hpatoio "hpatoio (1 commits)")[![Bolid1](https://avatars.githubusercontent.com/u/5942653?v=4)](https://github.com/Bolid1 "Bolid1 (1 commits)")

---

Tags

guzzleguzzle-servicesmiddlewarepromises

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guzzlehttp-command/health.svg)

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

###  Alternatives

[guzzlehttp/guzzle

Guzzle is a PHP HTTP client library

23.5k1.1B37.6k](/packages/guzzlehttp-guzzle)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[civicrm/civicrm-core

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

762297.9k53](/packages/civicrm-civicrm-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6943.5M449](/packages/drupal-core-recommended)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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