A simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting with your app, previewing your app...
You can get this tool up and running on your system using composer:
composer global require leafs/cliMake sure to place Composer's system-wide vendor bin directory in your $PATH so the leaf executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:
- Windows:
%USERPROFILE%\AppData\Roaming\Composer\vendor\bin - macOS:
$HOME/.composer/vendor/bin - GNU / Linux Distributions:
$HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin
You could also find the composer's global installation path by running composer global about and looking up from the first line.
To start a new project, simply open up your console or terminal in your directory for projects and enter:
leaf create <project-name>This will generate a new Leaf PHP app in the <project-name> directory. You can also create Leaf API and Leaf MVC apps from the cli.
Leaf API:
leaf create <project-name> --apior
leaf create <project-name> -aLeaf MVC:
leaf create <project-name> --mvcor
leaf create <project-name> -mThis cli tool also adds a feature to install packages from composer
leaf install leafs/uiYou can also use the interactive shell to interact with your app.
$ leaf app:interact
...
>>> $user = new User;
...
>>> $user->name = "Mychi";
...
>>> $user->save();This opens up your app on the PHP local server.
leaf app:serveYou can also specify the port
leaf app:serve -p 8000Leaf CLI is open-sourced software licensed under the MIT license.