8000 GitHub - aliozinan/cli-file-tree: Laravel CLI utility for file & folder selection with a menu interface using PHP School / CliMenu
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

aliozinan/cli-file-tree

Repository files navigation

Laravel CLI File Tree Menu (w/ navigation)

Build Status Total Downloads contributions welcome HitCount License

Laravel CLI utility for file selection with a menu interface using PHP School / CliMenu

Installation

You can install the package via composer:

composer require alio/cli-file-tree

Usage

This Laravel CLI utility basically allows you to select a folder or a file on your system using a menu interface with navigation feature and return the selected file's path.

You can also filter the files by (multiple) file extensions using the --filter option.

php artisan clifiletree [--filter=?] [--fg=?] [--bg=?]

--filter : (optional) display only folders or certain file types by extensions. Use 'folder' to display folders only. Supports multiple file extension filters by seperating with comma (Ex: csv,xls)
  --fg : (optional) foreground color (def. green)
  --bg : (optional) background color (def. black)

(possible color values : black, red, green, yellow, blue, magenta, cyan, white)

Below is an example to use the library in your project (the best use case is calling it from your custom command)

use Illuminate\Support\Facades\Artisan;
use Symfony\Component\Console\Output\BufferedOutput;

...

$output = new BufferedOutput;
Artisan::call('clifiletree', ['--filter' => 'csv'], $output);

$file = $output->fetch();

// do whatever you want with the $file

...

Screenshot

Testing

composer test

Additional Notes