Cling

Cling Cling is a Micro Framework for Command Line Applications.

I Started working on Cling because i frequently find myself writing small CLI apps in PHP, and keep redoing code that should really be in a “Framework”.

Inspired a little by the Slim Framework.

Development and Releases are on Github

Features

  • Routing of Command Line Arguments
  • Short and Long Arguments
  • Automagic --help creation
  • Configuration

Requirements

  • PHP 5.3

“Hello World” Application

<?php
require 'Cling/Cling.php';

$app = new Cling();
$app->command('hello-world:', function($name) {
    echo "Hello $name\n";
})->help("Hello World Example Command.");

$app->run();