PHPackages                             jigarius/phpake - 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. jigarius/phpake

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

jigarius/phpake
===============

Phpake is a make-like utility built for PHP.

v1.1.0(1y ago)813[5 issues](https://github.com/jigarius/phpake/issues)GPL-3.0-onlyPHPPHP ^8.3

Since Oct 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jigarius/phpake)[ Packagist](https://packagist.org/packages/jigarius/phpake)[ Docs](https://github.com/jigarius/phpake)[ RSS](/packages/jigarius-phpake/feed)WikiDiscussions 1.x Synced 1mo ago

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

Phpake
======

[](#phpake)

Phpake is a make-like utility built for PHP. It is pronounced *fake* because the second *p* is silent just like the second *p* in the word *elephpant*.

I've always found writing a `Makefile` quite challenging because the syntax is similar to the shell syntax, but quite different at the same time. When I'm working with Ruby, I use [rake](https://github.com/ruby/rake) and it's awesome because it uses Ruby syntax. When I work with PHP, I often miss having a similar tool that is easy to install, easy to use, and allows full-fledged PHP syntax. Thus, Phpake was born.

I invite you to use it, and I hope you like it.

~ [Jigarius](https://jigarius.com/)

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

[](#installation)

Phpake can easily be installed with `composer`, either within a project or globally on your system.

### System-wide installation

[](#system-wide-installation)

To install Phpake globally on your system, use the following command:

```
composer global require jigarius/phpake

```

Now, to run `phpake` from anywhere on your system, Composer's `vendor/bin` directory needs to be included in the the `PATH` variable.

### Project installation

[](#project-installation)

To install Phpake in a particular project, run the following command:

```
composer require jigarius/phpake

```

You should then be able to run it with `composer exec phpake`.

Usage
-----

[](#usage)

To use Phpake, start by creating a `Phpakefile` to define some tasks. Each task is simply a PHP function. You can read more on creating a `Phpakefile` under the [Phpakefile](#Phpakefile) section.

Here are some common Phpake commands. You need to run them from a directory containing a `Phpakefile`.

- `phpake` - shows a list of available commands.
- `phpake hello-world` - runs the command defined by `function hello_world()`.
- `phpake hello-human Bunny Wabbit` - passes 2 parameters to the task.
- `phpake hello-group --help` - shows help text for the task.

Phpakefile
----------

[](#phpakefile)

A *Phpakefile* contains definitions of tasks that can be executed by Phpake. The following subheadings are about defining such tasks. A Phpake task definition is simply a PHP function (a task callback). Here's are some examples:

- [Hello world](examples/hello-world.phpakefile)
- [Input Output](examples/input-output.phpakefile)
- [Namespaces](examples/fizzbuzz.phpakefile)
- [Variadic arguments](examples/variadic.phpakefile)
- [Shell commands](examples/shell.phpakefile)
- [Including commands](Phpakefile)

Simple tasks
------------

[](#simple-tasks)

Here's a simple task that takes no input and prints some output. Just make sure that the function name doesn't coincide with any existing functions.

```
/**
 * Say hello world.
 */
function hello_world() {
  echo 'Hello world' . PHP_EOL;
}
```

This task can then be executed as `phpake hello-world`. You can also organize functions with PHP namespaces.

Regular Parameters
------------------

[](#regular-parameters)

If your task needs some input from the user, simply introduce one or more arguments in the function definition.

```
function hello_human($fname, $lname = NULL) {
  // Do something
}
```

Since `$lname` has a default value, it is treated as an optional argument.

Special parameters
------------------

[](#special-parameters)

Phpake is built with [Symfony Console](https://symfony.com/doc/current/components/console.html), which provides certain special parameters that can help you enrich your application even further. If your task has a parameter with one of these special names, it will behave specially. For more info on these objects, please refer to the Symfony Console documentation.

### $input

[](#input)

A Symfony Console input object.

### $output

[](#output)

A Symfony Console output object that makes it easier to generate well-formatted, colorful output.

```
function hello_joey($output) {
  $output->writeln('Hello Joey!');
}
```

The text included in `` will appear in color.

### $command

[](#command)

Name of the Symfony Console command that is being executed. It looks like the task function name with some minor differences.

- For a `function hello_world()` the command becomes `hello-world`
- If defined in a namespace, it becomes `namespace:hello-world`.

### $rest

[](#rest)

Often there are tasks that can accept an unlimited number of arguments. These can be handled with a `$rest` parameter. It **must be** defined as the last argument to your function.

```
function hello_group(string $you, string $rest) {
  // Do something.
}
```

If a default value of `NULL` is assigned to `$rest`, it becomes optional, otherwise, it requires one or more values.

### Helpers

[](#helpers)

Say, you have a function that helps other tasks but it is not a command by itself. Such functions can be put in a `Phpakefile` too. However, so that Phpake doesn't confuse them for commands, the function name must begin with an underscore. For example a function named `_foo()` will not result in a command named `phpake foo` because the function name starts with an underscore.

Development
-----------

[](#development)

This project uses a Dockerized development environment. Run the project as you would any other docker-compose based project.

When developing for the first time,

- Clone the repository with `git clone`
- `cd` into the cloned repository
- Build Docker images: `docker compose build`
- Bring up the containers: `docker compose up -d`

After the initial setup, you can use the following commands:

- `docker compose start`: Start the project's containers
- `make ssh`: Launch a shell inside the project's container
    - You'll spend most of your time here
    - The command `phpake` should be available
- `docker compose stop`: Stops the project's containers when you're done
- See the `Makefile` for more helpful commands

Links
-----

[](#links)

- [Phpake on Packagist](https://packagist.org/packages/jigarius/phpake)
- [Phpake: A Tool like Make/Rake Built for PHP](https://jigarius.com/blog/phpake) article on Jigarius.com
- Phpake video tutorial (coming soon)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

490d ago

PHP version history (2 changes)1.0.0PHP &gt;= 8.0

1.x-devPHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f87453d7bf90e5e9171782240b2b3d84f33f5b343183d9f4abd9ce4ece6fb0a?d=identicon)[jigarius](/maintainers/jigarius)

---

Top Contributors

[![jigarius](https://avatars.githubusercontent.com/u/4286033?v=4)](https://github.com/jigarius "jigarius (100 commits)")

---

Tags

build-toolclicomposer-packagemakefilephprakefilesymfony-consoletask-runnermake

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jigarius-phpake/health.svg)

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[niellles/lumen-commands

Adds artisan commands to Lumen that aren't available by default.

1860.1k](/packages/niellles-lumen-commands)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)[hydreflab/laravel-make-me

Extendable Interactive Make Command for Laravel

371.2k](/packages/hydreflab-laravel-make-me)

PHPackages © 2026

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