Install the CLI, create a project
Start simple. Ship fast. โ
Some projects are just a few pages, a webhook, or a small API. Leaf is designed to let you start with the simplest structure that works and grow as the product needs it.
Run it
Your app is live athttp://localhost:5500
Need more structure? leaf create my-app --mvc gives you controllers, views and models up front. Everything else stays optional.
The smallest useful Leaf app โ
A lite project starts with enough structure to handle real requests without putting a framework ceremony between you and the product.
<?php
require __DIR__ . '/vendor/autoload.php';
app()->get('/', fn () => response()->json([
'message' => 'Hello from Leaf'
]));
app()->run();Working with an AI assistant โ
Leaf CLI creates a .leaf/CONTEXT.md file with context about your project. When using a coding assistant in your editor or terminal, ask it to read that file before making changes.
For example, if you tell your agent to implement a new messaging feature, it will automatically read the context from .leaf/CONTEXT.md and make changes that fit the existing project structure, and if your assistant cannot access the project folder, run:
leaf contextPaste the output into your conversation along with your request. See AI in Leaf for more on project context.
Add capabilities when the product asks โ
Leaf modules add focused features without replacing your starting point.
leaf install auth db mailOnce installed, modules use the same concise Leaf style:
auth()->login($credentials);
$user = db()
->select('users')
->where('email', $email)
->first();
mailer()
->to($user->email)
->send('welcome');Grow at your own pace โ
You do not need to predict the final architecture on day one. Choose the amount of structure the product needs now.
All three stages stay inside Leaf, so growth does not require a framework rewrite.
Deploy anywhere PHP runs โ
Leaf has no private runtime or hosting lock-in. Deploy to a VPS, shared hosting, containers, or a managed PHP platform using the same application you built locally.
When structure becomes useful
The same project can grow into Leaf MVC.Keep the ecosystem, add the application map.What to read next โ
Choose the part of the stack your next feature needs.
