PHPackages                             wouterj/fred - 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. wouterj/fred

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

wouterj/fred
============

A very simple iteration based task runner

0.3.0(11y ago)26252[2 issues](https://github.com/wouterj/fred/issues)[1 PRs](https://github.com/wouterj/fred/pulls)BSDPHPPHP &gt;=5.3.3

Since Dec 30Pushed 6y ago7 watchersCompare

[ Source](https://github.com/wouterj/fred)[ Packagist](https://packagist.org/packages/wouterj/fred)[ RSS](/packages/wouterj-fred/feed)WikiDiscussions master Synced 1mo ago

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

Fred
====

[](#fred)

Welcome to Fred. Fred will execute tasks that you have described in a fred file.

> Fred is not a grown up man at the moment. The steps used in this docs are not yet implemented. Do you help me teach him how to do developer tasks?

[![Build Status](https://camo.githubusercontent.com/654094a109f0f864c62a3146754f6fbcfb2c6d5d4b08411f04b61529e968410a/68747470733a2f2f7472617669732d63692e6f72672f576f757465724a2f667265642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/WouterJ/fred)

Why should I use Fred?
----------------------

[](#why-should-i-use-fred)

- You don't have to spent time installing NodeJS, NPM on your server just to run tasks;
- You can work with a syntax you're familiar with;
- Fred's codebase is very small (just 9 classes) and as flexible as task runners can be.

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

[](#installation)

The best way to install Fred is using [Composer](http://getcomposer.og/):

```
$ composer global require wouterj/fred:0.*
```

If you set-up composer's global binary directory correctly, this will give you a new command: `fred`

Usage
-----

[](#usage)

You start by creating a `fred.php` file (the fred file). In this file, you specify the tasks. You do this by calling the `task()` method of the `$fred` variable that's available in the file:

```
$fred->task('build', function () use ($fred) {
    // ... specify the tasks
});
```

All tasks begin by opening a file or multiple files and passing a Traversable of these files to `load()`. The best way to do this is by using the [Symfony Finder Component](http://symfony.com/doc/current/components/finder.html):

```
use Symfony\Component\Finder\Finder;

$fred->task('build', function () use ($fred) {
    $fred->load(Finder::create()->files()->name('*.js')->in('/web/assets/raw'));
});
```

You've now opened a Fred step sequence for all files with a `.js` extension in `/web/assets/raw`.

Now you can assign as many steps to this sequence as you want:

```
use Symfony\Component\Finder\Finder;
use WouterJ\Fred\Extension as Ext;

$fred->task('build', function () use ($fred) {
    $fred->load(Finder::create()->files()->name('*.js')->in('/web/assets/raw'))
        ->then(new Ext\JsHint())   // Lint the JS code using JsHint...
        ->then(new Ext\Uglify())   // ...minify the JS files using UglifyJS...
        ->then(new Ext\Compact())  // ...and combine all JS files into one file
    ;
});
```

At last, you have to output the generated code somewhere. This is done with the `dist()`function:

```
$fred->load(Finder::create()->files()->name('*.js')->in('/web/assets/raw'))
    ->then(new Ext\JsHint())
    ->then(new Ext\Uglify())
    ->then(new Ext\Compact())
    ->dist('/web/assets/script.min.js')
;
```

Now, the generated code is dumped in the `/web/assets/script.min.js` file.

You can run this task by using `fred build` (where `build` is the name of the task).

License
-------

[](#license)

The project is released under the BSD license. See the LICENSE file included in this package for more information.

Roadmap
-------

[](#roadmap)

Of course, all kind of changes are welcome (as long as it doesn't make the Fred more complex), but Fred should have learn the following things before reaching a stable version:

- Have more tests (that actually test the console app)
- Have a complete documentation
- Have more extensions and steps

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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

Total

4

Last Release

4126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6155db5d38999238ba21fc58a9e613adb354d846f6e74936dfd7fd505fb48bd?d=identicon)[Wouter J](/maintainers/Wouter%20J)

---

Top Contributors

[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (44 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wouterj-fred/health.svg)

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[crazywhalecc/static-php-cli

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

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)[civicrm/cv

CLI tool for CiviCRM

4219.8k](/packages/civicrm-cv)

PHPackages © 2026

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