Introduction
What is BYPC?
BYPC (build-your-php-cli) is a minimalist framework written in PHP for building command-line (CLI) applications. It was created to be the solution for developers who prefer a fully object-oriented approach, with well-defined classes, easy readability, and high customization.
Unlike monolithic solutions, BYPC delivers only the core (command registration, dispatch, and validation). All the behavior of your CLI — what each command does, which arguments it accepts, which categories it accepts — is defined by you, in your own classes.
Quick overview
php <file>.php <command> # Basic syntax
php <file>.php <command>:<category> <param> # Advanced syntax
Examples:
php bypc.php help
php bypc.php make:controller User
When to use BYPC?
BYPC is a good choice when you need:
- Build internal automation tools (scaffolding, deploy, custom migrations).
- Standardize CLI scripts across teams that already work with PHP.
- Quickly prototype a CLI without depending on large frameworks (Symfony Console, Laravel Artisan).
For projects that require complex option parsing, shell autocomplete, or message internationalization, consider more robust frameworks.
Next steps
- Continue with Installation to set up BYPC in your project.