PHPackages                             skyraptor/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. [CLI &amp; Console](/categories/cli)
4. /
5. skyraptor/command

ActiveLibrary[CLI &amp; Console](/categories/cli)

skyraptor/command
=================

Provides the foundation for building command-based web service clients

1.0.0(9y ago)05451MITPHPPHP &gt;=5.5.0

Since Mar 16Pushed 5y agoCompare

[ Source](https://github.com/bumbummen99/command)[ Packagist](https://packagist.org/packages/skyraptor/command)[ RSS](/packages/skyraptor-command/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (16)Used By (1)

Guzzle Commands
===============

[](#guzzle-commands)

[![License](https://camo.githubusercontent.com/e854793366811c6b47af495212fca98161397c7cba2a7ad0d5ff6f6e90728be1/68747470733a2f2f706f7365722e707567782e6f72672f67757a7a6c65687474702f636f6d6d616e642f6c6963656e7365)](https://packagist.org/packages/guzzlehttp/command)[![Build Status](https://camo.githubusercontent.com/a5d439f79745df6ef0673163ce5eae239da6962825f39f62eaf681e9d23f1d99/68747470733a2f2f7472617669732d63692e6f72672f67757a7a6c652f636f6d6d616e642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/guzzle/command)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d1436d3e5f5ac4786a4b99a8d87653e866a7064548f0669b5b736ac7e7daab78/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67757a7a6c652f636f6d6d616e642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/guzzle/command/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/db11ccd97ffa2ac5ef089092e3996166efaf9872cd20cb980470d797d052211d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67757a7a6c652f636f6d6d616e642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/guzzle/command/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/f64d2bd640aac9ef84cf31a451c7eb311f70e753358b217310ffcd850e2845b4/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37613933333338652d353063642d343266372d393239392d3137633434643932313438662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7a93338e-50cd-42f7-9299-17c44d92148f)[![Latest Stable Version](https://camo.githubusercontent.com/3b7db36a7ebcb05c5085558ddfff3e0928ce3bdcb96cb3fd8911c6173eeb1934/68747470733a2f2f706f7365722e707567782e6f72672f67757a7a6c65687474702f636f6d6d616e642f762f737461626c65)](https://packagist.org/packages/guzzlehttp/command)[![Latest Unstable Version](https://camo.githubusercontent.com/1d4c39e700d1b187f74dbe22c6af0141892a33eeaca4a62def23ed6e1a2b7d07/68747470733a2f2f706f7365722e707567782e6f72672f67757a7a6c65687474702f636f6d6d616e642f762f756e737461626c65)](https://packagist.org/packages/guzzlehttp/command)[![Total Downloads](https://camo.githubusercontent.com/00f366c84636933a15e3a83f3281ef3387d533b8bc766e6313b317bf66003329/68747470733a2f2f706f7365722e707567782e6f72672f67757a7a6c65687474702f636f6d6d616e642f646f776e6c6f616473)](https://packagist.org/packages/guzzlehttp/command)

This library uses Guzzle (`guzzlehttp/guzzle`, version 6.x) and provides the foundations to create fully-featured web service clients by abstracting Guzzle HTTP **requests** and **responses** into higher-level **commands** and **results**. A **middleware** system, analogous to — but separate from — the one in the HTTP layer may be used to customize client behavior when preparing commands into requests and processing responses into results.

### Commands

[](#commands)

Key-value pair objects representing an operation of a web service. Commands have a name and a set of parameters.

### Results

[](#results)

Key-value pair objects representing the processed result of executing an operation of a web service.

Installing
----------

[](#installing)

This project can be installed using Composer:

`composer require guzzlehttp/command`

For **Guzzle 5**, use `composer require guzzlehttp/command:0.8.*`. The source code for the Guzzle 5 version is available on the `0.8 branch `\_.

**Note:** If Composer is not `installed globally `\_, then you may need to run the preceding Composer commands using `php composer.phar` (where `composer.phar` is the path to your copy of Composer), instead of just `composer`.

Service Clients
---------------

[](#service-clients)

Service Clients are web service clients that implement the `GuzzleHttp\Command\ServiceClientInterface` and use an underlying Guzzle HTTP client (`GuzzleHttp\Client`) to communicate with the service. Service clients create and execute **commands** (`GuzzleHttp\Command\CommandInterface`), which encapsulate operations within the web service, including the operation name and parameters. This library provides a generic implementation of a service client: the `GuzzleHttp\Command\ServiceClient` class.

Instantiating a Service Client
------------------------------

[](#instantiating-a-service-client)

@TODO Add documentation

- `ServiceClient`'s constructor
- Transformer functions (`$commandToRequestTransformer` and `$responseToResultTransformer`)
- The `HandlerStack`

Executing Commands
------------------

[](#executing-commands)

Service clients create command objects using the `getCommand()` method.

```
$commandName = 'foo';
$arguments = ['baz' => 'bar'];
$command = $client->getCommand($commandName, $arguments);
```

After creating a command, you may execute the command using the `execute()`method of the client.

```
$result = $client->execute($command);
```

The result of executing a command will be a `GuzzleHttp\Command\ResultInterface`object. Result objects are `ArrayAccess`-ible and contain the data parsed from HTTP response.

Service clients have magic methods that act as shortcuts to executing commands by name without having to create the `Command` object in a separate step before executing it.

```
$result = $client->foo(['baz' => 'bar']);
```

Asynchronous Commands
---------------------

[](#asynchronous-commands)

@TODO Add documentation

- `-Async` suffix for client methods
- Promises

```
// Create and execute an asynchronous command.
$command = $command = $client->getCommand('foo', ['baz' => 'bar']);
$promise = $client->executeAsync($command);

// Use asynchronous commands with magic methods.
$promise = $client->fooAsync(['baz' => 'bar']);
```

@TODO Add documentation

- `wait()`-ing on promises.

```
$result = $promise->wait();

echo $result['fizz']; //> 'buzz'
```

Concurrent Requests
-------------------

[](#concurrent-requests)

@TODO Add documentation

- `executeAll()`
- `executeAllAsync()`.
- Options (`fulfilled`, `rejected`, `concurrency`)

Middleware: Extending the Client
--------------------------------

[](#middleware-extending-the-client)

Middleware can be added to the service client or underlying HTTP client to implement additional behavior and customize the `Command`-to-`Result` and `Request`-to-`Response` lifecycles, respectively.

Todo
----

[](#todo)

- Middleware system and command vs request layers
- The `HandlerStack`

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 82.5% 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 ~89 days

Recently: every ~170 days

Total

12

Last Release

3462d ago

Major Versions

0.9.0 → 1.0.02016-11-24

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

0.9.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/509a5baf8d7d8f7ae8c5b569ee81b1d04ed6af1af625696777e51e997ff9a685?d=identicon)[bumbummen99](/maintainers/bumbummen99)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

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

6.3k511.3M2.2k](/packages/aws-aws-sdk-php)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[google/cloud-core

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

343121.4M79](/packages/google-cloud-core)[drupal/core-recommended

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

6939.5M343](/packages/drupal-core-recommended)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M13](/packages/pantheon-systems-terminus)

PHPackages © 2026

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