Skip to content

Simple extension for text output for php on command line.

Notifications You must be signed in to change notification settings

oscarweb/microcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microcli

Simple extension for text output for php on command line.

Install vía Composer

Just add this line to your composer.json file:

"oscarweb/microcli": "0.1.1"

or run

composer require oscarweb/microcli

Example Write

Create a new file: "example.php"

#!/usr/bin/php;
<?php
if(php_sapi_name() !== 'cli'){
	exit();
}
//- enter correct path
require 'vendor/autoload.php';

use Microcli\Microcli;

$app = new Microcli();

$app->color('success')->write('Lorem Ipsum...');

From your terminal run the file: php example.php

Example Write

Example Command

Create a new file: "command"

#!/usr/bin/php;
<?php
if(php_sapi_name() !== 'cli'){
	exit();
}
//- enter correct path
require 'vendor/autoload.php';

use Microcli\Microcli;

$app = new Microcli();

$app->addCommand('hello', function($argv) use ($app){
	$app->line();
	$app->color('success')->write('Hello World');
	$app->line();
	$app->exit();
});

$app->run($argv);

From your terminal run the file: php command hello

Example Command

You can see more examples here.

About

Simple extension for text output for php on command line.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages