php flo is the FloCMS command line. It creates code, runs migrations, manages users and checks your installation. Every command comes from Composer packages, so composer update brings new commands and fixes.
php flo # every command, grouped
php flo help make:controller # usage, arguments, options and examples
php flo make:controller --help # the same
php flo list api # the commands of one group
php flo list --format=json # for scripts
Abbreviations work when they're unambiguous: php flo mig runs migrate, and php flo m:st runs migrate:status.
Typos get a suggestion of the closest command.
Exit codes:0 success, 1 failure, 2 invalid usage, such as a missing argument. Errors go to STDERR, so scripts and cron jobs can rely on them.
Any folder. The project is the folder of the flo file, so php ../flo make:model Post from a subfolder still writes to models/.
Options every command accepts:
Option
Meaning
-h, --help
Show the command's usage, arguments, options and examples
-q, --quiet
Only print errors
-v, -vv, -vvv
More output; -vvv adds stack traces
-V, --version
The CLI and framework versions
--ansi, --no-ansi
Force or disable colors (NO_COLOR is respected)
-n, --no-interaction
Never ask; use defaults. Commands that need an answer fail.
PHP, extensions, package versions, environment, database and paths
doctor [--format=json]
Health check: PHP version and extensions, writable storage/ and views/cache/, .env, APP_KEY, APP_URL, debug mode in production, database, pending migrations, rewrite rules and document root. Exits with 1 when a check fails.
key:generate [--force] [--show]
Set APP_KEY in .env; --force replaces an existing key
env:check
Keys of .env.example missing from .env
serve [--host=127.0.0.1] [--port=8000]
PHP's built-in server for public/, routed like .htaccess (development only)
Empty storage/cache (module caches are kept unless --all)
view:clear
Remove compiled templates from views/cache
optimize
Compile every view and template ahead of time
optimize:clear
view:clear and cache:clear together
Clearing all caches can remove a configured module registry. After cache:clear --all, synchronize modules again before serving requests. optimize only compiles templates.