Coder Social home page Coder Social logo

cli-file-tree's Introduction

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

This package requires PHP posix extension enabled, it may not work in Windows Wamp/Xampp environments. Compatibility with the new Windows Terminal is being investigated.

Changelog

10/25/2019 - v1.0.0 released.

Issues

If you discover any problems please report in the issues section.

Contributors

Contributions and PRs are welcome!

License

The MIT License (MIT). Please see License File for more information.

cli-file-tree's People

Contributors

aliozinan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.