PHPackages                             bouiboui/spawn - 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. bouiboui/spawn

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

bouiboui/spawn
==============

Spawn and monitor processes with this command-line utility.

0.3.1(10y ago)224UnlicensePHP

Since May 16Pushed 5y agoCompare

[ Source](https://github.com/bouiboui/spawn)[ Packagist](https://packagist.org/packages/bouiboui/spawn)[ RSS](/packages/bouiboui-spawn/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

[![Spawn logo](https://camo.githubusercontent.com/8854b7a3c1ed4d1f6504c5cdf1c413d08d03c967df738fc28194d43ab03b7133/687474703a2f2f692e696d6775722e636f6d2f4743465a4852652e706e67)](https://camo.githubusercontent.com/8854b7a3c1ed4d1f6504c5cdf1c413d08d03c967df738fc28194d43ab03b7133/687474703a2f2f692e696d6775722e636f6d2f4743465a4852652e706e67)

[![Software License](https://camo.githubusercontent.com/e6fd1430520a41e5861f1fdf2ac70cde32bdfe292a6f2ddb83681339575c7948/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d556e6c6963656e73652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE) [![SensioLabsInsight](https://camo.githubusercontent.com/054246f748912a24ed485bb923323c6fa73859ee292ba19f47fd8e8ecbd1da90/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32306665363063362d373235372d343432652d626666342d3963303537353830616664362f6d696e692e706e67)](https://insight.sensiolabs.com/projects/20fe60c6-7257-442e-bff4-9c057580afd6)

Recently I've worked on several projects that call micro-processes for simple tasks (sending JSON data to a webservice, uploading a file, sending an email) in bulk, with sensibly different arguments. Spawn is a command-line utility that makes these calls and displays the progress with a progress bar like so:

```
[Spawn] Starting 3 process(es)
 1/3 [=========>------------------]  33% ('php' 'send_updates.php' 'data/client1.json') 4 secs/12 secs 1.2 MiB
 2/3 [==================>---------]  66% ('php' 'send_updates.php' 'data/client2.json') 9 secs/14 secs 1.2 MiB
 3/3 [============================] 100% ('php' 'send_updates.php' 'data/client3.json') 14 secs/14 secs 1.2 MiB
```

**Spawn is not intended to be launched from a remote server, only from your local command line.**

Install
-------

[](#install)

**Windows**

[Download spawn.phar from the latest release](https://github.com/bouiboui/spawn/releases/download/0.3/spawn.phar)

**Linux/MacOS**

Composer

```
composer global require bouiboui/spawn
sudo ln -s ~/.composer/vendor/bin/spawn /usr/local/bin
```

Manual

```
wget https://github.com/bouiboui/spawn/releases/download/0.3/spawn.phar
chmod +x spawn.phar
sudo mv spawn.phar /usr/local/bin/spawn
```

Usage
-----

[](#usage)

Run a process with arguments separated by spaces

```
./spawn.phar php send_latest_invoices.php startdate=2016-01-01

[Spawn] Starting 1 process(es)
 1/1 [============================] 100% ('php' 'send_latest_invoices.php' 'startdate=2016-01-01') 13 secs/13 secs 1.2 MiB
```

Add a numerical range in the arguments

```
./spawn.phar php convert_pdfs.php document{1-42}.pdf

[Spawn] Starting 42 process(es)
  4/42 [==>-------------------------]   9% ('php' 'convert_pdfs.php' 'document4.pdf') -------------------]  28% ('php' 'convert_pdfs.php' 'document12.pdf') 2 secs/7 secs 1.2 MiB
 16/42 [==========>-----------------]  38% ('php' 'convert_pdfs.php' 'document16.pdf') 3 secs/8 secs 1.2 MiB
 20/42 [=============>--------------]  47% ('php' 'convert_pdfs.php' 'document20.pdf') 4 secs/8 secs 1.2 MiB
 24/42 [================>-----------]  57% ('php' 'convert_pdfs.php' 'document24.pdf') 5 secs/9 secs 1.2 MiB
 28/42 [==================>---------]  66% ('php' 'convert_pdfs.php' 'document28.pdf') 6 secs/9 secs 1.2 MiB
 32/42 [=====================>------]  76% ('php' 'convert_pdfs.php' 'document32.pdf') 6 secs/8 secs 1.2 MiB
 36/42 [========================>---]  85% ('php' 'convert_pdfs.php' 'document36.pdf') 7 secs/8 secs 1.2 MiB
 40/42 [==========================>-]  95% ('php' 'convert_pdfs.php' 'document40.pdf') 8 secs/8 secs 1.2 MiB
 42/42 [============================] 100% ('php' 'convert_pdfs.php' 'document42.pdf') 9 secs/9 secs 1.2 MiB
```

Make GET calls to an URL with a range

```
./spawn.phar curl http://webservice/api/v1/customers/{1-3}/

[Spawn] Starting 3 process(es)
 1/3 [=========>------------------]  33% ('curl' 'http://webservice/api/v1/customers/1/') 4 secs/12 secs 1.2 MiB
 2/3 [==================>---------]  66% ('curl' 'http://webservice/api/v1/customers/2/') 5 secs/8 secs 1.2 MiB
 3/3 [============================] 100% ('curl' 'http://webservice/api/v1/customers/3/') 9 secs/9 secs 1.2 MiB
```

POST JSON files from a directory to an URL

- Important: use `--` or Spawn will try to parse curl options
- `-d @` before the filename sends the contents of the file

```
./spawn.phar -- curl -XPOST -H "Content-type: application/json" -d @json/invoices http://webservice/api/v1/invoices/

[Spawn] Starting 3 process(es)
 1/3 [=========>------------------]  33% ("curl" "-XPOST" "-H" "Content-type: application/json" "-d" "@json/invoices/january-april.json" "http://webservice/api/v1/invoices/")  1 sec/3 secs 1.2 MiB
 2/3 [==================>---------]  66% ("curl" "-XPOST" "-H" "Content-type: application/json" "-d" "@json/invoices/may-august.json" "http://webservice/api/v1/invoices/")  1 sec/2 secs 1.5 MiB
 3/3 [============================] 100% ("curl" "-XPOST" "-H" "Content-type: application/json" "-d" "@json/invoices/september-december.json" "http://webservice/api/v1/invoices/") 2 secs/2 secs 1.5 MiB
```

Run process for each file in a directory, filtered by the .json extension

```
./spawn.phar php get_gravatar.php data/users --find=*.json

[Spawn] Starting 3 process(es)
 1/3 [=========>------------------]  33% ('php' 'get_gravatar.php' 'data/users/martin-fowler.json') 4 secs/12 secs 1.2 MiB
 2/3 [==================>---------]  66% ('php' 'get_gravatar.php' 'data/users/rasmus-lerdorf.json') 5 secs/8 secs 1.2 MiB
 3/3 [============================] 100% ('php' 'get_gravatar.php' 'data/users/aaron-saray.json') 9 secs/9 secs 1.2 MiB
```

Save output to a file

```
./spawn.phar php get_twitter_handle.php data/users --outfile=handles.txt

# handles.txt
$ php get_twitter_handle.php "data/users/martin-fowler.json"
@martinfowler

$ php get_twitter_handle.php "data/users/rasmus-lerdorf.json"
@rasmus

$ php get_twitter_handle.php "data/users/aaron-saray.json"
@aaronsaray
```

Verbose mode

```
./spawn.phar php tests/test.php tests/data -vvv

[Spawn] Starting 3 process(es)
  RUN  'php' 'tests/test.php' 'tests/data/1.txt'
  OUT  Contents from 1.txt
  RES  Command ran successfully
 1/3 [=========>------------------]  33% ('php' 'tests/test.php' 'tests/data/1.txt') ---------]  66% ('php' 'tests/test.php' 'tests/data/2.txt') 2 secs/3 secs 2.5 MiB
  RUN  'php' 'tests/test.php' 'tests/data/3.txt'
  OUT  Contents from 3.txt
  RES  Command ran successfully
 3/3 [============================] 100% ('php' 'tests/test.php' 'tests/data/3.txt') 3 secs/3 secs 2.5 MiB%
```

Credits
-------

[](#credits)

- bouiboui — [Github](https://github.com/bouiboui) [Twitter](https://twitter.com/j_____________n) [Website](http://cod3.net)
- [All contributors](https://github.com/bouiboui/spawn/graphs/contributors)

License
-------

[](#license)

Unlicense. Public domain, basically. Please treat it kindly. See [License File](LICENSE) for more information.

This project uses the following open source projects

- [symfony/process](https://github.com/symfony/process) by [Fabien Potencier](https://github.com/fabpot) — [License](https://github.com/symfony/process/blob/master/LICENSE).
- [symfony/console](https://github.com/symfony/console) by [Fabien Potencier](https://github.com/fabpot) — [License](https://github.com/symfony/console/blob/master/LICENSE).
- [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) by [Sebastian Bergmann](https://github.com/sebastianbergmann) — [License](https://github.com/sebastianbergmann/phpunit/blob/master/LICENSE).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

5

Last Release

3693d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3274103?v=4)[Julien](/maintainers/bouiboui)[@bouiboui](https://github.com/bouiboui)

---

Top Contributors

[![bouiboui](https://avatars.githubusercontent.com/u/3274103?v=4)](https://github.com/bouiboui "bouiboui (45 commits)")

---

Tags

clicommand-lineprocessprocess-manager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bouiboui-spawn/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.9k16.6k](/packages/crazywhalecc-static-php-cli)[whatsdiff/whatsdiff

See what's changed in your project's dependencies

771.1k](/packages/whatsdiff-whatsdiff)

PHPackages © 2026

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