https://github.com/leafsphp/seedling
🪴 Lightweight console application framework
https://github.com/leafsphp/seedling
Last synced: 4 days ago
JSON representation
🪴 Lightweight console application framework
- Host: GitHub
- URL: https://github.com/leafsphp/seedling
- Owner: leafsphp
- License: mit
- Created: 2025-09-28T13:18:51.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-10-23T18:06:18.000Z (3 months ago)
- Last Synced: 2025-12-19T02:56:20.729Z (about 1 month ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Seedling
[](https://packagist.org/packages/leafs/seedling)
[](https://packagist.org/packages/leafs/seedling)
[](https://packagist.org/packages/leafs/seedling)
Seedling is a lightweight PHP micro-framework for building CLI apps in minutes. It's built on top of Leaf Sprout and provides a simple and elegant syntax for defining commands, interacting with users, and handling input and output.
## 📦 Setting Up
You can create a seedling project using the Leaf CLI
```bash
leaf create my-seedling-app --console
```
Or with composer
```bash
composer create-project leafs/seedling my-seedling-app
```
Once installed, Seedling will automatically configure itself, so you can type out `php leaf` to run your app.
## Quick Start
In development, you can always access your commands as well as some built-in seedling commands by running
```bash
php leaf
```
But once you publish your package to composer, your users will be able to run your app using the name of the file in the `bin` directory. For example, if your file is named `greeter`, they can run
```bash
./vendor/bin/greeter
```
Or if installed globally
```bash
greeter
```
## Creating Commands
You can create your own commands by using the `g:command` command. For example, to create a `greet` command, you can run
```bash
php leaf g:command greet
```
This will create a new command in the `app/console` directory as `GreetCommand.php`, which will have some boilerplate code to get you started.
```php
argument('name');
$greeting = $this->option('greeting');
$this->info("$greeting, $name!");
return 0;
}
}
```
You can then run your command using
```bash
php leaf greet John --greeting Hi
```